Class DefaultBinaryImportTask
java.lang.Object
org.onehippo.forge.content.exim.core.impl.AbstractContentMigrationTask
org.onehippo.forge.content.exim.core.impl.AbstractContentImportTask
org.onehippo.forge.content.exim.core.impl.DefaultBinaryImportTask
- All Implemented Interfaces:
BinaryImportTask
,ContentMigrationTask
Default
BinaryImportTask
implementation.-
Field Summary
Fields inherited from class org.onehippo.forge.content.exim.core.impl.AbstractContentImportTask
contentNodeBinder, contentNodeBindingItemFilter
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultBinaryImportTask
(DocumentManager documentManager) Constructs withdocumentManager
. -
Method Summary
Modifier and TypeMethodDescriptionprotected Node
createBinaryHandleAndVariantNode
(String primaryTypeName, Node folderNode, String name) Creates a binary handle and variant node and returns the binary handle node.createOrUpdateBinaryFolder
(String folderLocation, String primaryTypeName, String[] folderTypes, String[] galleryTypes) createOrUpdateBinaryFromContentNode
(org.onehippo.forge.content.pojo.model.ContentNode contentNode, String primaryTypeName, String folderPath, String name) Creates an imageset (e.g,hippogallery:imageset
) content or an assetset (e.g,hippogallery:exampleAssetSet
) content from aContentNode
object.org.onehippo.forge.content.pojo.binder.ContentNodeBindingItemFilter<org.onehippo.forge.content.pojo.model.ContentItem>
ReturnsContentNodeBindingItemFilter
instance.protected void
updateBinaryHandleAndVariantNodeFromBinaryVariantContentNode
(Node binaryHandleNode, org.onehippo.forge.content.pojo.model.ContentNode contentNode) Update binary handle and variant node from theContentNode
data containing the binary variant content data.Methods inherited from class org.onehippo.forge.content.exim.core.impl.AbstractContentImportTask
getContentNodeBinder, setContentNodeBinder, setContentNodeBindingItemFilter
Methods inherited from class org.onehippo.forge.content.exim.core.impl.AbstractContentMigrationTask
beginRecord, endRecord, findFilesByNamePattern, getBinaryValueFileFolder, getContentMigrationRecords, getContentValueConverter, getCurrentContentMigrationRecord, getDataUrlSizeThreashold, getDocumentManager, getLogger, getObjectMapper, getStartedTimeMillis, getStoppedTimeMillis, getSummary, logSummary, readContentNodeFromJsonFile, readContentNodeFromXmlFile, setBinaryValueFileFolder, setContentValueConverter, setDataUrlSizeThreashold, setLogger, setObjectMapper, start, stop, writeContentNodeToJsonFile, writeContentNodeToXmlFile
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.onehippo.forge.content.exim.core.ContentMigrationTask
beginRecord, endRecord, getContentMigrationRecords, getLogger, getStartedTimeMillis, getStoppedTimeMillis, getSummary, logSummary, readContentNodeFromJsonFile, readContentNodeFromXmlFile, setLogger, start, stop, writeContentNodeToJsonFile, writeContentNodeToXmlFile
-
Constructor Details
-
DefaultBinaryImportTask
Constructs withdocumentManager
.- Parameters:
documentManager
-DocumentManager
instance
-
-
Method Details
-
getContentNodeBindingItemFilter
public org.onehippo.forge.content.pojo.binder.ContentNodeBindingItemFilter<org.onehippo.forge.content.pojo.model.ContentItem> getContentNodeBindingItemFilter()ReturnsContentNodeBindingItemFilter
instance. If not set, returns a default implementation.- Overrides:
getContentNodeBindingItemFilter
in classAbstractContentImportTask
- 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 interfaceBinaryImportTask
- 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 aContentNode
object.- Specified by:
createOrUpdateBinaryFromContentNode
in interfaceBinaryImportTask
- Parameters:
contentNode
- aContentNode
object containing an imageset (e.g,hippogallery:imageset
) content or an assetset (e.g,hippogallery:exampleAssetSet
) contentprimaryTypeName
- 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 updatedname
- 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 nodefolderNode
- folder nodename
- binary node name- Returns:
- created binary handle node
- Throws:
DocumentManagerException
- if it fails to create the binary handle and variant nodeRepositoryException
- 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 theContentNode
data containing the binary variant content data.- Parameters:
binaryHandleNode
- binary handle nodecontentNode
-ContentNode
data containing the binary variant content data- Throws:
DocumentManagerException
- if it fails to update the binary handle and variant nodeRepositoryException
- if it fails to update the binary handle and variant node
-