Class VirtualViewerUtil
java.lang.Object
com.saperion.ngc.viewer.virtualviewer.VirtualViewerUtil
- All Implemented Interfaces:
Serializable
Utility class for Virtual Viewer.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionVirtualViewerUtil
(jakarta.servlet.http.HttpServletRequest request) Instantiates a new virtual viewer util. -
Method Summary
Modifier and TypeMethodDescriptiongetAnnotationsPostUrl
(String popupId) Gets the URL to be used when posting annotations.Gets the base url.Gets the name of the custom assets file for the current locale.Gets the doc-id without the element-id.static String
getPropertiesAsAppletParams
(String filename) Returns a string containing all applet parameters as read from the specified file.static DocumentId
getReleasedHdoc
(DocumentId documentId, OpenDocumentBean openDocumentBean, DocumentService docService) Gets the released hdoc.Gets the rotation angles from the bean.Gets the url of the retrieval-servlet.boolean
Checks if is supported format.boolean
isSupportedFormatByFilename
(String filename) Checks if the format by the given filename is supported by the virtual viewer.static void
rememberRotationForPage
(OpenDocumentBean bean, int page, int angle) Stores the angle by wich the specified page was rotated.
-
Constructor Details
-
VirtualViewerUtil
public VirtualViewerUtil(jakarta.servlet.http.HttpServletRequest request) Instantiates a new virtual viewer util.- Parameters:
request
- the request
-
-
Method Details
-
getCodebase
- Returns:
- the location of the applet's jar-file
-
getBaseUrl
Gets the base url.- Returns:
- the base url
-
getServletUrl
Gets the url of the retrieval-servlet.- Returns:
- the url of the retrieval servlet
-
getCustomAssetsFile
Gets the name of the custom assets file for the current locale.- Returns:
- the name of the custom assets file
-
getPropertiesAsAppletParams
Returns a string containing all applet parameters as read from the specified file.- Parameters:
filename
- file to read- Returns:
- string with properties to be added to an applet-tag
-
getAnnotationsPostUrl
Gets the URL to be used when posting annotations.- Parameters:
popupId
- id of the viewer-popup- Returns:
- URL as string
-
getDocIdWithoutElement
Gets the doc-id without the element-id. Needed in JSP for element-switching.- Parameters:
bean
- the document bean- Returns:
- the doc id without element-id
-
getReleasedHdoc
public static DocumentId getReleasedHdoc(DocumentId documentId, OpenDocumentBean openDocumentBean, DocumentService docService) throws AuthenticationException, SystemException Gets the released hdoc. If viewer is not in edit mode, a backend lookup for the released hdoc is performed and current released hdoc is returned, if exists.- Parameters:
documentId
- the document id to get current hdocopenDocumentBean
- the open document bean to check edit modedocService
- the doc service to make backend call to get possible released hdoc- Returns:
- the released hdoc in new DocumentId object, if released hdoc was found
- Throws:
AuthenticationException
- the authentication exceptionSystemException
- the system exception
-
isSupportedFormat
Checks if is supported format. First checks the element type of the given element. Second checks the supported format by the given elements filename.- Parameters:
elementInfo
- the filename- Returns:
- true, if is supported format
-
isSupportedFormatByFilename
Checks if the format by the given filename is supported by the virtual viewer.- Parameters:
filename
- The file to check the extension of.- Returns:
- true if the format is supported, false otherwise.
-
rememberRotationForPage
Stores the angle by wich the specified page was rotated.- Parameters:
bean
- current OpenDocumentBeanpage
- current pageangle
- last angle
-
getRotationAngles
Gets the rotation angles from the bean.- Parameters:
bean
- current OpenDocumentBean- Returns:
- the rotation angles
-
getSupportedFormats
- Returns:
- set of supported formats as configured in virtualviewer.properties
-