Package com.saperion.ngc.resultset
Class ResultSetPresenter
java.lang.Object
com.saperion.ngc.resultset.ResultSetPresenter
- All Implemented Interfaces:
Presenter
Presenter for ResultSetView.
-
Method Summary
Modifier and TypeMethodDescriptionanalyzeItems
(Collection<ResultListItem> items, boolean useAttachment) Analyze the items.Analyze the workflow items.void
Clears the result of the last query.boolean
Delete document.boolean
doDeleteDocument
(DocumentId id, boolean finalDelete) Delete document.void
doUndelet
(ResultProperties row, 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
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) fixVersion
(DocumentId documentId) Fill value for revision ID in document ID if not set.getAclNames
(DocumentId documentId) Returns the ACLs of a document.Returns a list of all ACL names.List<com.saperion.intf.wf.CommentInfo>
getComments
(com.saperion.intf.wf.TaskInfo taskInfo) Retrieves the comments for the specified task.Gets the config.com.saperion.intf.DDC
Returns the DDC with the specified name.Reads the properties for the given document.getDocProperties
(DocumentId id, boolean isDeleted) Reads the properties for the given document.getDocumentFolders
(DocumentId documentId) Retrieves the folders that contain the specified document.getDocumentInfoFromArchive
(DocumentId id, boolean currentRevision) getDocumentPages
(DocumentId id, boolean currentRevision) Returns the amount of pages for the specified document.getDocumentVersion
(String versionId) Returns the version information for the specified version ID.Returns the version IDs for the specified document.Retrieves the version information for a document.Returns a map of <fieldname, SaFieldDescription> SaFieldDescriptions of the given DDC.Gets the form ddc.getFullTextFields
(String ddcName, List<String> fullTextFields, String hdoc) Fetches values of Full text columnsGets the last launched.getSelectedRow
(int index) Retrieves the row at the specific index.com.saperion.intf.wf.WorkflowMember
getSelectedUserTreeRoot
(List<com.saperion.intf.wf.WorkflowMember> selectedMembers) Gets the user tree root element with selected users as children.com.saperion.intf.wf.WorkflowMember
getUserTreeRoot
(String filter) Gets the user tree root element and its direct children.boolean
isAllowedToViewHistory
(DocumentId docId) boolean
Checks if the document is contained in one or more folders from current user or other users.boolean
Checks if the document with the specified ID is locked for editing in this result set.boolean
Checks, if the selection is allowed and not locked nor checked out.localizeString
(String toLocalize) Localizes a string using the localize table.void
oneDriveLogin
(DocumentId documentId) Opens OneDrive login dialogvoid
prolongRetention
(ResultProperties row, Date prolongDate) void
reduceDisposition
(ResultProperties row, Date dispositionDate) void
removeFromFolder
(DocumentId documentId, Set<FolderId> folderIDs) Removes the documents from the specified folder.void
saveLastLaunched
(String lastName) Save last launched.void
sendErrorMessageToView
(LogMessage message) Sends an error message to the view.void
sendLogonMessageToView
(LogonEvent.LogonResult result, String userName) Sends a logon message to the view.void
Sets the specified document's state to 'read'.void
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, String selectedFolderID, com.saperion.externalstorage.client.ExternalStorageClient externalStorageClient, com.saperion.externalstorage.ExternalStorageType storageType) void
writeAuditEvent
(String hdoc, DocumentService.AuditEvent event, String remark)
-
Method Details
-
getConfig
Gets the config.- Returns:
- Configuration
-
isLockedForEditing
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(String hdoc, DocumentService.AuditEvent event, String remark) throws SystemException, AuthenticationException -
doDeleteDocument
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
Retrieves the row at the specific index.- Parameters:
index
- index of item- Returns:
- Row properties
-
getAllAcls
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 List<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
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(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
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
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
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
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 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 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(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(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 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 List<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(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 Map<String,com.saperion.intf.SaFieldDescription> getFieldDescriptions(String ddc) throws NgcUiException Returns a map of <fieldname, SaFieldDescription> SaFieldDescriptions 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
Sends a logon message to the view.- Parameters:
result
- logon resultuserName
- user name
-
getComments
public 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
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
Gets the form ddc.- Returns:
- Form DDC
-
sendErrorMessageToView
Sends an error message to the view.- Parameters:
message
- log message
-
removeFromFolder
public void removeFromFolder(DocumentId documentId, 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
- 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, 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
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
Exports the current query result.- Throws:
NgcUiException
- exception to be handled by view
-
export
public void export(Map<String, String> columnsToExport, ResultSetView.ExportFormat format, String filename) throws NgcUiExceptionExports 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
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
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
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
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
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 Set<Map.Entry<String,String>> getFullTextFields(String ddcName, List<String> fullTextFields, 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
-
oneDriveLogin
Opens OneDrive login dialog- Parameters:
documentId
- id of the document associated with onedrive event
-
uploadDocToExternalStorage
public com.saperion.externalstorage.library.Document uploadDocToExternalStorage(DocumentId documentId, 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, Date prolongDate) throws NgcUiException, AuthenticationException -
reduceDisposition
public void reduceDisposition(ResultProperties row, 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
-