Closed silviamacovei closed 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:
PDFResourceReference
Java type similar to OfficeResourceReference
. For this we need a new (Java) module in the macro-pdfviewer
.file
PDF macro parameter to PDFResourceReference
PDFResourceReference
parameters are displayed, following what we did for OfficeResourceReference
.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.
Comment from @ldubost : It seems "org.xwiki.model.reference.AttachmentReference" needs to be added to the field definition.