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

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

public abstract class AbstractJcrAdapter
extends Object
implements JcrItemAdapter

Common base for JcrItemAdapter implementation.

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
protected static String UNIDENTIFIED
           
 
Constructor Summary
AbstractJcrAdapter(javax.jcr.Item jcrItem)
           
 
Method Summary
protected  Map<String,com.vaadin.data.Property> getChangedProperties()
           
 String getItemId()
           
 javax.jcr.Item getJcrItem()
          Returns the JCR Item represented by this adapter, or null in case of RepositoryException.
protected  Map<String,com.vaadin.data.Property> getRemovedProperties()
           
 String getWorkspace()
           
 boolean hasChangedProperties()
           
protected  void initCommonAttributes(javax.jcr.Item jcrItem)
          Init common Item attributes.
 void setItemId(String itemId)
           
protected  void updateProperties(javax.jcr.Item item)
          Updates and removes properties on given item, based on the changedProperties and removedProperties maps.
protected abstract  void updateProperty(javax.jcr.Item item, String propertyId, com.vaadin.data.Property property)
          Performs update of an Item based on given vaadin Property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface info.magnolia.ui.vaadin.integration.jcr.JcrItemAdapter
applyChanges, isNode
 
Methods inherited from interface info.magnolia.ui.vaadin.integration.ItemAdapter
isNew
 
Methods inherited from interface com.vaadin.data.Item
addItemProperty, getItemProperty, getItemPropertyIds, removeItemProperty
 

Field Detail

UNIDENTIFIED

protected static final String UNIDENTIFIED
See Also:
Constant Field Values
Constructor Detail

AbstractJcrAdapter

public AbstractJcrAdapter(javax.jcr.Item jcrItem)
Method Detail

initCommonAttributes

protected void initCommonAttributes(javax.jcr.Item jcrItem)
Init common Item attributes.


getWorkspace

public String getWorkspace()
Specified by:
getWorkspace in interface JcrItemAdapter

getItemId

public String getItemId()
Specified by:
getItemId in interface JcrItemAdapter

setItemId

public void setItemId(String itemId)

getJcrItem

public javax.jcr.Item getJcrItem()
Description copied from interface: JcrItemAdapter
Returns the JCR Item represented by this adapter, or null in case of RepositoryException.

Specified by:
getJcrItem in interface JcrItemAdapter

hasChangedProperties

public boolean hasChangedProperties()
Specified by:
hasChangedProperties in interface JcrItemAdapter

getChangedProperties

protected Map<String,com.vaadin.data.Property> getChangedProperties()

getRemovedProperties

protected Map<String,com.vaadin.data.Property> getRemovedProperties()

updateProperties

protected void updateProperties(javax.jcr.Item item)
                         throws javax.jcr.RepositoryException
Updates and removes properties on given item, based on the changedProperties and removedProperties maps. Read-only properties will not be updated and null valued properties will get removed.

Throws:
javax.jcr.RepositoryException

updateProperty

protected abstract void updateProperty(javax.jcr.Item item,
                                       String propertyId,
                                       com.vaadin.data.Property property)
Performs update of an Item based on given vaadin Property. Note that this should not persist changes into JCR. Implementation should simply make sure that updated propertyIds are mapped to the correct actions (jcrName property should be handled in a specific way).



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