I'm pretty new to Share development so please bear with me.
What I'd like to do is the following :
1) Change the behaviour of the Aikau PdfJs viewer, so that it is maximized by default.
2) Show the PDF outline/thumbnail sidebar by default.
So, far I'm failing to make much progress on 1) - i've got the following config, and I suspect the <targetPackageRoot> is incorrect, but i've tried 'preview' and 'document-details' packages. The preview one seems the most logical.
What else do I need ? Is the below sufficient to push an updated config to the widget ?
What about the ID's ?
I couldnt figure out what the ID should be for AlfDocumentPreview, so I tried finding by name. At the moment, I dont think the .js is even being run, so its a non-starter.
Can you push a config to the widget without an ID ?
On the off-chance that i'm on the right track, is using 'widgetsForPluginsOverrides' the correct mechanism to use?
Finally, can I use the same mechanism to perform requirement 2) - It doesnt look like there is a flag for the sidebar, although the vanilla mozilla pdfjs appears to have a "sidebarViewOnLoad"... I can see there is a onSideBarToggle() method, but how can I cause this to fire ?
For what its worth, I have been through the excellent Aikau tutorials by Dave Draper, but I cant help feeling i'm missing something fundamental when it comes to lightly modifying a widget through a surf extension module.
Lastly, the document-details page is currently not based on the Aikau-based details page, which is only an experimental / work-in-progress page. This is a result of Alfresco not prioritising the migration of old YUI-based pages over to Aikau in the last years. So to customise the document previewer you would need to customise the legacy YUI PDF.js previewer component.
I’ve had some success. I’m sure there is a ‘nicer’ way of doing this, although I suspect the benefit is marginal given where I had to perform the change.
I modified the non-Aikau PdfJs.js directly : Initially I tried changing the value of the “maximized” to ‘true’ in the configuration attributes – this had no effect. I did, however have some success by calling the this.onMaximizeClick() at the end of _loadPdf.
I placed the file in in an amp at :
This had the effect of overwriting the OOTB file.