info.magnolia.dam.setup.migration
Class ChangeWebsiteDmsReferenceToDamMigrationTask
java.lang.Object
info.magnolia.module.delta.AbstractTask
info.magnolia.module.delta.AbstractRepositoryTask
info.magnolia.dam.setup.migration.AbstractPropertyValueSearchDamMigrationTask
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.
Fields inherited from class info.magnolia.module.delta.AbstractTask |
DO_NOTHING |
Method Summary |
void |
doExecute(info.magnolia.module.InstallContext ctx)
|
Methods inherited from class info.magnolia.module.delta.AbstractRepositoryTask |
execute |
Methods inherited from class info.magnolia.module.delta.AbstractTask |
getDescription, getName, toString |
ChangeWebsiteDmsReferenceToDamMigrationTask
public ChangeWebsiteDmsReferenceToDamMigrationTask(String taskName,
String taskDescription,
String contentRepository,
List<String> contentPathsList)
- Default constructor.
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.