xwikisas / macro-pdfviewer

0 stars 4 forks source link

PDF Viewer Macro not modified to support attachment picker #14

Closed silviamacovei closed 3 years ago

silviamacovei commented 4 years ago

Comment from @ldubost : It seems "org.xwiki.model.reference.AttachmentReference" needs to be added to the field definition.

mflorea commented 3 years ago

The file parameter accepts an URL as value, besides an attachment name. So if we're going to use the attachment picker we need to make sure we can still set an URL (e.g. by allowing "free" values).

Then, setting the parameter type to org.xwiki.model.reference.AttachmentReference with the object editor is a first step. It would allow the user to easily select an attachment, but it wouldn't limit the suggestions to PDF attachments, which is what we want. For this we need to follow what has been done for the Office Viewer macro:

We need to be careful that support for binding a picker to a macro parameter type is available since 10.11 I think. So we probably need to edit the PDF Viewer macro on a recent version of XWiki, set the parameter type, export as XAR, add to source tree, apply xar:format, drop unneeded stuff, build for 9.11 and check if we can import.