Class ResultSetPresenter

  • All Implemented Interfaces:
    Presenter

    public class ResultSetPresenter
    extends java.lang.Object
    implements Presenter
    Presenter for ResultSetView.
    • Method Detail

      • 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
      • doDeleteDocument

        public boolean doDeleteDocument​(DocumentId id,
                                        boolean finalDelete)
                                 throws NgcUiException,
                                        AuthenticationException
        Delete document.
        Parameters:
        id - Document Id
        finalDelete - 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.
      • getSelectedRow

        public ResultProperties getSelectedRow​(int index)
        Retrieves the row at the specific index.
        Parameters:
        index - index of item
        Returns:
        Row properties
      • 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.
      • 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.
      • getFieldDescriptions

        public java.util.Map<java.lang.String,​com.saperion.intf.SaFieldDescription> getFieldDescriptions​(java.lang.String ddc)
                                                                                                        throws NgcUiException
        Returns a map of 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

        public void sendLogonMessageToView​(LogonEvent.LogonResult result,
                                           java.lang.String userName)
        Sends a logon message to the view.
        Parameters:
        result - logon result
        userName - 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
      • 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
      • 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 to
        filename - the name of the resulting file
        Throws:
        NgcUiException - exception to be handled by view
      • clearLastResult

        public void clearLastResult()
        Clears the result of the last query.
      • 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 DDC
        fullTextFields - List of fields which are of Text retrieval type. Make sure to prefix SaConstants.FULL_TEXT_COLUMN_PREFIX
        hdoc - xhdoc of the document
        Returns:
        Set of entries containing full text coulmn and corresponding value
        Throws:
        AuthenticationException
        SystemException
      • 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)