info.magnolia.dam.setup.migration
Class CleanContentForDamMigrationTask

java.lang.Object
  extended by info.magnolia.module.delta.AbstractTask
      extended by info.magnolia.module.delta.AbstractRepositoryTask
          extended by info.magnolia.dam.setup.migration.AbstractCleanContentForDamMigrationTask
              extended by info.magnolia.dam.setup.migration.CleanContentForDamMigrationTask
All Implemented Interfaces:
info.magnolia.module.delta.Task

public class CleanContentForDamMigrationTask
extends AbstractCleanContentForDamMigrationTask

This task is responsible for cleaning the content repository.
Iterate the list of contentPathsList, get the related Node, and apply the visitor to the Node tree.
It use the NodeVisitor pattern. In order to define your own NodeVisior, extend this migration task and override the addCustomVisitors() protected method.

 Implemented visitor:
   CleanUpNodeVisitor
 Condition:
   Node must be of type mgnl:content or mgnl:page
    and
   must have one of the following property : image , video , flash , logoImg, printLogoImg --> index.
 Action
  If the value of the property is an Identifier
  and Identifier is not linked to a DAM node
  remove it.
    HandleDamLinkNodeVisitor
 Condition:
   Node must be of type mgnl:content or mgnl:page
    and
   must have the following property : link --> index.
 Action
  If the value of the property is an Identifier
  and Identifier is linked to a DAM node
  Create a composite key.
 


Field Summary
 
Fields inherited from class info.magnolia.dam.setup.migration.AbstractCleanContentForDamMigrationTask
contentSession, damSession
 
Fields inherited from class info.magnolia.module.delta.AbstractTask
DO_NOTHING
 
Constructor Summary
CleanContentForDamMigrationTask(String taskName, String taskDescription, String contentRepository, List<String> contentPathsList)
          Default constructor.
 
Method Summary
protected  List<info.magnolia.jcr.util.NodeVisitor> addCustomVisitors()
          Override in order to add your custom visitors.
protected  String[] createCleanUpVisitorPrefixTable()
          Create the node property prefix used in the Clean Up Node visitor.
 
Methods inherited from class info.magnolia.dam.setup.migration.AbstractCleanContentForDamMigrationTask
doExecute
 
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

CleanContentForDamMigrationTask

public CleanContentForDamMigrationTask(String taskName,
                                       String taskDescription,
                                       String contentRepository,
                                       List<String> contentPathsList)
Default constructor.

Method Detail

addCustomVisitors

protected List<info.magnolia.jcr.util.NodeVisitor> addCustomVisitors()
Override in order to add your custom visitors.


createCleanUpVisitorPrefixTable

protected String[] createCleanUpVisitorPrefixTable()
Create the node property prefix used in the Clean Up Node visitor. Used to filter Node properties and return only the properties part of the prefix list. Current prefix defined: image , video , flash , logoImg, printLogoImg, teaserImg.



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