Class DefaultBinaryImportTask

All Implemented Interfaces:
BinaryImportTask, ContentMigrationTask

public class DefaultBinaryImportTask extends AbstractContentImportTask implements BinaryImportTask
Default BinaryImportTask implementation.
  • Constructor Details

    • DefaultBinaryImportTask

      public DefaultBinaryImportTask(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
    • createOrUpdateBinaryFolder

      public String createOrUpdateBinaryFolder(String folderLocation, String primaryTypeName, String[] folderTypes, String[] galleryTypes) throws ContentMigrationException
      Specified by:
      createOrUpdateBinaryFolder in interface BinaryImportTask
      Throws:
      ContentMigrationException
    • createOrUpdateBinaryFromContentNode

      public String createOrUpdateBinaryFromContentNode(org.onehippo.forge.content.pojo.model.ContentNode contentNode, String primaryTypeName, String folderPath, String name) throws ContentMigrationException
      Creates an imageset (e.g, hippogallery:imageset) content or an assetset (e.g, hippogallery:exampleAssetSet) content from a ContentNode object.
      Specified by:
      createOrUpdateBinaryFromContentNode in interface BinaryImportTask
      Parameters:
      contentNode - a ContentNode object containing an imageset (e.g, hippogallery:imageset) content or an assetset (e.g, hippogallery:exampleAssetSet) content
      primaryTypeName - primary node type of binary content. e.g, hippogallery:imageset, hippogallery:exampleAssetSet, etc.
      folderPath - folder node path where this binary content should be created or updated
      name - binary content node name
      Returns:
      created or updated binary handle node path
      Throws:
      ContentMigrationException - if importing fails
    • createBinaryHandleAndVariantNode

      protected Node createBinaryHandleAndVariantNode(String primaryTypeName, Node folderNode, String name) throws DocumentManagerException, RepositoryException
      Creates a binary handle and variant node and returns the binary handle node.
      Parameters:
      primaryTypeName - primary node type name of the binary variant node
      folderNode - folder node
      name - binary node name
      Returns:
      created binary handle node
      Throws:
      DocumentManagerException - if it fails to create the binary handle and variant node
      RepositoryException - if it fails to create the binary handle and variant node
    • updateBinaryHandleAndVariantNodeFromBinaryVariantContentNode

      protected void updateBinaryHandleAndVariantNodeFromBinaryVariantContentNode(Node binaryHandleNode, org.onehippo.forge.content.pojo.model.ContentNode contentNode) throws DocumentManagerException, RepositoryException
      Update binary handle and variant node from the ContentNode data containing the binary variant content data.
      Parameters:
      binaryHandleNode - binary handle node
      contentNode - ContentNode data containing the binary variant content data
      Throws:
      DocumentManagerException - if it fails to update the binary handle and variant node
      RepositoryException - if it fails to update the binary handle and variant node