info.magnolia.module.delta
Class MoveAndRenamePropertyTask

java.lang.Object
  extended by info.magnolia.module.delta.AbstractTask
      extended by info.magnolia.module.delta.AbstractRepositoryTask
          extended by info.magnolia.module.delta.MoveAndRenamePropertyTask
All Implemented Interfaces:
Task
Direct Known Subclasses:
LoginAuthTypePropertyMovedToFilter, LoginFormPropertyMovedToFilter

public class MoveAndRenamePropertyTask
extends AbstractRepositoryTask

A task to move and rename properties, taking default values into account. If the property existed with original default, it is replaced by the new default, otherwise its value is kept. If the new property exists, its value is replaced by either the new default of the original property's value. This permits bootstrapping complex nodes, and migrating a few simple properties when necessary. Override the modifyCurrentValue() method to provide special behaviour when replacing existing values.

Version:
$Revision: $ ($Author: $)
Author:
gjoseph

Field Summary
 
Fields inherited from class info.magnolia.module.delta.AbstractTask
log
 
Constructor Summary
MoveAndRenamePropertyTask(String name, String originalParentNode, String originalPropertyName, String newParentNode, String newPropertyName)
           
MoveAndRenamePropertyTask(String name, String originalParentNode, String originalPropertyName, String originalDefaultValue, String newParentNode, String newPropertyName, String newDefaultValue)
           
 
Method Summary
protected  void doExecute(InstallContext ctx)
           
protected  String modifyCurrentValue(String currentValue)
           
 
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

MoveAndRenamePropertyTask

public MoveAndRenamePropertyTask(String name,
                                 String originalParentNode,
                                 String originalPropertyName,
                                 String newParentNode,
                                 String newPropertyName)

MoveAndRenamePropertyTask

public MoveAndRenamePropertyTask(String name,
                                 String originalParentNode,
                                 String originalPropertyName,
                                 String originalDefaultValue,
                                 String newParentNode,
                                 String newPropertyName,
                                 String newDefaultValue)
Method Detail

doExecute

protected void doExecute(InstallContext ctx)
                  throws javax.jcr.RepositoryException,
                         TaskExecutionException
Specified by:
doExecute in class AbstractRepositoryTask
Throws:
javax.jcr.RepositoryException
TaskExecutionException

modifyCurrentValue

protected String modifyCurrentValue(String currentValue)


Copyright © 2003–2014 Magnolia International Ltd.. All rights reserved.