info.magnolia.module.delta
Class PropertyValuesTask

java.lang.Object
  extended by info.magnolia.module.delta.AbstractTask
      extended by info.magnolia.module.delta.PropertyValuesTask
All Implemented Interfaces:
Task
Direct Known Subclasses:
CheckAndModifyPartOfPropertyValueTask, CheckAndModifyPropertyValueTask, CheckOrCreatePropertyTask, NewPropertyTask

public abstract class PropertyValuesTask
extends AbstractTask

A tasks that offers helper methods to check on certain properties.

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

Field Summary
 
Fields inherited from class info.magnolia.module.delta.AbstractTask
log
 
Constructor Summary
PropertyValuesTask(String name, String description)
           
 
Method Summary
protected  void checkAndModifyPartOfPropertyValue(InstallContext ctx, javax.jcr.Node node, String propertyName, String expectedValue, String newValue)
          Checks if property contains concrete string.
protected  void checkAndModifyPropertyValue(InstallContext ctx, Content node, String propertyName, String expectedCurrentValue, String newValue)
          Checks that the given String property has the expected value.
protected  void checkOrCreateProperty(InstallContext ctx, Content node, String propertyName, String expectedValue)
           
protected  String format(String pattern, Object arg0, Object arg1, Object arg2)
           
protected  String format(String pattern, Object arg0, Object arg1, Object arg2, Object arg3)
           
protected  String format(String pattern, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4)
           
protected  void newProperty(InstallContext ctx, Content node, String propertyName, String value)
          Checks that the given property does not exist and creates it with the given value, logs otherwise.
protected  void newProperty(InstallContext ctx, Content node, String propertyName, String value, boolean log)
           
 
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
 
Methods inherited from interface info.magnolia.module.delta.Task
execute
 

Constructor Detail

PropertyValuesTask

public PropertyValuesTask(String name,
                          String description)
Method Detail

checkAndModifyPropertyValue

protected void checkAndModifyPropertyValue(InstallContext ctx,
                                           Content node,
                                           String propertyName,
                                           String expectedCurrentValue,
                                           String newValue)
                                    throws javax.jcr.RepositoryException
Checks that the given String property has the expected value. Changes it if so, logs otherwise.

Throws:
javax.jcr.RepositoryException

checkAndModifyPartOfPropertyValue

protected void checkAndModifyPartOfPropertyValue(InstallContext ctx,
                                                 javax.jcr.Node node,
                                                 String propertyName,
                                                 String expectedValue,
                                                 String newValue)
                                          throws javax.jcr.RepositoryException
Checks if property contains concrete string. If contains then change this part of string, logs otherwise.

Throws:
javax.jcr.RepositoryException

checkOrCreateProperty

protected void checkOrCreateProperty(InstallContext ctx,
                                     Content node,
                                     String propertyName,
                                     String expectedValue)
                              throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

newProperty

protected void newProperty(InstallContext ctx,
                           Content node,
                           String propertyName,
                           String value)
                    throws javax.jcr.RepositoryException
Checks that the given property does not exist and creates it with the given value, logs otherwise.

Throws:
javax.jcr.RepositoryException

newProperty

protected void newProperty(InstallContext ctx,
                           Content node,
                           String propertyName,
                           String value,
                           boolean log)
                    throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

format

protected String format(String pattern,
                        Object arg0,
                        Object arg1,
                        Object arg2,
                        Object arg3,
                        Object arg4)

format

protected String format(String pattern,
                        Object arg0,
                        Object arg1,
                        Object arg2,
                        Object arg3)

format

protected String format(String pattern,
                        Object arg0,
                        Object arg1,
                        Object arg2)


Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.