Viewer utils
The IViewerUtils
help to use the viewer.
Load the viewer
Make the viewer available in your Easysite page.
Can be call in your controller’s prepareModel method or PageExtension’s onBeforeLoad method.
IViewerUtils viewerUtils = SDKFactory.UTILS.getViewerUtils();
viewerUtils.loadViewer("YOUR_VIEWER_ID", ViewerViewableManagerType.PROTOCOL_URI_VIEWABLE_MANAGER);
Use only ViewerViewableManagerType.PROTOCOL_URI_VIEWABLE_MANAGER value for now. (other value is for default add-on usage)
Create a link to open the viewer
IViewerUtils viewerUtils = SDKFactory.UTILS.getViewerUtils();
String url = viewerUtils.buildViewerLink("YOUR_VIEWER_ID", "FILE_PROTOCOL_URI", "FILE_NAME", new ArrayList<>());
In the last parameter, you can send :
- An empty list, navigation will not be available in the viewer
- A String collection of all sibling “PROTOCOL_URI”, the user can navigate and view all files (must contain all PROTOCOL_URI, including the FILE_PROTOCOL_URI for this link)