info.magnolia.dam.setup.migration
Class ChangeWebsiteDmsReferenceToDamMigrationTask

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.ChangeWebsiteDmsReferenceToDamMigrationTask
All Implemented Interfaces:
info.magnolia.module.delta.Task

public class ChangeWebsiteDmsReferenceToDamMigrationTask
extends AbstractPropertyValueSearchDamMigrationTask

This task is responsible for changing the old DMS/Data/... references to DAM references.
Steps:

 Iterate the list of contentPathsList,
  Perform a JCR query that search for properties containing 'dms' and return the related node.
  Iterate the query result list
  For every Node,
   Node has also a related property index+DmsUUID (like imageDmsUUID)
    Copy the value of the index+DmsUUID (imageDmsUUID) property into index (image)
    Remove the index+DmsUUID (imageDmsUUID) property.
    Check existence of the UUID: UUID not found in DAM
     Remove the index property
   No related property index+DmsUUID (like imageDmsUUID) found
   Remove the index property.
 
 Normal handling:
 Move from:
  property sv:name="image" sv:type="String"
  value = dms
  property sv:name="imageDmsUUID" sv:type="String"
  value = 4c291aa5-9807-4bbe-b372-ce523f82e600
 To:
  property sv:name="image" sv:type="String"
  value = jcr:4c291aa5-9807-4bbe-b372-ce523f82e600
 
 Specific handling:
  In case of the UUID does not exist any more, remove properties.
  In case of the property imageDMSUUID does not exist, remove properties.
 


Field Summary
 
Fields inherited from class info.magnolia.module.delta.AbstractTask
DO_NOTHING
 
Constructor Summary
ChangeWebsiteDmsReferenceToDamMigrationTask(String taskName, String taskDescription, String contentRepository, List<String> contentPathsList)
          Default constructor.
 
Method Summary
 void doExecute(info.magnolia.module.InstallContext ctx)
           
 
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

ChangeWebsiteDmsReferenceToDamMigrationTask

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

Method Detail

doExecute

public void doExecute(info.magnolia.module.InstallContext ctx)
               throws info.magnolia.module.delta.TaskExecutionException
Specified by:
doExecute in class info.magnolia.module.delta.AbstractRepositoryTask
Throws:
info.magnolia.module.delta.TaskExecutionException


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