Package com.saperion.util
Class QueryUtil
java.lang.Object
com.saperion.util.QueryUtil
This query util shortens up certain SaClassicConnector calls.
- Author:
- sts
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
autoGetElementNumber
(List<com.saperion.intf.SaDocInfo.ElementInfo> elements) Automatically detects if the document contains only pages of a multipage-tiff that was archived without using DOCLOADORIGINAL.static List<com.saperion.intf.SaDocumentInfo>
executePagingQuery
(com.saperion.connector.SaClassicConnector connector, com.saperion.rmi.SaQueryInfo query, int count, int activePage) Executes a paged query by the given parameters.static List<com.saperion.intf.SaDocInfo.ElementInfo>
getElements
(com.saperion.connector.SaClassicConnector connector, String xhdoc) Retrieves and returns the elements of the given document by requesting them via the given SaClassicConnector.static String
getFileName
(com.saperion.connector.SaClassicConnector connector, String xhdoc, int element) Retrieves and returns the filename of the specified element by requesting it via the given SaClassicConnector.static String
getFileName
(List<com.saperion.intf.SaDocInfo.ElementInfo> elements, int element) Retrieves and returns the filename of the specified element by requesting it via the given SaClassicConnector.
-
Method Details
-
executePagingQuery
public static List<com.saperion.intf.SaDocumentInfo> executePagingQuery(com.saperion.connector.SaClassicConnector connector, com.saperion.rmi.SaQueryInfo query, int count, int activePage) throws com.saperion.exception.SaSystemException, com.saperion.exception.SaAuthenticationException, com.saperion.exception.SaDBException Executes a paged query by the given parameters.- Parameters:
connector
- The SaClassicConnector to be used.query
- The query to invoke.count
- The maximum number of results.activePage
- The page to be returned.- Returns:
- the query result.
- Throws:
com.saperion.exception.SaSystemException
- if an error occurs.com.saperion.exception.SaAuthenticationException
- if an error occurs.com.saperion.exception.SaDBException
- if an error occurs.
-
getElements
public static List<com.saperion.intf.SaDocInfo.ElementInfo> getElements(com.saperion.connector.SaClassicConnector connector, String xhdoc) throws com.saperion.exception.SaSystemException, com.saperion.exception.SaAuthenticationException Retrieves and returns the elements of the given document by requesting them via the given SaClassicConnector.- Parameters:
connector
- The SaClassicConnector to be used.xhdoc
- The document id to be used.- Returns:
- The elements of the given document.
- Throws:
com.saperion.exception.SaSystemException
- if an error occurs.com.saperion.exception.SaAuthenticationException
- if an authentication error occurs.
-
getFileName
public static String getFileName(com.saperion.connector.SaClassicConnector connector, String xhdoc, int element) throws com.saperion.exception.SaSystemException, com.saperion.exception.SaAuthenticationException Retrieves and returns the filename of the specified element by requesting it via the given SaClassicConnector.- Parameters:
connector
- The SaClassicConnector to be used.xhdoc
- The document id to be used.element
- The element number to be used.- Returns:
- The filename of the document element.
- Throws:
com.saperion.exception.SaSystemException
- if an error occurs.com.saperion.exception.SaAuthenticationException
- if an authentication error occurs.
-
getFileName
public static String getFileName(List<com.saperion.intf.SaDocInfo.ElementInfo> elements, int element) throws com.saperion.exception.SaSystemException, com.saperion.exception.SaAuthenticationException Retrieves and returns the filename of the specified element by requesting it via the given SaClassicConnector.- Parameters:
elements
- The document's structureelement
- The element number to be used.- Returns:
- The filename of the document element.
- Throws:
com.saperion.exception.SaSystemException
- if an error occurs.com.saperion.exception.SaAuthenticationException
- if an authentication error occurs.
-
autoGetElementNumber
public static int autoGetElementNumber(List<com.saperion.intf.SaDocInfo.ElementInfo> elements) throws Exception Automatically detects if the document contains only pages of a multipage-tiff that was archived without using DOCLOADORIGINAL. If so, -1 will be returned so that the ClassicConnector will deliver a merged multipage tiff with all pages. Otherwise, 1 will be returned to get the first page.- Parameters:
elements
- the document's structure- Returns:
- element number to use
- Throws:
Exception
- when the structure is empty
-