Package com.saperion.util
Class QueryUtil
- java.lang.Object
-
- com.saperion.util.QueryUtil
-
public final class QueryUtil extends java.lang.Object
This query util shortens up certain SaClassicConnector calls.- Author:
- sts
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
autoGetElementNumber(java.util.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 java.util.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 java.util.List<com.saperion.intf.SaDocInfo.ElementInfo>
getElements(com.saperion.connector.SaClassicConnector connector, java.lang.String xhdoc)
Retrieves and returns the elements of the given document by requesting them via the given SaClassicConnector.static java.lang.String
getFileName(com.saperion.connector.SaClassicConnector connector, java.lang.String xhdoc, int element)
Retrieves and returns the filename of the specified element by requesting it via the given SaClassicConnector.static java.lang.String
getFileName(java.util.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 Detail
-
executePagingQuery
public static java.util.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 java.util.List<com.saperion.intf.SaDocInfo.ElementInfo> getElements(com.saperion.connector.SaClassicConnector connector, java.lang.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 java.lang.String getFileName(com.saperion.connector.SaClassicConnector connector, java.lang.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 java.lang.String getFileName(java.util.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(java.util.List<com.saperion.intf.SaDocInfo.ElementInfo> elements) throws java.lang.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:
java.lang.Exception
- when the structure is empty
-
-