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

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
All Implemented Interfaces:
com.vaadin.data.Item, ItemAdapter, JcrItemAdapter, Serializable
Direct Known Subclasses:
JcrNewNodeAdapter

public class JcrNodeAdapter
extends AbstractJcrNodeAdapter

Base implementation of an Item wrapping/representing a Node. Implements Property.ValueChangeListener in order to inform/change JCR property when a Vaadin property has changed.

  

Jcr properties are read from Repository as long as they are not modified.

Jcr properties are updated or created if they:

Create a JcrNodeAdapter:

Properties:

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
JcrNodeAdapter(javax.jcr.Node jcrNode)
           
 
Method Summary
 boolean addItemProperty(Object propertyId, com.vaadin.data.Property property)
          Add a new JCR Property.
 com.vaadin.data.Property getItemProperty(Object propertyId)
          Get Vaadin Property from a Jcr Property.
 Collection<?> getItemPropertyIds()
           
 boolean isNew()
           
 boolean removeItemProperty(Object id)
          Remove a property from an Item.
 
Methods inherited from class info.magnolia.ui.vaadin.integration.jcr.AbstractJcrNodeAdapter
addChild, applyChanges, 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

JcrNodeAdapter

public JcrNodeAdapter(javax.jcr.Node jcrNode)
Method Detail

getItemProperty

public com.vaadin.data.Property getItemProperty(Object propertyId)
Get Vaadin Property from a Jcr Property. If the Property was already modified, get this Property from the local changedProperties map - else delegate to super implementation.

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

getItemPropertyIds

public Collection<?> getItemPropertyIds()

addItemProperty

public boolean addItemProperty(Object propertyId,
                               com.vaadin.data.Property property)
                        throws UnsupportedOperationException
Description copied from class: AbstractJcrNodeAdapter
Add a new JCR Property.

Specified by:
addItemProperty in interface com.vaadin.data.Item
Overrides:
addItemProperty in class AbstractJcrNodeAdapter
Throws:
UnsupportedOperationException

removeItemProperty

public boolean removeItemProperty(Object id)
Remove a property from an Item. If the property was already modified, remove it for the changedProperties Map and add it to the removedProperties Map. Else fill the removedProperties Map with the retrieved property.


isNew

public boolean isNew()
Returns:
true if it's a new Item (not already persisted).


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