Package com.saperion.ngc.resultset
Class ResultSetPresenter
- java.lang.Object
-
- com.saperion.ngc.resultset.ResultSetPresenter
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ItemAnalyzeResult
analyzeItems(java.util.Collection<ResultListItem> items, boolean useAttachment)
Analyze the items.WorkflowItemAnalyzeResult
analyzeWorkflowItems(java.util.Collection<ResultListItem> items)
Analyze the workflow items.void
clearLastResult()
Clears the result of the last query.boolean
doDeleteDocument(DocumentId id)
Delete document.boolean
doDeleteDocument(DocumentId id, boolean finalDelete)
Delete document.void
doUndelet(ResultProperties row, java.lang.String comment)
Undeleted the document.void
editStructure(DocumentId documentId)
Shows the dialog to edit a document's structure.com.saperion.connector.wf.WorkflowResult
executeWfCommand(WorkflowActionBean action)
Executes the given workflow action.void
export()
Exports the current query result.void
export(java.util.Map<java.lang.String,java.lang.String> columnsToExport, ResultSetView.ExportFormat format, java.lang.String filename)
Exports the current query result.void
externalStorageUpload(DocumentId documentId, com.saperion.externalstorage.client.ExternalStorageClient client, com.saperion.externalstorage.ExternalStorageType storageType)
Upload a saperion document to ShareBasevoid
externalStorageUploadStatus(boolean uploadStatus, com.saperion.externalstorage.library.Document uploadedDocument, com.saperion.externalstorage.client.ExternalStorageClient externalStorageClient, com.saperion.externalstorage.ExternalStorageType externalStorageType)
DocumentId
fixVersion(DocumentId documentId)
Fill value for revision ID in document ID if not set.java.util.List<java.lang.String>
getAclNames(DocumentId documentId)
Returns the ACLs of a document.java.util.List<java.lang.String>
getAllAcls()
Returns a list of all ACL names.java.util.List<com.saperion.intf.wf.CommentInfo>
getComments(com.saperion.intf.wf.TaskInfo taskInfo)
Retrieves the comments for the specified task.ResultsetConfiguration
getConfig()
Gets the config.com.saperion.intf.DDC
getDdc(java.lang.String ddcName)
Returns the DDC with the specified name.ResultProperties
getDocProperties(DocumentId id)
Reads the properties for the given document.ResultProperties
getDocProperties(DocumentId id, boolean isDeleted)
Reads the properties for the given document.java.util.List<FolderId>
getDocumentFolders(DocumentId documentId)
Retrieves the folders that contain the specified document.ResultProperties
getDocumentInfoFromArchive(DocumentId id, boolean currentRevision)
java.util.List<DocumentArchiveMetaInfo.ElementArchiveMetaInfo>
getDocumentPages(DocumentId id, boolean currentRevision)
Returns the amount of pages for the specified document.DocumentVersionInfo
getDocumentVersion(java.lang.String versionId)
Returns the version information for the specified version ID.java.util.List<java.lang.String>
getDocumentVersionIDs(DocumentId id)
Returns the version IDs for the specified document.java.util.List<DocumentVersionInfo>
getDocumentVersions(DocumentId id)
Retrieves the version information for a document.java.util.Map<java.lang.String,com.saperion.intf.SaFieldDescription>
getFieldDescriptions(java.lang.String ddc)
Returns a map ofSaFieldDescriptions of the given DDC. java.lang.String
getFormDDC()
Gets the form ddc.java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>>
getFullTextFields(java.lang.String ddcName, java.util.List<java.lang.String> fullTextFields, java.lang.String hdoc)
Fetches values of Full text columnsjava.util.List<java.lang.String>
getLastLaunched()
Gets the last launched.ResultProperties
getSelectedRow(int index)
Retrieves the row at the specific index.com.saperion.intf.wf.WorkflowMember
getSelectedUserTreeRoot(java.util.List<com.saperion.intf.wf.WorkflowMember> selectedMembers)
Gets the user tree root element with selected users as children.com.saperion.intf.wf.WorkflowMember
getUserTreeRoot(java.lang.String filter)
Gets the user tree root element and its direct children.boolean
isAllowedToViewHistory(DocumentId docId)
boolean
isContainedInFolder()
Checks if the document is contained in one or more folders from current user or other users.boolean
isLockedForEditing(DocumentId id)
Checks if the document with the specified ID is locked for editing in this result set.boolean
isSelectionAllowed()
Checks, if the selection is allowed and not locked nor checked out.java.lang.String
localizeString(java.lang.String toLocalize)
Localizes a string using the localize table.void
oneDriveLogin(DocumentId documentId)
Opens OneDrive login dialogvoid
prolongRetention(ResultProperties row, java.util.Date prolongDate)
void
reduceDisposition(ResultProperties row, java.util.Date dispositionDate)
void
removeFromFolder(DocumentId documentId, java.util.Set<FolderId> folderIDs)
Removes the documents from the specified folder.void
saveLastLaunched(java.lang.String lastName)
Save last launched.void
sendErrorMessageToView(LogMessage message)
Sends an error message to the view.void
sendLogonMessageToView(LogonEvent.LogonResult result, java.lang.String userName)
Sends a logon message to the view.void
setDocumentRead(ResultListItem item)
Sets the specified document's state to 'read'.void
setDocumentUnread(ResultListItem item)
Sets the specified document's state to 'unread'.void
setlitigationhold(DocumentId documentId, boolean activate)
Sets the specified document's litigationhold to 'read'.void
shareBaseLogin(DocumentId documentId)
Opens ShareBase login dialogcom.saperion.connector.wf.WorkflowResult
startWorkflow(LaunchWorkflowBean launchBean)
Starts a business case.void
updateListItem(ResultListItem item)
Updated the specified listitem in the containedResultList
as well as in the current result stored in theQueryService
.com.saperion.externalstorage.library.Document
uploadDocToExternalStorage(DocumentId documentId, java.lang.String selectedFolderID, com.saperion.externalstorage.client.ExternalStorageClient externalStorageClient, com.saperion.externalstorage.ExternalStorageType storageType)
void
writeAuditEvent(java.lang.String hdoc, DocumentService.AuditEvent event, java.lang.String remark)
-
-
-
Method Detail
-
getConfig
public ResultsetConfiguration getConfig()
Gets the config.- Returns:
- Configuration
-
isLockedForEditing
public boolean isLockedForEditing(DocumentId id)
Checks if the document with the specified ID is locked for editing in this result set.- Parameters:
id
- ID of the document to check- Returns:
- true if the document is locked for editing in this result set
-
writeAuditEvent
public void writeAuditEvent(java.lang.String hdoc, DocumentService.AuditEvent event, java.lang.String remark) throws SystemException, AuthenticationException
-
doDeleteDocument
public boolean doDeleteDocument(DocumentId id) throws NgcUiException, AuthenticationException
Delete document.- Parameters:
id
- Document Id- Returns:
- True, if done
- Throws:
NgcUiException
- when a system error occurs or document access error or user has no permissions to access this document.AuthenticationException
- when the user logged off.
-
doDeleteDocument
public boolean doDeleteDocument(DocumentId id, boolean finalDelete) throws NgcUiException, AuthenticationException
Delete document.- Parameters:
id
- Document IdfinalDelete
- set to true if the document was marked as deleted before (sysindexstate 65002)- Returns:
- True, if done
- Throws:
NgcUiException
- when a system error occurs or document access error or user has no permissions to access this document.AuthenticationException
- when the user logged off.
-
getDocProperties
public ResultProperties getDocProperties(DocumentId id) throws NgcUiException, AuthenticationException
Reads the properties for the given document.- Parameters:
id
- Document id- Returns:
- Result properties
- Throws:
NgcUiException
- when s system error occurred or user has no permissions to access this document.AuthenticationException
- when user is logged off.
-
getDocProperties
public ResultProperties getDocProperties(DocumentId id, boolean isDeleted) throws NgcUiException, AuthenticationException
Reads the properties for the given document.- Parameters:
id
- Document idisDeleted
- pass true if document is deleted- Returns:
- Result properties
- Throws:
NgcUiException
- when s system error occurred or user has no permissions to access this document.AuthenticationException
- when user is logged off.
-
getSelectedRow
public ResultProperties getSelectedRow(int index)
Retrieves the row at the specific index.- Parameters:
index
- index of item- Returns:
- Row properties
-
getAllAcls
public java.util.List<java.lang.String> getAllAcls() throws NgcUiException, AuthenticationException
Returns a list of all ACL names.- Returns:
- List of ACL names or null
- Throws:
NgcUiException
- when system error occurs due to a query execution or user has no permissions to execute this query.AuthenticationException
- when user is logged off.
-
getAclNames
public java.util.List<java.lang.String> getAclNames(DocumentId documentId) throws NgcUiException, AuthenticationException
Returns the ACLs of a document.- Parameters:
documentId
- document id- Returns:
- a list of ACL names that are set on the specified document
- Throws:
NgcUiException
- when system error occurs due to a query execution or user has no permissions to execute this query.AuthenticationException
- when user is logged off.
-
startWorkflow
public com.saperion.connector.wf.WorkflowResult startWorkflow(LaunchWorkflowBean launchBean) throws NgcUiException
Starts a business case.- Parameters:
launchBean
- LaunchWorkflowBean- Returns:
- True, if done
- Throws:
NgcUiException
- when workflow start failed
-
executeWfCommand
public com.saperion.connector.wf.WorkflowResult executeWfCommand(WorkflowActionBean action) throws NgcUiException
Executes the given workflow action.- Parameters:
action
- WorkflowActionBean- Returns:
- WorkflowResult
- Throws:
NgcUiException
- when workflow action failed.
-
getUserTreeRoot
public com.saperion.intf.wf.WorkflowMember getUserTreeRoot(java.lang.String filter) throws NgcUiException
Gets the user tree root element and its direct children.- Parameters:
filter
- filter string- Returns:
- root member
- Throws:
NgcUiException
- when system error occurred or workflow exception.
-
getSelectedUserTreeRoot
public com.saperion.intf.wf.WorkflowMember getSelectedUserTreeRoot(java.util.List<com.saperion.intf.wf.WorkflowMember> selectedMembers) throws NgcUiException
Gets the user tree root element with selected users as children.- Parameters:
selectedMembers
- list of selected members.- Returns:
- root member
- Throws:
NgcUiException
- when system error occurred or workflow exception.
-
getLastLaunched
public java.util.List<java.lang.String> getLastLaunched() throws NgcUiException, AuthenticationException
Gets the last launched.- Returns:
- Last launched workflows
- Throws:
NgcUiException
- when system error occurred or user has no permissions to execute this query.AuthenticationException
- when user is logged off.
-
saveLastLaunched
public void saveLastLaunched(java.lang.String lastName) throws NgcUiException, AuthenticationException
Save last launched.- Parameters:
lastName
- Last launched workflow name- Throws:
NgcUiException
- when system error occurred or user has no permissions to access this document.AuthenticationException
- when user is logged off.
-
isSelectionAllowed
public boolean isSelectionAllowed() throws NgcUiException, AuthenticationException
Checks, if the selection is allowed and not locked nor checked out.- Returns:
- Allowed
- Throws:
NgcUiException
- when system error occurred or user has no permissions to execute this query.AuthenticationException
- when user is logged off.
-
isContainedInFolder
public boolean isContainedInFolder() throws NgcUiException, AuthenticationException
Checks if the document is contained in one or more folders from current user or other users.- Returns:
- true if it is contained in one or more folders.
- Throws:
NgcUiException
- when system error occurred or user has no permissions to execute this query.AuthenticationException
- when user is logged off.
-
getDocumentPages
public java.util.List<DocumentArchiveMetaInfo.ElementArchiveMetaInfo> getDocumentPages(DocumentId id, boolean currentRevision) throws NgcUiException, AuthenticationException
Returns the amount of pages for the specified document.- Parameters:
id
- document id.currentRevision
- the current revision- Returns:
- pages
- Throws:
NgcUiException
- when system error occurred or document-id cannot be found or user has no permissions to execute this query.AuthenticationException
- when user is logged off.
-
getDocumentFolders
public java.util.List<FolderId> getDocumentFolders(DocumentId documentId) throws NgcUiException, AuthenticationException
Retrieves the folders that contain the specified document.- Parameters:
documentId
- document's hdoc.- Returns:
- list of FolderInfos.
- Throws:
NgcUiException
- when system error occurred or user has no permissions to execute this query.AuthenticationException
- when user is logged off.
-
analyzeItems
public ItemAnalyzeResult analyzeItems(java.util.Collection<ResultListItem> items, boolean useAttachment) throws NgcUiException, AuthenticationException
Analyze the items.- Parameters:
items
- ItemsuseAttachment
- if true, the attachments are analyzed in case of workflow items- Returns:
- Analyze result
- Throws:
NgcUiException
- when system error occurred or document-id cannot be found or user has no permissions to execute this query.AuthenticationException
- when user is logged off.
-
getDocumentInfoFromArchive
public ResultProperties getDocumentInfoFromArchive(DocumentId id, boolean currentRevision) throws AuthenticationException, NgcUiException
- Parameters:
id
- document's IDcurrentRevision
- whether to resolve current revision or not- Returns:
- metadata of the document from archive
- Throws:
AuthenticationException
- re-logon requiredNgcUiException
- exception to be handled by view
-
analyzeWorkflowItems
public WorkflowItemAnalyzeResult analyzeWorkflowItems(java.util.Collection<ResultListItem> items) throws NgcUiException, AuthenticationException
Analyze the workflow items.- Parameters:
items
- Items- Returns:
- Analyze result
- Throws:
NgcUiException
- when system error occurred or document-id cannot be found or user has no permissions to execute this query.AuthenticationException
- when user is logged off.
-
getDocumentVersions
public java.util.List<DocumentVersionInfo> getDocumentVersions(DocumentId id) throws NgcUiException, AuthenticationException
Retrieves the version information for a document.- Parameters:
id
- document id- Returns:
- list of version informations
- Throws:
NgcUiException
- Error occurred during executing query.AuthenticationException
- when user is logged off.
-
getDocumentVersionIDs
public java.util.List<java.lang.String> getDocumentVersionIDs(DocumentId id) throws NgcUiException, AuthenticationException
Returns the version IDs for the specified document.- Parameters:
id
- document ID- Returns:
- list of version IDs
- Throws:
NgcUiException
- exception to be handled by viewAuthenticationException
- re-logon required
-
getDocumentVersion
public DocumentVersionInfo getDocumentVersion(java.lang.String versionId) throws NgcUiException, AuthenticationException
Returns the version information for the specified version ID.- Parameters:
versionId
- version ID- Returns:
- version information
- Throws:
NgcUiException
- exception to be handled by viewAuthenticationException
- re-logon required
-
getFieldDescriptions
public java.util.Map<java.lang.String,com.saperion.intf.SaFieldDescription> getFieldDescriptions(java.lang.String ddc) throws NgcUiException
Returns a map ofSaFieldDescriptions of the given DDC. - Parameters:
ddc
- The name of the DDC to get the SaFieldDescriptions of.- Returns:
- a map of SaFieldDescriptions of the given DDC.
- Throws:
NgcUiException
- if an error occurs.
-
sendLogonMessageToView
public void sendLogonMessageToView(LogonEvent.LogonResult result, java.lang.String userName)
Sends a logon message to the view.- Parameters:
result
- logon resultuserName
- user name
-
getComments
public java.util.List<com.saperion.intf.wf.CommentInfo> getComments(com.saperion.intf.wf.TaskInfo taskInfo) throws NgcUiException, AuthenticationException
Retrieves the comments for the specified task.- Parameters:
taskInfo
- task info- Returns:
- list of comments
- Throws:
NgcUiException
- when comments cannot be added due to a system error or due to a workflow exception.AuthenticationException
- when user is logged off.
-
localizeString
public java.lang.String localizeString(java.lang.String toLocalize)
Localizes a string using the localize table.- Parameters:
toLocalize
- string to localize.- Returns:
- localized string or original string if no localized version was found.
-
getFormDDC
public java.lang.String getFormDDC()
Gets the form ddc.- Returns:
- Form DDC
-
sendErrorMessageToView
public void sendErrorMessageToView(LogMessage message)
Sends an error message to the view.- Parameters:
message
- log message
-
removeFromFolder
public void removeFromFolder(DocumentId documentId, java.util.Set<FolderId> folderIDs) throws AuthenticationException, NgcUiException
Removes the documents from the specified folder.- Parameters:
documentId
- document IDfolderIDs
- the folder i ds- Throws:
AuthenticationException
- authentication exceptionNgcUiException
- the ngc ui exception
-
isAllowedToViewHistory
public boolean isAllowedToViewHistory(DocumentId docId)
- Parameters:
docId
- The id of the document in question- Returns:
- whether the current user may view the revision histories documents
-
doUndelet
public void doUndelet(ResultProperties row, java.lang.String comment) throws AuthenticationException, NgcUiException
Undeleted the document.- Parameters:
row
- row representing the documentcomment
- comment for new revision- Throws:
AuthenticationException
- re-logon requiredNgcUiException
- exception to be handled by view
-
fixVersion
public DocumentId fixVersion(DocumentId documentId) throws SystemException, AuthenticationException
Fill value for revision ID in document ID if not set.- Parameters:
documentId
- ID to fix revision ID for if required- Returns:
- ID with revision ID
- Throws:
SystemException
- system error when resolving revision IDAuthenticationException
- re-logon required or not authorized
-
export
public void export() throws NgcUiException
Exports the current query result.- Throws:
NgcUiException
- exception to be handled by view
-
export
public void export(java.util.Map<java.lang.String,java.lang.String> columnsToExport, ResultSetView.ExportFormat format, java.lang.String filename) throws NgcUiException
Exports the current query result.- Parameters:
columnsToExport
- columns to be exported. The map contains the upper-case column names as in the database as keys and the desired display-names of the columns as values.format
- the format to export tofilename
- the name of the resulting file- Throws:
NgcUiException
- exception to be handled by view
-
setDocumentRead
public void setDocumentRead(ResultListItem item) throws NgcUiException, AuthenticationException
Sets the specified document's state to 'read'.- Parameters:
item
- item representing the document- Throws:
NgcUiException
- Exception to be handled by viewAuthenticationException
- re-logon required
-
setDocumentUnread
public void setDocumentUnread(ResultListItem item) throws NgcUiException, AuthenticationException
Sets the specified document's state to 'unread'.- Parameters:
item
- item representing the document- Throws:
NgcUiException
- Exception to be handled by viewAuthenticationException
- re-logon required
-
editStructure
public void editStructure(DocumentId documentId) throws NgcUiException, AuthenticationException
Shows the dialog to edit a document's structure.- Parameters:
documentId
- ID of the document to edit- Throws:
NgcUiException
- Exception to be handled by viewAuthenticationException
- re-logon required
-
clearLastResult
public void clearLastResult()
Clears the result of the last query.
-
updateListItem
public void updateListItem(ResultListItem item) throws NgcUiException, AuthenticationException
Updated the specified listitem in the containedResultList
as well as in the current result stored in theQueryService
.- Parameters:
item
- the item to be updated- Throws:
NgcUiException
- exception to be handled by viewAuthenticationException
- re-logon required
-
getDdc
public com.saperion.intf.DDC getDdc(java.lang.String ddcName) throws AuthenticationException, NgcUiException
Returns the DDC with the specified name.- Parameters:
ddcName
- the name of the ddc- Returns:
- the ddc
- Throws:
AuthenticationException
- re-logon requiredNgcUiException
- exception to be handled by view
-
getFullTextFields
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>> getFullTextFields(java.lang.String ddcName, java.util.List<java.lang.String> fullTextFields, java.lang.String hdoc) throws AuthenticationException, SystemException
Fetches values of Full text columns- Parameters:
ddcName
- name of the DDCfullTextFields
- List of fields which are of Text retrieval type. Make sure to prefixSaConstants.FULL_TEXT_COLUMN_PREFIX
hdoc
- xhdoc of the document- Returns:
- Set of entries containing full text coulmn and corresponding value
- Throws:
AuthenticationException
SystemException
-
externalStorageUpload
public void externalStorageUpload(DocumentId documentId, com.saperion.externalstorage.client.ExternalStorageClient client, com.saperion.externalstorage.ExternalStorageType storageType) throws AuthenticationException, NgcUiException
Upload a saperion document to ShareBase- Parameters:
documentId
- saperion document id- Throws:
AuthenticationException
NgcUiException
-
shareBaseLogin
public void shareBaseLogin(DocumentId documentId)
Opens ShareBase login dialog- Parameters:
documentId
- document id for which sharebase event is happening
-
oneDriveLogin
public void oneDriveLogin(DocumentId documentId)
Opens OneDrive login dialog- Parameters:
documentId
- id of the document associated with onedrive event
-
uploadDocToExternalStorage
public com.saperion.externalstorage.library.Document uploadDocToExternalStorage(DocumentId documentId, java.lang.String selectedFolderID, com.saperion.externalstorage.client.ExternalStorageClient externalStorageClient, com.saperion.externalstorage.ExternalStorageType storageType) throws com.saperion.externalstorage.exception.ExternalStorageException, NgcUiException, AuthenticationException
- Throws:
com.saperion.externalstorage.exception.ExternalStorageException
NgcUiException
AuthenticationException
-
externalStorageUploadStatus
public void externalStorageUploadStatus(boolean uploadStatus, com.saperion.externalstorage.library.Document uploadedDocument, com.saperion.externalstorage.client.ExternalStorageClient externalStorageClient, com.saperion.externalstorage.ExternalStorageType externalStorageType)
-
prolongRetention
public void prolongRetention(ResultProperties row, java.util.Date prolongDate) throws NgcUiException, AuthenticationException
-
reduceDisposition
public void reduceDisposition(ResultProperties row, java.util.Date dispositionDate) throws NgcUiException, AuthenticationException
-
setlitigationhold
public void setlitigationhold(DocumentId documentId, boolean activate) throws NgcUiException, AuthenticationException
Sets the specified document's litigationhold to 'read'.- Parameters:
documentId
- item representing the documentactivate
- de-/activate litigation hold- Throws:
NgcUiException
- Exception to be handled by viewAuthenticationException
- re-logon required
-
-