Class WorkflowDocumentManagerImpl

    • Constructor Summary

      Constructors 
      Constructor Description
      WorkflowDocumentManagerImpl​(javax.jcr.Session session)
      Constructs with session.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.hippoecm.repository.api.Document commitEditableDocument​(String documentLocation)
      Commits the draft variant which is currently being edited.
      protected org.hippoecm.repository.api.Document commitEditableDocument​(javax.jcr.Node documentHandleNode)
      Commits the draft variant which is currently being edited.
      org.hippoecm.repository.api.Document commitEditableDocument​(org.hippoecm.repository.api.Document editableDocument)
      Commits the draft variant which is currently being edited.
      String copyDocument​(String sourceDocumentLocation, String targetFolderLocation, String targetDocumentNodeName)
      Copies a document at the source document handle path (sourceDocumentLocation) to the target folder path (targetFolderLocation) with the given document node name (targetDocumentName).
      String createDocument​(String folderLocation, String primaryTypeName, String nodeName, String locale, String localizedName)
      Creates a document in the specific folderLocation.
      void deleteDocument​(String documentLocation)
      Deletes a document at at the given document handle path (documentLocation).
      boolean depublishDocument​(String documentLocation)
      Takes offline the document at the given document handle path (documentLocation).
      org.hippoecm.repository.api.Document disposeEditableDocument​(String documentLocation)
      Discards the draft variant which is currently being edited.
      protected org.hippoecm.repository.api.Document disposeEditableDocument​(javax.jcr.Node documentHandleNode)
      Discards the draft variant which is currently being edited.
      org.hippoecm.repository.api.Document disposeEditableDocument​(org.hippoecm.repository.api.Document editableDocument)
      Discards the draft variant which is currently being edited.
      boolean documentExists​(String documentLocation)
      Returns true if a document exists at documentLocation.
      boolean folderExists​(String folderLocation)
      Returns true if a folder exists at folderLocation.
      org.onehippo.forge.content.pojo.binder.ContentNodeBinder<javax.jcr.Node,​org.onehippo.forge.content.pojo.model.ContentItem,​javax.jcr.Value> getContentNodeBinder()
      Returns ContentNodeBinder instance.
      org.onehippo.forge.content.pojo.binder.ContentNodeBindingItemFilter<org.onehippo.forge.content.pojo.model.ContentItem> getContentNodeBindingItemFilter()
      Returns ContentNodeBindingItemFilter instance.
      protected org.hippoecm.repository.standardworkflow.DefaultWorkflow getDefaultWorkflow​(javax.jcr.Node documentHandleNode)
      Returns a DefaultWorkflow instance on documentHandleNode.
      String getDefaultWorkflowCategory()
      Returns the default workflow category.
      String getDocumentTranslationWorkflowCategory()
      Returns the document translation workflow category.
      protected org.hippoecm.repository.translation.TranslationWorkflow getDocumentVariantTranslationWorkflow​(javax.jcr.Node documentVariantNode)
      Returns a document TranslationWorkflow instance on documentVariantNode.
      org.onehippo.repository.documentworkflow.DocumentWorkflow getDocumentWorkflow​(javax.jcr.Node documentHandleNode)
      Returns a document workflow on documentHandleNode.
      String getDocumentWorkflowCategory()
      Returns the document workflow category.
      javax.jcr.Node getExistingDocumentHandleNode​(String documentLocation)
      Returns the physical document handle node for the logical document location.
      String getExistingDocumentPath​(String documentLocation)
      Returns the physical document handle node path for the logical document location.
      javax.jcr.Node getExistingFolderNode​(String folderLocation)
      Returns the physical folder node for the logical folder location.
      String getExistingFolderPath​(String folderLocation)
      Returns the physical folder node path for the logical folder location.
      protected org.hippoecm.repository.translation.TranslationWorkflow getFolderTranslationWorkflow​(javax.jcr.Node folderNode)
      Returns a folder TranslationWorkflow instance on folderNode.
      String getFolderTranslationWorkflowCategory()
      Returns the folder translation workflow category.
      protected org.hippoecm.repository.standardworkflow.FolderWorkflow getFolderWorkflow​(javax.jcr.Node folderNode)
      Returns a folder workflow instance on folderNode.
      String getFolderWorkflowCategory()
      Returns the folder workflow category.
      org.slf4j.Logger getLogger()
      Returns the logger used by DocumentManager.
      javax.jcr.Session getSession()
      Returns the JCR session.
      org.hippoecm.repository.api.Document obtainEditableDocument​(String documentLocation)
      Obtains an editable draft variant Document under the given document handle path (documentLocation).
      org.hippoecm.repository.api.Document obtainEditableDocument​(javax.jcr.Node documentHandleNode)
      Obtains an editable draft variant Document of the given document handle node (documentHandleNode).
      boolean publishDocument​(String documentLocation)
      Publishes the document at the given document handle path (documentLocation).
      void setContentNodeBinder​(org.onehippo.forge.content.pojo.binder.ContentNodeBinder<javax.jcr.Node,​org.onehippo.forge.content.pojo.model.ContentItem,​javax.jcr.Value> contentNodeBinder)
      Sets ContentNodeBinder instance.
      void setContentNodeBindingItemFilter​(org.onehippo.forge.content.pojo.binder.ContentNodeBindingItemFilter<org.onehippo.forge.content.pojo.model.ContentItem> contentNodeBindingItemFilter)
      Sets ContentNodeBindingItemFilter instance.
      void setDefaultWorkflowCategory​(String defaultWorkflowCategory)
      Sets the default workflow category.
      void setDocumentTranslationWorkflowCategory​(String documentTranslationWorkflowCategory)
      Sets the document translation workflow category.
      void setDocumentWorkflowCategory​(String documentWorkflowCategory)
      Sets the document workflow category
      void setFolderTranslationWorkflowCategory​(String folderTranslationWorkflowCategory)
      Sets the folder translation workflow category.
      void setFolderWorkflowCategory​(String folderWorkflowCategory)
      Sets the folder workflow category.
      void setLogger​(org.slf4j.Logger logger)
      Sets a logger to DocumentManager.
      org.hippoecm.repository.api.Document translateDocument​(String sourceDocumentLocation, String targetLanguage, String targetDocumentNodeName)
      Translates a document at the document handle path (sourceDocumentLocation) to name in language.
      org.hippoecm.repository.api.Document translateFolder​(String sourceFolderLocation, String targetLanguage, String targetFolderNodeName)
      Translates a folder at the folder path (sourceFolderLocation) to name in language.
      void updateEditableDocument​(org.hippoecm.repository.api.Document editableDocument, org.onehippo.forge.content.pojo.model.ContentNode sourceContentNode)
      Update editable Document instance (editableDocument) by the content of the given sourceContentNode.
    • Constructor Detail

      • WorkflowDocumentManagerImpl

        public WorkflowDocumentManagerImpl​(javax.jcr.Session session)
        Constructs with session.
        Parameters:
        session - JCR session to use
    • Method Detail

      • getLogger

        public org.slf4j.Logger getLogger()
        Returns the logger used by DocumentManager.
        Specified by:
        getLogger in interface DocumentManager
        Returns:
        the logger used by DocumentManager
      • setLogger

        public void setLogger​(org.slf4j.Logger logger)
        Sets a logger to DocumentManager.
        Specified by:
        setLogger in interface DocumentManager
        Parameters:
        logger - the logger to be used by DocumentManager
      • getContentNodeBinder

        public org.onehippo.forge.content.pojo.binder.ContentNodeBinder<javax.jcr.Node,​org.onehippo.forge.content.pojo.model.ContentItem,​javax.jcr.Value> getContentNodeBinder()
        Returns ContentNodeBinder instance. If not set, returns a default implementation.
        Returns:
        ContentNodeBinder instance. If not set, returns a default implementation
      • setContentNodeBinder

        public void setContentNodeBinder​(org.onehippo.forge.content.pojo.binder.ContentNodeBinder<javax.jcr.Node,​org.onehippo.forge.content.pojo.model.ContentItem,​javax.jcr.Value> contentNodeBinder)
        Sets ContentNodeBinder instance.
        Parameters:
        contentNodeBinder - ContentNodeBinder instance
      • getContentNodeBindingItemFilter

        public org.onehippo.forge.content.pojo.binder.ContentNodeBindingItemFilter<org.onehippo.forge.content.pojo.model.ContentItem> getContentNodeBindingItemFilter()
        Returns ContentNodeBindingItemFilter instance. If not set, returns a default implementation.
        Returns:
        ContentNodeBindingItemFilter instance. If not set, returns a default implementation
      • setContentNodeBindingItemFilter

        public void setContentNodeBindingItemFilter​(org.onehippo.forge.content.pojo.binder.ContentNodeBindingItemFilter<org.onehippo.forge.content.pojo.model.ContentItem> contentNodeBindingItemFilter)
        Sets ContentNodeBindingItemFilter instance.
        Parameters:
        contentNodeBindingItemFilter - ContentNodeBindingItemFilter instance
      • getDocumentWorkflowCategory

        public String getDocumentWorkflowCategory()
        Returns the document workflow category.
        Returns:
        the document workflow category
      • setDocumentWorkflowCategory

        public void setDocumentWorkflowCategory​(String documentWorkflowCategory)
        Sets the document workflow category
        Parameters:
        documentWorkflowCategory - the document workflow category
      • getDefaultWorkflowCategory

        public String getDefaultWorkflowCategory()
        Returns the default workflow category.
        Returns:
        the default workflow category
      • setDefaultWorkflowCategory

        public void setDefaultWorkflowCategory​(String defaultWorkflowCategory)
        Sets the default workflow category.
        Parameters:
        defaultWorkflowCategory - the default workflow category
      • getFolderWorkflowCategory

        public String getFolderWorkflowCategory()
        Returns the folder workflow category.
        Returns:
        the folder workflow category
      • setFolderWorkflowCategory

        public void setFolderWorkflowCategory​(String folderWorkflowCategory)
        Sets the folder workflow category.
        Parameters:
        folderWorkflowCategory - the folder workflow category
      • getFolderTranslationWorkflowCategory

        public String getFolderTranslationWorkflowCategory()
        Returns the folder translation workflow category.
        Returns:
        the folder translation workflow category
      • setFolderTranslationWorkflowCategory

        public void setFolderTranslationWorkflowCategory​(String folderTranslationWorkflowCategory)
        Sets the folder translation workflow category.
        Parameters:
        folderTranslationWorkflowCategory - the folder translation workflow category
      • getDocumentTranslationWorkflowCategory

        public String getDocumentTranslationWorkflowCategory()
        Returns the document translation workflow category.
        Returns:
        the document translation workflow category
      • setDocumentTranslationWorkflowCategory

        public void setDocumentTranslationWorkflowCategory​(String documentTranslationWorkflowCategory)
        Sets the document translation workflow category.
        Parameters:
        documentTranslationWorkflowCategory - the document translation workflow category
      • getSession

        public javax.jcr.Session getSession()
        Returns the JCR session.
        Specified by:
        getSession in interface DocumentManager
        Returns:
        the JCR session
      • createDocument

        public String createDocument​(String folderLocation,
                                     String primaryTypeName,
                                     String nodeName,
                                     String locale,
                                     String localizedName)
                              throws DocumentManagerException
        Creates a document in the specific folderLocation.
        Specified by:
        createDocument in interface DocumentManager
        Parameters:
        folderLocation - destination folder path
        primaryTypeName - primary node type name of document to be created
        nodeName - document node name
        locale - locale for the document display name. e.g, "en"
        localizedName - localized document name associated with the locale
        Returns:
        created document handle path
        Throws:
        DocumentManagerException - if fails to process
      • obtainEditableDocument

        public org.hippoecm.repository.api.Document obtainEditableDocument​(String documentLocation)
                                                                    throws DocumentManagerException
        Obtains an editable draft variant Document under the given document handle path (documentLocation).
        Specified by:
        obtainEditableDocument in interface DocumentManager
        Parameters:
        documentLocation - document handle path
        Returns:
        a Document instance if the operation was successful
        Throws:
        DocumentManagerException - if fails to process
      • obtainEditableDocument

        public org.hippoecm.repository.api.Document obtainEditableDocument​(javax.jcr.Node documentHandleNode)
                                                                    throws DocumentManagerException
        Obtains an editable draft variant Document of the given document handle node (documentHandleNode).
        Specified by:
        obtainEditableDocument in interface DocumentManager
        Parameters:
        documentHandleNode - document handle node
        Returns:
        a Document instance if the operation was successful
        Throws:
        DocumentManagerException - if fails to process
      • updateEditableDocument

        public void updateEditableDocument​(org.hippoecm.repository.api.Document editableDocument,
                                           org.onehippo.forge.content.pojo.model.ContentNode sourceContentNode)
                                    throws DocumentManagerException
        Update editable Document instance (editableDocument) by the content of the given sourceContentNode.
        Specified by:
        updateEditableDocument in interface DocumentManager
        Parameters:
        editableDocument - Document instance to edit
        sourceContentNode - source content node
        Throws:
        DocumentManagerException - if fails to process
      • disposeEditableDocument

        public org.hippoecm.repository.api.Document disposeEditableDocument​(String documentLocation)
                                                                     throws DocumentManagerException
        Discards the draft variant which is currently being edited.
        Specified by:
        disposeEditableDocument in interface DocumentManager
        Parameters:
        documentLocation - document handle path
        Returns:
        Document instance discarded if the operation was successful
        Throws:
        DocumentManagerException - if fails to process
      • disposeEditableDocument

        public org.hippoecm.repository.api.Document disposeEditableDocument​(org.hippoecm.repository.api.Document editableDocument)
                                                                     throws DocumentManagerException
        Discards the draft variant which is currently being edited.
        Specified by:
        disposeEditableDocument in interface DocumentManager
        Parameters:
        editableDocument - document object
        Returns:
        Document instance discarded if the operation was successful
        Throws:
        DocumentManagerException - if fails to process
      • disposeEditableDocument

        protected org.hippoecm.repository.api.Document disposeEditableDocument​(javax.jcr.Node documentHandleNode)
                                                                        throws DocumentManagerException
        Discards the draft variant which is currently being edited.
        Throws:
        DocumentManagerException
      • commitEditableDocument

        public org.hippoecm.repository.api.Document commitEditableDocument​(String documentLocation)
                                                                    throws DocumentManagerException
        Commits the draft variant which is currently being edited.
        Specified by:
        commitEditableDocument in interface DocumentManager
        Parameters:
        documentLocation - document handle path
        Returns:
        Document instance committed if the operation was successful
        Throws:
        DocumentManagerException - if fails to process
      • commitEditableDocument

        public org.hippoecm.repository.api.Document commitEditableDocument​(org.hippoecm.repository.api.Document editableDocument)
                                                                    throws DocumentManagerException
        Commits the draft variant which is currently being edited.
        Specified by:
        commitEditableDocument in interface DocumentManager
        Parameters:
        editableDocument - document object
        Returns:
        Document instance committed if the operation was successful
        Throws:
        DocumentManagerException - if fails to process
      • commitEditableDocument

        protected org.hippoecm.repository.api.Document commitEditableDocument​(javax.jcr.Node documentHandleNode)
                                                                       throws DocumentManagerException
        Commits the draft variant which is currently being edited.
        Throws:
        DocumentManagerException
      • copyDocument

        public String copyDocument​(String sourceDocumentLocation,
                                   String targetFolderLocation,
                                   String targetDocumentNodeName)
                            throws DocumentManagerException
        Copies a document at the source document handle path (sourceDocumentLocation) to the target folder path (targetFolderLocation) with the given document node name (targetDocumentName).
        Specified by:
        copyDocument in interface DocumentManager
        Parameters:
        sourceDocumentLocation - source document handle path
        targetFolderLocation - target folder path
        targetDocumentNodeName - target document handle node name
        Returns:
        the copied target document handle path
        Throws:
        DocumentManagerException - if fails to process
      • translateFolder

        public org.hippoecm.repository.api.Document translateFolder​(String sourceFolderLocation,
                                                                    String targetLanguage,
                                                                    String targetFolderNodeName)
                                                             throws DocumentManagerException
        Translates a folder at the folder path (sourceFolderLocation) to name in language.
        Specified by:
        translateFolder in interface DocumentManager
        Parameters:
        sourceFolderLocation - source folder path
        targetLanguage - target language to translate to
        targetFolderNodeName - target folder node name
        Returns:
        the translated target folder Document instance
        Throws:
        DocumentManagerException - if fails to process
      • translateDocument

        public org.hippoecm.repository.api.Document translateDocument​(String sourceDocumentLocation,
                                                                      String targetLanguage,
                                                                      String targetDocumentNodeName)
                                                               throws DocumentManagerException
        Translates a document at the document handle path (sourceDocumentLocation) to name in language.
        Specified by:
        translateDocument in interface DocumentManager
        Parameters:
        sourceDocumentLocation - source document handle path
        targetLanguage - target language to translate to
        targetDocumentNodeName - target document handle node name
        Returns:
        the translated target document Document instance
        Throws:
        DocumentManagerException - if fails to process
      • getDocumentWorkflow

        public org.onehippo.repository.documentworkflow.DocumentWorkflow getDocumentWorkflow​(javax.jcr.Node documentHandleNode)
                                                                                      throws javax.jcr.RepositoryException
        Returns a document workflow on documentHandleNode.
        Specified by:
        getDocumentWorkflow in interface DocumentManager
        Parameters:
        documentHandleNode - document handle node
        Returns:
        a document workflow on documentHandleNode
        Throws:
        javax.jcr.RepositoryException - if unexpected repository exception occurs
      • getFolderWorkflow

        protected org.hippoecm.repository.standardworkflow.FolderWorkflow getFolderWorkflow​(javax.jcr.Node folderNode)
                                                                                     throws javax.jcr.RepositoryException
        Returns a folder workflow instance on folderNode.
        Parameters:
        folderNode - folder node
        Returns:
        a folder workflow instance on folderNode
        Throws:
        javax.jcr.RepositoryException - if unexpected repository exception occurs
      • getDefaultWorkflow

        protected org.hippoecm.repository.standardworkflow.DefaultWorkflow getDefaultWorkflow​(javax.jcr.Node documentHandleNode)
                                                                                       throws javax.jcr.RepositoryException
        Returns a DefaultWorkflow instance on documentHandleNode.
        Parameters:
        documentHandleNode - document handle node
        Returns:
        DefaultWorkflow instance on documentHandleNode
        Throws:
        javax.jcr.RepositoryException - if unexpected repository exception occurs
      • getFolderTranslationWorkflow

        protected org.hippoecm.repository.translation.TranslationWorkflow getFolderTranslationWorkflow​(javax.jcr.Node folderNode)
                                                                                                throws javax.jcr.RepositoryException
        Returns a folder TranslationWorkflow instance on folderNode.
        Parameters:
        folderNode - folder node
        Returns:
        a folder TranslationWorkflow instance on folderNode
        Throws:
        javax.jcr.RepositoryException - if unexpected repository exception occurs
      • getDocumentVariantTranslationWorkflow

        protected org.hippoecm.repository.translation.TranslationWorkflow getDocumentVariantTranslationWorkflow​(javax.jcr.Node documentVariantNode)
                                                                                                         throws javax.jcr.RepositoryException
        Returns a document TranslationWorkflow instance on documentVariantNode.
        Parameters:
        documentVariantNode - document variant node
        Returns:
        a document TranslationWorkflow instance on documentVariantNode
        Throws:
        javax.jcr.RepositoryException - if unexpected repository exception occurs