info.magnolia.ui.vaadin.integration.jcr
Class JcrNodeAdapter
java.lang.Object
info.magnolia.ui.vaadin.integration.jcr.AbstractJcrAdapter
info.magnolia.ui.vaadin.integration.jcr.AbstractJcrNodeAdapter
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:
- Previously existed and where modified.
- Newly created and set (an empty created property is not stored into Jcr repository)
Create a JcrNodeAdapter:
- Just create a new JcrNodeAdapter with the related Jcr Node as parameter.
Properties:
- See Also:
- Serialized Form
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 |
Methods inherited from class info.magnolia.ui.vaadin.integration.jcr.AbstractJcrNodeAdapter |
addChild, applyChanges, getChild, getChildren, getJcrItem, getNodeName, getParent, getPrimaryNodeTypeName, getRemovedChildren, hasChildItemChanges, initCommonAttributes, isNode, removeChild, setNodeName, setParent, setPrimaryNodeTypeName, updateProperties, updateProperty |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JcrNodeAdapter
public JcrNodeAdapter(javax.jcr.Node jcrNode)
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 © 2014 Magnolia International Ltd.. All Rights Reserved.