info.magnolia.dam.setup.migration
Class MoveFCKEditorContentToDamMigrationTask

java.lang.Object
  extended by info.magnolia.module.delta.AbstractTask
      extended by info.magnolia.module.delta.AbstractRepositoryTask
          extended by info.magnolia.dam.setup.migration.AbstractPropertyValueSearchDamMigrationTask
              extended by info.magnolia.dam.setup.migration.MoveContentToDamMigrationTask
                  extended by info.magnolia.dam.setup.migration.MoveFCKEditorContentToDamMigrationTask
All Implemented Interfaces:
info.magnolia.module.delta.Task
Direct Known Subclasses:
MoveLinkToDamForFCKEditorContentMigrationTask

public class MoveFCKEditorContentToDamMigrationTask
extends MoveContentToDamMigrationTask

This task copy uploaded documents stored in the content repository into the DAM repository. Initial upload of the document was done within the FCK text Editor
Steps:
- Iterate the list of contentPathsList,
-- Perform a JCR query that search for text properties defining link to 'upload' documents and return the related node.
-- For every Node:
--- Copy and transform the binary node into an Asset node in the DAM workspace.
--- Update the link defined in the related text.
--- Remove the related binary node from the content workspace.


Field Summary
 
Fields inherited from class info.magnolia.dam.setup.migration.MoveContentToDamMigrationTask
contentSession, damSession
 
Fields inherited from class info.magnolia.module.delta.AbstractTask
DO_NOTHING
 
Constructor Summary
MoveFCKEditorContentToDamMigrationTask(String taskName, String taskDescription, String contentRepository, List<String> contentPathsList, String targetSubPath, String searchPropertyValue)
           
 
Method Summary
protected  List<info.magnolia.link.Link> collectLinks(String textContent)
          Collect all Link define into a text.
protected  void handleTextProperty(javax.jcr.Node node, javax.jcr.Property property)
          Handle all Link define within a text property.
protected  void handleUploadReferenceForNode(javax.jcr.Node node)
          Get all properties from the related node defining a link to an uploaded document in their content.
 
Methods inherited from class info.magnolia.dam.setup.migration.MoveContentToDamMigrationTask
copyToDam, doExecute
 
Methods inherited from class info.magnolia.dam.setup.migration.AbstractPropertyValueSearchDamMigrationTask
buildI18nSuffixPropertyName, createQuery, executeQuery, getI18nLocalBasedOnPropertyName, getPropertyNameWithoutLocalSuffix, getPropertyValue, isPropertyNameI18nBased, setPropertyValue
 
Methods inherited from class info.magnolia.module.delta.AbstractRepositoryTask
execute
 
Methods inherited from class info.magnolia.module.delta.AbstractTask
getDescription, getName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MoveFCKEditorContentToDamMigrationTask

public MoveFCKEditorContentToDamMigrationTask(String taskName,
                                              String taskDescription,
                                              String contentRepository,
                                              List<String> contentPathsList,
                                              String targetSubPath,
                                              String searchPropertyValue)
Parameters:
contentPathsList - list on content path to handle like "/demo-project"
targetSubPath - Sub path of the DAM repository used to store the Data.
If a uploaded data is found under (website workspace)/demo-project/about/subsection-articles/article/content/00 the data will be stored under
(dam workspace)/(targetSubPath)/demo-project/about/subsection-articles/article/content/00
propertyToSearch - property value used to identify a text property linked to a uploaded binary.
Method Detail

handleUploadReferenceForNode

protected void handleUploadReferenceForNode(javax.jcr.Node node)
                                     throws javax.jcr.RepositoryException
Get all properties from the related node defining a link to an uploaded document in their content.

Overrides:
handleUploadReferenceForNode in class MoveContentToDamMigrationTask
Throws:
javax.jcr.RepositoryException

handleTextProperty

protected void handleTextProperty(javax.jcr.Node node,
                                  javax.jcr.Property property)
                           throws info.magnolia.link.LinkException,
                                  javax.jcr.RepositoryException
Handle all Link define within a text property.

Throws:
info.magnolia.link.LinkException
javax.jcr.RepositoryException

collectLinks

protected List<info.magnolia.link.Link> collectLinks(String textContent)
                                              throws info.magnolia.link.LinkException
Collect all Link define into a text.

Throws:
info.magnolia.link.LinkException


Copyright © 2014 Magnolia International Ltd.. All Rights Reserved.