Package com.saperion.ngc.model.resultset
Class QueryClassicConnectorService
- java.lang.Object
-
- com.saperion.ngc.model.ClassicConnectorService
-
- com.saperion.ngc.model.resultset.QueryClassicConnectorService
-
- All Implemented Interfaces:
QueryService
,Service
public class QueryClassicConnectorService extends ClassicConnectorService implements QueryService
Query service.
-
-
Field Summary
-
Fields inherited from class com.saperion.ngc.model.ClassicConnectorService
ddcCache
-
-
Constructor Summary
Constructors Constructor Description QueryClassicConnectorService(int pageSize)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearFilter()
Clears the last applied filter.void
clearLastResult()
Clears the result of the last query.int
executeCountQuery(com.saperion.rmi.SaQueryInfo query)
Executes a count query.ModelResult
executePagingQuery(ResultPaging paging)
Execute query with paging.ModelResult
executeQuery(com.saperion.rmi.SaQueryInfo query)
Execute query.DocumentDatabaseMetaInfo
getAttachmentInfo(com.saperion.intf.wf.TaskInfo info)
Loads the attachment for the specifiedTaskInfo
.java.util.Map<java.lang.String,com.saperion.intf.SaFieldDescription>
getFieldDescriptions(java.lang.String ddcName)
Returns a map ofSaFieldDescriptions of the given DDC. int
getHitCount(com.saperion.rmi.SaQueryInfo info)
Returns the number of hits for the specified query.ResultProperties
getInboxTaskProperties(java.lang.String taskId)
Returns the metadata for a task with the specified ID.ModelResult
getLastResult()
ResultProperties
getResultAtIndex(int index)
Returns the ResultProperties contained in the result list of the last search at the specified index.ResultProperties
getResultForId(DocumentId id)
Returns the ResultProperties contained in the result list of the last search with the specified id.ModelResult
getResultPage(int page, boolean withNewPaging)
Get page from last result.ResultProperties
getResultPropertiesForRevision(DocumentId id)
Returns the ResultProperties contained in the result list of the last search with the specified revisionId.ModelResult
performClientSideFiltering(RowFilterSettings settings)
Filters the current result set.ModelResult
performClientSideSorting(java.util.Map<java.lang.String,SortDirection> columns, int page)
Sorts the current result set.ModelResult
searchFolderDocuments(java.lang.String folderId, java.lang.String folderDDC, com.saperion.rmi.SaQueryInfo hqlFilter)
HQL search extended with additional folder informations and depth.void
setPageSize(int size)
Sets the page size.void
updateRow(ResultProperties documentInfo)
Updates the row in the previous query-result.-
Methods inherited from class com.saperion.ngc.model.ClassicConnectorService
convertAuthenticationException, getCachedDDC, getConnectionProvider, getCurrentUserFromSession, getSession, getWfConnectionProvider, isActive
-
-
-
-
Method Detail
-
getInboxTaskProperties
public ResultProperties getInboxTaskProperties(java.lang.String taskId) throws AuthenticationException, SystemException, WorkflowException
Description copied from interface:QueryService
Returns the metadata for a task with the specified ID.- Specified by:
getInboxTaskProperties
in interfaceQueryService
- Parameters:
taskId
- ID of the task (SYSROWID)- Returns:
- task's metadata
- Throws:
AuthenticationException
- authentication error when loading metadataSystemException
- system error when loading metadataWorkflowException
- workflow error when loading metadata
-
getAttachmentInfo
public DocumentDatabaseMetaInfo getAttachmentInfo(com.saperion.intf.wf.TaskInfo info) throws SystemException, AuthenticationException, DatabaseException
Loads the attachment for the specifiedTaskInfo
.- Specified by:
getAttachmentInfo
in interfaceQueryService
- Parameters:
info
- task to load attachment for- Returns:
- attachment or null if not found
- Throws:
SystemException
- system error when loading attachmentAuthenticationException
- authentication error when loading attachmentDatabaseException
- database error when loading attachment- See Also:
QueryService.getAttachmentInfo(com.saperion.intf.wf.TaskInfo)
-
executePagingQuery
public final ModelResult executePagingQuery(ResultPaging paging) throws AuthenticationException, SystemException
Execute query with paging.- Specified by:
executePagingQuery
in interfaceQueryService
- Parameters:
paging
- paging- Returns:
- ModelResult
- Throws:
AuthenticationException
- authentication exceptionSystemException
- system exception- See Also:
(com.saperion.ngc.model.resultset.ResultPaging)
-
executeCountQuery
public final int executeCountQuery(com.saperion.rmi.SaQueryInfo query) throws AuthenticationException, SystemException
Executes a count query.- Specified by:
executeCountQuery
in interfaceQueryService
- Parameters:
query
- Count query- Returns:
- Count
- Throws:
AuthenticationException
- authentication exceptionSystemException
- system exception- See Also:
QueryService.executeCountQuery(com.saperion.rmi.SaQueryInfo)
-
executeQuery
public final ModelResult executeQuery(com.saperion.rmi.SaQueryInfo query) throws AuthenticationException, SystemException, WorkflowException, DatabaseException
Execute query.- Specified by:
executeQuery
in interfaceQueryService
- Parameters:
query
- query statement- Returns:
- ModelResult
- Throws:
AuthenticationException
- authentication exceptionSystemException
- system exceptionWorkflowException
- workflow exceptionDatabaseException
- database exception- See Also:
QueryService.executeQuery(com.saperion.rmi.SaQueryInfo)
-
getLastResult
public final ModelResult getLastResult()
- Specified by:
getLastResult
in interfaceQueryService
- Returns:
- The last query result that was sent to the view.
- See Also:
QueryService.getLastResult()
-
getResultAtIndex
public final ResultProperties getResultAtIndex(int index)
Returns the ResultProperties contained in the result list of the last search at the specified index.- Specified by:
getResultAtIndex
in interfaceQueryService
- Parameters:
index
- index- Returns:
- ResultProperties at index
- See Also:
QueryService.getResultAtIndex(int)
-
getResultForId
public ResultProperties getResultForId(DocumentId id) throws DocumentIdentificationException
Returns the ResultProperties contained in the result list of the last search with the specified id.- Specified by:
getResultForId
in interfaceQueryService
- Parameters:
id
- Document id- Returns:
- ResultProperties with id
- Throws:
DocumentIdentificationException
- Identification exception- See Also:
QueryService.getResultForId(com.saperion.ngc.model.document.DocumentId)
-
getResultPropertiesForRevision
public ResultProperties getResultPropertiesForRevision(DocumentId id)
Returns the ResultProperties contained in the result list of the last search with the specified revisionId.- Specified by:
getResultPropertiesForRevision
in interfaceQueryService
- Parameters:
id
- Document id- Returns:
- ResultProperties
- See Also:
(com.saperion.ngc.model.document.DocumentId)
-
performClientSideSorting
public final ModelResult performClientSideSorting(java.util.Map<java.lang.String,SortDirection> columns, int page)
Sorts the current result set.- Specified by:
performClientSideSorting
in interfaceQueryService
- Parameters:
columns
- the columns and directions used for sortingpage
- the page currently displayed- Returns:
- ModelResult
- See Also:
QueryService.performClientSideSorting(java.util.Map, int)
-
performClientSideFiltering
public ModelResult performClientSideFiltering(RowFilterSettings settings)
Filters the current result set.- Specified by:
performClientSideFiltering
in interfaceQueryService
- Parameters:
settings
- filter settings- Returns:
- ModelResult
-
clearFilter
public void clearFilter()
Clears the last applied filter.- Specified by:
clearFilter
in interfaceQueryService
-
getResultPage
public ModelResult getResultPage(int page, boolean withNewPaging)
Get page from last result.- Specified by:
getResultPage
in interfaceQueryService
- Parameters:
page
- page to displaywithNewPaging
- set to true, when the paging has changed and needs to be reinitialized- Returns:
- ModelResult
-
getFieldDescriptions
public java.util.Map<java.lang.String,com.saperion.intf.SaFieldDescription> getFieldDescriptions(java.lang.String ddcName) throws com.saperion.exception.SaSystemException, com.saperion.exception.SaAuthenticationException
Returns a map ofSaFieldDescriptions of the given DDC. - Specified by:
getFieldDescriptions
in interfaceQueryService
- Parameters:
ddcName
- The name of the DDC to get the SaFieldDescriptions of.- Returns:
- a map of SaFieldDescriptions of the given DDC.
- Throws:
com.saperion.exception.SaSystemException
- system exceptioncom.saperion.exception.SaAuthenticationException
- authentication exception- See Also:
QueryService.getFieldDescriptions(java.lang.String)
-
setPageSize
public void setPageSize(int size)
Description copied from interface:QueryService
Sets the page size.- Specified by:
setPageSize
in interfaceQueryService
- Parameters:
size
- page size
-
searchFolderDocuments
public ModelResult searchFolderDocuments(java.lang.String folderId, java.lang.String folderDDC, com.saperion.rmi.SaQueryInfo hqlFilter) throws SystemException, AuthenticationException
HQL search extended with additional folder informations and depth.- Specified by:
searchFolderDocuments
in interfaceQueryService
- Parameters:
folderId
- folder idfolderDDC
- Folder DDChqlFilter
- hql filter containing only the where-clause- Returns:
- ModelResult to display
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
QueryService.searchFolderDocuments(java.lang.String, java.lang.String, com.saperion.rmi.SaQueryInfo)
-
getHitCount
public int getHitCount(com.saperion.rmi.SaQueryInfo info) throws SystemException, AuthenticationException, DatabaseException
Returns the number of hits for the specified query.- Specified by:
getHitCount
in interfaceQueryService
- Parameters:
info
- query to get hits for- Returns:
- number of hits
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exceptionDatabaseException
- database exception- See Also:
QueryService.getHitCount(com.saperion.rmi.SaQueryInfo)
-
clearLastResult
public void clearLastResult()
Description copied from interface:QueryService
Clears the result of the last query.- Specified by:
clearLastResult
in interfaceQueryService
-
updateRow
public void updateRow(ResultProperties documentInfo) throws DocumentIdentificationException
Description copied from interface:QueryService
Updates the row in the previous query-result. This method throws anIllegalArgumentException
when the specified row is not contained in the previous query-result. The provided metadata must contain the same original index as the row that is to be updated.- Specified by:
updateRow
in interfaceQueryService
- Parameters:
documentInfo
- the metadata of the row to be updated.- Throws:
DocumentIdentificationException
- when the documentInfo did not contain an ID or contained an incomplete ID.
-
-