info.magnolia.module.delta
Class PropertyValueDelegateTask

java.lang.Object
  extended by info.magnolia.module.delta.AbstractTask
      extended by info.magnolia.module.delta.ConditionalDelegateTask
          extended by info.magnolia.module.delta.NodeCheckDelegateTask
              extended by info.magnolia.module.delta.PropertyValueDelegateTask
All Implemented Interfaces:
Task
Direct Known Subclasses:
IsAuthorInstanceDelegateTask

public class PropertyValueDelegateTask
extends NodeCheckDelegateTask

A task which delegates to another if a property has a given value.

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

Field Summary
 
Fields inherited from class info.magnolia.module.delta.NodeCheckDelegateTask
nodePath, propertyName, workspaceName
 
Fields inherited from class info.magnolia.module.delta.AbstractTask
log
 
Constructor Summary
PropertyValueDelegateTask(java.lang.String taskName, java.lang.String taskDescription, java.lang.String workspaceName, java.lang.String nodePath, java.lang.String propertyName, java.lang.String expectedValue, boolean propertyMustExist, Task ifTrue)
           
PropertyValueDelegateTask(java.lang.String taskName, java.lang.String taskDescription, java.lang.String workspaceName, java.lang.String nodePath, java.lang.String propertyName, java.lang.String expectedValue, boolean propertyMustExist, Task ifTrue, Task ifFalse)
           
 
Method Summary
protected  boolean checkNode(Content node, InstallContext ctx)
           
 
Methods inherited from class info.magnolia.module.delta.NodeCheckDelegateTask
condition
 
Methods inherited from class info.magnolia.module.delta.ConditionalDelegateTask
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

PropertyValueDelegateTask

public PropertyValueDelegateTask(java.lang.String taskName,
                                 java.lang.String taskDescription,
                                 java.lang.String workspaceName,
                                 java.lang.String nodePath,
                                 java.lang.String propertyName,
                                 java.lang.String expectedValue,
                                 boolean propertyMustExist,
                                 Task ifTrue)

PropertyValueDelegateTask

public PropertyValueDelegateTask(java.lang.String taskName,
                                 java.lang.String taskDescription,
                                 java.lang.String workspaceName,
                                 java.lang.String nodePath,
                                 java.lang.String propertyName,
                                 java.lang.String expectedValue,
                                 boolean propertyMustExist,
                                 Task ifTrue,
                                 Task ifFalse)
Parameters:
propertyMustExist - if false, the condition() method will evaluate to false even if the property does not exist. If true and the property does not exist, will throw a TaskExecutionException. TODO : warning or exception ? consistency between this and other tasks for these kind of cases !
Method Detail

checkNode

protected boolean checkNode(Content node,
                            InstallContext ctx)
                     throws TaskExecutionException,
                            javax.jcr.RepositoryException
Specified by:
checkNode in class NodeCheckDelegateTask
Throws:
TaskExecutionException
javax.jcr.RepositoryException


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