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, SetPropertyTask

public abstract class PropertyValuesTask
extends AbstractTask

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


Field Summary
 
Fields inherited from class info.magnolia.module.delta.AbstractTask
DO_NOTHING, 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)
          Deprecated. since 5.2.2, use instead.
protected  void checkAndModifyPropertyValue(InstallContext ctx, javax.jcr.Node node, String propertyName, Collection<String> expectedCurrentValues, String newValue)
          Checks that the given String property has one of the expected values.
protected  void checkAndModifyPropertyValue(InstallContext ctx, javax.jcr.Node 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)
          Deprecated. since 5.2.2, use checkOrCreateProperty(InstallContext, Node, String, String) instead.
protected  void checkOrCreateProperty(InstallContext ctx, javax.jcr.Node 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)
          Deprecated. 
protected  void newProperty(InstallContext ctx, javax.jcr.Node node, String propertyName, Object value)
          Checks that the given property does not exist and creates it with the given value, logs otherwise.
 
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
Deprecated. since 5.2.2, use instead.

Checks that the given String property has the expected value. Changes it if so, logs otherwise.

Throws:
javax.jcr.RepositoryException

checkAndModifyPropertyValue

protected void checkAndModifyPropertyValue(InstallContext ctx,
                                           javax.jcr.Node 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

checkAndModifyPropertyValue

protected void checkAndModifyPropertyValue(InstallContext ctx,
                                           javax.jcr.Node node,
                                           String propertyName,
                                           Collection<String> expectedCurrentValues,
                                           String newValue)
                                    throws javax.jcr.RepositoryException
Checks that the given String property has one of the expected values. 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,
                                     javax.jcr.Node node,
                                     String propertyName,
                                     String expectedValue)
                              throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

checkOrCreateProperty

protected void checkOrCreateProperty(InstallContext ctx,
                                     Content node,
                                     String propertyName,
                                     String expectedValue)
                              throws javax.jcr.RepositoryException
Deprecated. since 5.2.2, use checkOrCreateProperty(InstallContext, Node, String, String) instead.

Throws:
javax.jcr.RepositoryException

newProperty

@Deprecated
protected void newProperty(InstallContext ctx,
                                      Content node,
                                      String propertyName,
                                      String value)
                    throws javax.jcr.RepositoryException
Deprecated. 

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,
                           javax.jcr.Node node,
                           String propertyName,
                           Object 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

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-2014 Magnolia International Ltd.. All Rights Reserved.