info.magnolia.ui.vaadin.integration.jcr
Class JcrNewNodeAdapter

java.lang.Object
  extended by info.magnolia.ui.vaadin.integration.jcr.AbstractJcrAdapter
      extended by info.magnolia.ui.vaadin.integration.jcr.AbstractJcrNodeAdapter
          extended by info.magnolia.ui.vaadin.integration.jcr.JcrNodeAdapter
              extended by info.magnolia.ui.vaadin.integration.jcr.JcrNewNodeAdapter
All Implemented Interfaces:
com.vaadin.data.Item, ItemAdapter, JcrItemAdapter, Serializable

public class JcrNewNodeAdapter
extends JcrNodeAdapter

Used to create a new Node based on an Vaadin Item. This node adapter uses the parent node to initialize the global properties (workspace, path....). No references is made to an existing JCR node (except for the parent of the node to create). However, after applying changes to the item, the reference will be held to the newly created node.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.vaadin.data.Item
com.vaadin.data.Item.Editor, com.vaadin.data.Item.PropertySetChangeEvent, com.vaadin.data.Item.PropertySetChangeListener, com.vaadin.data.Item.PropertySetChangeNotifier, com.vaadin.data.Item.Viewer
 
Field Summary
 
Fields inherited from class info.magnolia.ui.vaadin.integration.jcr.AbstractJcrAdapter
UNIDENTIFIED
 
Constructor Summary
JcrNewNodeAdapter(javax.jcr.Node parentNode, String nodeType)
           
JcrNewNodeAdapter(javax.jcr.Node parentNode, String nodeType, String nodeName)
           
 
Method Summary
 javax.jcr.Node applyChanges()
          Create a new subNode of the parent Node or return the existing one if already created.
 com.vaadin.data.Property getItemProperty(Object propertyId)
          Returns item property of a new node.
 boolean isNew()
           
 
Methods inherited from class info.magnolia.ui.vaadin.integration.jcr.JcrNodeAdapter
addItemProperty, getItemPropertyIds, removeItemProperty
 
Methods inherited from class info.magnolia.ui.vaadin.integration.jcr.AbstractJcrNodeAdapter
addChild, getChild, getChildren, getJcrItem, getNodeName, getParent, getPrimaryNodeTypeName, getRemovedChildren, initCommonAttributes, isNode, removeChild, setNodeName, setParent, setPrimaryNodeTypeName, updateProperties, updateProperty
 
Methods inherited from class info.magnolia.ui.vaadin.integration.jcr.AbstractJcrAdapter
getChangedProperties, getItemId, getRemovedProperties, getWorkspace, hasChangedProperties, setItemId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JcrNewNodeAdapter

public JcrNewNodeAdapter(javax.jcr.Node parentNode,
                         String nodeType)
Parameters:
parentNode - Parent of the node to create.
nodeType - Type node to create.

JcrNewNodeAdapter

public JcrNewNodeAdapter(javax.jcr.Node parentNode,
                         String nodeType,
                         String nodeName)
Parameters:
parentNode - Parent of the node to create.
nodeType - Type node to create.
nodeName - Name of the new node.
Method Detail

getItemProperty

public com.vaadin.data.Property getItemProperty(Object propertyId)
Returns item property of a new node.

Specified by:
getItemProperty in interface com.vaadin.data.Item
Overrides:
getItemProperty in class JcrNodeAdapter
Parameters:
propertyId - id of the property to be retrieved
Returns:
the Property with the provided propertyId

applyChanges

public javax.jcr.Node applyChanges()
                            throws javax.jcr.RepositoryException
Create a new subNode of the parent Node or return the existing one if already created. If called a second time, apply changes of JcrNodeAdapter will be called.

Specified by:
applyChanges in interface JcrItemAdapter
Overrides:
applyChanges in class AbstractJcrNodeAdapter
Throws:
javax.jcr.RepositoryException

isNew

public boolean isNew()
Specified by:
isNew in interface ItemAdapter
Overrides:
isNew in class JcrNodeAdapter
Returns:
true if it's a new Item (not already persisted).


Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.