Class WorkflowDocumentVariantImportTask

All Implemented Interfaces:
ContentMigrationTask, DocumentVariantImportTask

public class WorkflowDocumentVariantImportTask extends AbstractContentImportTask implements DocumentVariantImportTask
DocumentVariantImportTask implementation using Hippo Repository Workflow APIs.
  • Constructor Details

    • WorkflowDocumentVariantImportTask

      public WorkflowDocumentVariantImportTask(DocumentManager documentManager)
      Constructs with documentManager.
      Parameters:
      documentManager - DocumentManager instance
  • Method Details

    • 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.
      Overrides:
      getContentNodeBindingItemFilter in class AbstractContentImportTask
      Returns:
      ContentNodeBindingItemFilter instance. If not set, returns a default implementation
    • createOrUpdateDocumentFromVariantContentNode

      public String createOrUpdateDocumentFromVariantContentNode(org.onehippo.forge.content.pojo.model.ContentNode contentNode, String primaryTypeName, String documentLocation, String locale, String localizedName) throws ContentMigrationException
      Creates or updates the document as primary node type of primaryTypeName at the document handle node path (documentHandlePath) with a localized document name (localizedName) for the specific locale.
      Specified by:
      createOrUpdateDocumentFromVariantContentNode in interface DocumentVariantImportTask
      Parameters:
      contentNode - ContentNode instance as a source data to create or update a document
      primaryTypeName - primary node type name of the document to create
      documentLocation - document handle node path where the document should be created or updated
      locale - locale name for the localizedName
      localizedName - localized document name
      Returns:
      the document handle path where the document was created or updated by this operation
      Throws:
      ContentMigrationException - if creation or updating fails
    • updateDocumentFromVariantContentNode

      public Node updateDocumentFromVariantContentNode(org.onehippo.forge.content.pojo.model.ContentNode contentNode, Node documentNode) throws ContentMigrationException
      Description copied from interface: DocumentVariantImportTask
      Updates the document given by documentHandle from the POJO contentNode.
      Specified by:
      updateDocumentFromVariantContentNode in interface DocumentVariantImportTask
      Parameters:
      contentNode - ContentNode instance as a source data to create or update a document
      documentNode - document handle JCR node that is to be updated, or a document JCR node that has a handle as parent.
      Returns:
      the document handle node of the document updated by this operation
      Throws:
      ContentMigrationException - if updating fails
    • createDocumentFromVariantContentNode

      @Deprecated protected String createDocumentFromVariantContentNode(String primaryTypeName, String documentLocation, String locale, String localizedName) throws DocumentManagerException, RepositoryException
      Deprecated.
      renamed to #createDocument
      Throws:
      DocumentManagerException
      RepositoryException
    • createDocument

      protected String createDocument(String primaryTypeName, String documentLocation, String locale, String localizedName) throws DocumentManagerException, RepositoryException
      Create a document at the document handle node path (documentLocation) and returns the created document handle node path.
      Parameters:
      primaryTypeName - primary node type name of the document to create
      documentLocation - document handle node path where the document should be created
      locale - locale name for localizedName which is used as a localized name of the created document
      localizedName - localized name of the document to create
      Returns:
      the created document handle node path
      Throws:
      DocumentManagerException - if document creation fails
      RepositoryException - if document creation fails due to unexpected repository error
    • updateDocumentFromVariantContentNode

      @Deprecated protected String updateDocumentFromVariantContentNode(String documentLocation, org.onehippo.forge.content.pojo.model.ContentNode contentNode) throws DocumentManagerException, RepositoryException
      Deprecated.
      renamed to #updateDocument
      Throws:
      DocumentManagerException
      RepositoryException
    • updateDocument

      protected String updateDocument(String documentLocation, org.onehippo.forge.content.pojo.model.ContentNode contentNode) throws DocumentManagerException, RepositoryException
      Update the document located under the document handle node path (documentLocation) and returns the document handle node path where the content was updated.
      Parameters:
      documentLocation - document handle node path
      contentNode - source ContentNode instance containing the document variant content data
      Returns:
      the document handle node path where the content was updated
      Throws:
      DocumentManagerException - if document update fails
      RepositoryException - if document update fails due to unexpected repository error
    • updateDocument

      protected Node updateDocument(Node documentHandleNode, org.onehippo.forge.content.pojo.model.ContentNode contentNode) throws DocumentManagerException, RepositoryException
      Update the document handle node (documentHandleNode) and returns the document handle node where the content was updated.
      Parameters:
      documentHandleNode - document handle node
      contentNode - source ContentNode instance containing the document variant content data
      Returns:
      the document handle node where the content was updated
      Throws:
      DocumentManagerException - if document update fails
      RepositoryException - if document update fails due to unexpected repository error
    • updateDocument

      protected Node updateDocument(org.hippoecm.repository.api.Document editableDocument, org.onehippo.forge.content.pojo.model.ContentNode contentNode) throws RepositoryException
      Update the editable document represented by the (editabledocument) argument and returns the document handle node content was updated.
      Parameters:
      editableDocument - document object
      contentNode - source ContentNode instance containing the document variant content data
      Returns:
      the document handle node where the content was updated
      Throws:
      DocumentManagerException - if document update fails
      RepositoryException - if document update fails due to unexpected repository error