info.magnolia.nodebuilder
Class Ops

java.lang.Object
  extended by info.magnolia.nodebuilder.Ops

public abstract class Ops
extends java.lang.Object

Factory methods for most common NodeOperation implementations.

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

Constructor Summary
Ops()
           
 
Method Summary
static NodeOperation addNode(java.lang.String name)
           
static NodeOperation addNode(java.lang.String name, ItemType type)
           
static NodeOperation addNode(java.lang.String name, java.lang.String type)
           
static NodeOperation addProperty(java.lang.String name, java.lang.Object value)
          Adds a currently non-existing property.
static NodeOperation copyNode(java.lang.String name, java.lang.String dest)
          Copies the node defined by the name parameter in the session.
static NodeOperation getNode(java.lang.String name)
           
static NodeOperation moveNode(java.lang.String name, java.lang.String dest)
          Moves the node defined by the name parameter in the session.
static NodeOperation onChildNodes(Content.ContentFilter filter, NodeOperation... childrenOps)
          Executes the operation for each child node matching the filter.
static NodeOperation onChildNodes(ItemType type, NodeOperation... childrenOps)
          Executes the operation for each child node of a certain type.
static NodeOperation onChildNodes(NodeOperation... childrenOps)
          Executes the operation for each child node excluding meta data and jcr base node.
static NodeOperation onChildNodes(java.lang.String type, NodeOperation... childrenOps)
          Executes the operation for each child node of a certain type.
static NodeOperation remove(java.lang.String name)
          Can remove either a node or property.
static NodeOperation renameNode(java.lang.String name, java.lang.String newName)
          Renames the node defined by the name parameter.
static NodeOperation renameProperty(java.lang.String name, java.lang.String newName)
          Renames a property by creating a new one and copying the value.
static NodeOperation setProperty(java.lang.String name, java.lang.Object newValue)
          Sets the value of an existing property, ignoring its current value.
static NodeOperation setProperty(java.lang.String name, java.lang.Object expectedCurrentValue, java.lang.Object newValue)
          Sets the value of an existing property, only if the actual current value matches the given expected current value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ops

public Ops()
Method Detail

addNode

public static NodeOperation addNode(java.lang.String name)

addNode

public static NodeOperation addNode(java.lang.String name,
                                    java.lang.String type)

addNode

public static NodeOperation addNode(java.lang.String name,
                                    ItemType type)

getNode

public static NodeOperation getNode(java.lang.String name)

remove

public static NodeOperation remove(java.lang.String name)
Can remove either a node or property.


addProperty

public static NodeOperation addProperty(java.lang.String name,
                                        java.lang.Object value)
Adds a currently non-existing property. Throws an ItemExistsException if the property already exists.


setProperty

public static NodeOperation setProperty(java.lang.String name,
                                        java.lang.Object newValue)
Sets the value of an existing property, ignoring its current value.

Throws:
javax.jcr.ItemNotFoundException - if the property does not exist.

setProperty

public static NodeOperation setProperty(java.lang.String name,
                                        java.lang.Object expectedCurrentValue,
                                        java.lang.Object newValue)
Sets the value of an existing property, only if the actual current value matches the given expected current value.

Throws:
javax.jcr.ItemNotFoundException - if the property does not exist.
javax.jcr.RepositoryException - if the current value does not match the expected one.

renameNode

public static NodeOperation renameNode(java.lang.String name,
                                       java.lang.String newName)
Renames the node defined by the name parameter.


renameProperty

public static NodeOperation renameProperty(java.lang.String name,
                                           java.lang.String newName)
Renames a property by creating a new one and copying the value.


moveNode

public static NodeOperation moveNode(java.lang.String name,
                                     java.lang.String dest)
Moves the node defined by the name parameter in the session.


copyNode

public static NodeOperation copyNode(java.lang.String name,
                                     java.lang.String dest)
Copies the node defined by the name parameter in the session.


onChildNodes

public static NodeOperation onChildNodes(NodeOperation... childrenOps)
Executes the operation for each child node excluding meta data and jcr base node.


onChildNodes

public static NodeOperation onChildNodes(java.lang.String type,
                                         NodeOperation... childrenOps)
Executes the operation for each child node of a certain type.


onChildNodes

public static NodeOperation onChildNodes(ItemType type,
                                         NodeOperation... childrenOps)
Executes the operation for each child node of a certain type.


onChildNodes

public static NodeOperation onChildNodes(Content.ContentFilter filter,
                                         NodeOperation... childrenOps)
Executes the operation for each child node matching the filter.



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