public abstract class AbstractDataTypeMigrationTask
extends info.magnolia.module.delta.AbstractTask
Constructor and Description |
---|
AbstractDataTypeMigrationTask(String taskName,
String taskDescription,
String dataPath,
String newPath,
String newWorkspaceName) |
Modifier and Type | Method and Description |
---|---|
void |
execute(info.magnolia.module.InstallContext installContext) |
protected abstract void |
initOldToNewNodeTypeMappingElement(HashMap<String,String> oldToNewNodeTypeMapping)
Set the HashMap of nodeType to change.
key: oldType ('dataFolder') value: newType ('mgnl:folder') Order is important Define first the simple node type and the the types with restriction For example, if you have a node type for images that have a constraint for a custom data type (for binary). - First define your custom data type addOldToNewNodeTypeMappingElement("dataFolder", "mgnl:folder"); addOldToNewNodeTypeMappingElement("category", "mgnl:category"); addOldToNewNodeTypeMappingElement("dataItemNode", "mgnl:content"); |
public AbstractDataTypeMigrationTask(String taskName, String taskDescription, String dataPath, String newPath, String newWorkspaceName)
dataPath
- path from the data to migrate ('/category'). If set to root, the task will not be executed.newPath
- new path where the content of dataPath will be copied.newWorkspaceName
- new workspace name.public void execute(info.magnolia.module.InstallContext installContext) throws info.magnolia.module.delta.TaskExecutionException
info.magnolia.module.delta.TaskExecutionException
protected abstract void initOldToNewNodeTypeMappingElement(HashMap<String,String> oldToNewNodeTypeMapping)
Copyright © 2015 Magnolia International Ltd.. All rights reserved.