Class WorkflowDocumentVariantImportTask
- 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.WorkflowDocumentVariantImportTask
-
- All Implemented Interfaces:
ContentMigrationTask
,DocumentVariantImportTask
public class WorkflowDocumentVariantImportTask extends AbstractContentImportTask implements DocumentVariantImportTask
DocumentVariantImportTask
implementation using Hippo Repository Workflow APIs.
-
-
Field Summary
-
Fields inherited from class org.onehippo.forge.content.exim.core.impl.AbstractContentImportTask
contentNodeBinder, contentNodeBindingItemFilter
-
-
Constructor Summary
Constructors Constructor Description WorkflowDocumentVariantImportTask(DocumentManager documentManager)
Constructs withdocumentManager
.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected String
createDocument(String primaryTypeName, String documentLocation, String locale, String localizedName)
Create a document at the document handle node path (documentLocation
) and returns the created document handle node path.protected String
createDocumentFromVariantContentNode(String primaryTypeName, String documentLocation, String locale, String localizedName)
Deprecated.renamed to #createDocumentString
createOrUpdateDocumentFromVariantContentNode(org.onehippo.forge.content.pojo.model.ContentNode contentNode, String primaryTypeName, String documentLocation, String locale, String localizedName)
Creates or updates the document as primary node type ofprimaryTypeName
at the document handle node path (documentHandlePath
) with a localized document name (localizedName
) for the specificlocale
.org.onehippo.forge.content.pojo.binder.ContentNodeBindingItemFilter<org.onehippo.forge.content.pojo.model.ContentItem>
getContentNodeBindingItemFilter()
ReturnsContentNodeBindingItemFilter
instance.protected String
updateDocument(String documentLocation, org.onehippo.forge.content.pojo.model.ContentNode contentNode)
Update the document located under the document handle node path (documentLocation
) and returns the document handle node path where the content was updated.protected javax.jcr.Node
updateDocument(javax.jcr.Node documentHandleNode, org.onehippo.forge.content.pojo.model.ContentNode contentNode)
Update the document handle node (documentHandleNode
) and returns the document handle node where the content was updated.protected javax.jcr.Node
updateDocument(org.hippoecm.repository.api.Document editableDocument, org.onehippo.forge.content.pojo.model.ContentNode contentNode)
Update the editable document represented by the (editabledocument
) argument and returns the document handle node content was updated.protected String
updateDocumentFromVariantContentNode(String documentLocation, org.onehippo.forge.content.pojo.model.ContentNode contentNode)
Deprecated.renamed to #updateDocumentjavax.jcr.Node
updateDocumentFromVariantContentNode(org.onehippo.forge.content.pojo.model.ContentNode contentNode, javax.jcr.Node documentNode)
Updates the document given bydocumentHandle
from the POJOcontentNode
.-
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 Detail
-
WorkflowDocumentVariantImportTask
public WorkflowDocumentVariantImportTask(DocumentManager documentManager)
Constructs withdocumentManager
.- Parameters:
documentManager
-DocumentManager
instance
-
-
Method Detail
-
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
-
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 ofprimaryTypeName
at the document handle node path (documentHandlePath
) with a localized document name (localizedName
) for the specificlocale
.- Specified by:
createOrUpdateDocumentFromVariantContentNode
in interfaceDocumentVariantImportTask
- Parameters:
contentNode
-ContentNode
instance as a source data to create or update a documentprimaryTypeName
- primary node type name of the document to createdocumentLocation
- document handle node path where the document should be created or updatedlocale
- locale name for thelocalizedName
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 javax.jcr.Node updateDocumentFromVariantContentNode(org.onehippo.forge.content.pojo.model.ContentNode contentNode, javax.jcr.Node documentNode) throws ContentMigrationException
Description copied from interface:DocumentVariantImportTask
Updates the document given bydocumentHandle
from the POJOcontentNode
.- Specified by:
updateDocumentFromVariantContentNode
in interfaceDocumentVariantImportTask
- Parameters:
contentNode
-ContentNode
instance as a source data to create or update a documentdocumentNode
- 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, javax.jcr.RepositoryException
Deprecated.renamed to #createDocument- Throws:
DocumentManagerException
javax.jcr.RepositoryException
-
createDocument
protected String createDocument(String primaryTypeName, String documentLocation, String locale, String localizedName) throws DocumentManagerException, javax.jcr.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 createdocumentLocation
- document handle node path where the document should be createdlocale
- locale name forlocalizedName
which is used as a localized name of the created documentlocalizedName
- localized name of the document to create- Returns:
- the created document handle node path
- Throws:
DocumentManagerException
- if document creation failsjavax.jcr.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, javax.jcr.RepositoryException
Deprecated.renamed to #updateDocument- Throws:
DocumentManagerException
javax.jcr.RepositoryException
-
updateDocument
protected String updateDocument(String documentLocation, org.onehippo.forge.content.pojo.model.ContentNode contentNode) throws DocumentManagerException, javax.jcr.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 pathcontentNode
- sourceContentNode
instance containing the document variant content data- Returns:
- the document handle node path where the content was updated
- Throws:
DocumentManagerException
- if document update failsjavax.jcr.RepositoryException
- if document update fails due to unexpected repository error
-
updateDocument
protected javax.jcr.Node updateDocument(javax.jcr.Node documentHandleNode, org.onehippo.forge.content.pojo.model.ContentNode contentNode) throws DocumentManagerException, javax.jcr.RepositoryException
Update the document handle node (documentHandleNode
) and returns the document handle node where the content was updated.- Parameters:
documentHandleNode
- document handle nodecontentNode
- sourceContentNode
instance containing the document variant content data- Returns:
- the document handle node where the content was updated
- Throws:
DocumentManagerException
- if document update failsjavax.jcr.RepositoryException
- if document update fails due to unexpected repository error
-
updateDocument
protected javax.jcr.Node updateDocument(org.hippoecm.repository.api.Document editableDocument, org.onehippo.forge.content.pojo.model.ContentNode contentNode) throws javax.jcr.RepositoryException
Update the editable document represented by the (editabledocument
) argument and returns the document handle node content was updated.- Parameters:
editableDocument
- document objectcontentNode
- sourceContentNode
instance containing the document variant content data- Returns:
- the document handle node where the content was updated
- Throws:
DocumentManagerException
- if document update failsjavax.jcr.RepositoryException
- if document update fails due to unexpected repository error
-
-