|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.ui.vaadin.integration.jcr.AbstractJcrAdapter info.magnolia.ui.vaadin.integration.jcr.AbstractJcrNodeAdapter
public abstract class AbstractJcrNodeAdapter
Abstract implementation of an Item
wrapping/representing a Node
. Implements {Property.ValueChangeListener} in order to inform/change JCR
property when a Vaadin property has changed. Access JCR repository for all read Jcr Property.
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 | |
---|---|
AbstractJcrNodeAdapter(javax.jcr.Node jcrNode)
|
Method Summary | |
---|---|
AbstractJcrNodeAdapter |
addChild(AbstractJcrNodeAdapter child)
Add a child adapter to the current Item. |
boolean |
addItemProperty(Object id,
com.vaadin.data.Property property)
Add a new JCR Property. |
javax.jcr.Node |
applyChanges()
Returns the JCR Node represented by this Item with changes applied. |
AbstractJcrNodeAdapter |
getChild(String nodeName)
|
Map<String,AbstractJcrNodeAdapter> |
getChildren()
|
com.vaadin.data.Property |
getItemProperty(Object id)
|
javax.jcr.Node |
getJcrItem()
Return the corresponding node directly from the JCR repository. |
String |
getNodeName()
Return the current Node Name. |
AbstractJcrNodeAdapter |
getParent()
Return the current Parent Item (If Item is a child). |
String |
getPrimaryNodeTypeName()
Return the Primary node type Name. |
protected Map<String,AbstractJcrNodeAdapter> |
getRemovedChildren()
|
protected void |
initCommonAttributes(javax.jcr.Item jcrItem)
Init common Item attributes. |
boolean |
isNode()
|
boolean |
removeChild(AbstractJcrNodeAdapter toRemove)
Remove a child Node from the child list. |
void |
setNodeName(String nodeName)
|
void |
setParent(AbstractJcrNodeAdapter parent)
|
protected void |
setPrimaryNodeTypeName(String primaryNodeTypeName)
|
void |
updateProperties(javax.jcr.Item item)
Updates and removes properties on given item, based on the AbstractJcrAdapter.changedProperties and AbstractJcrAdapter.removedProperties maps. |
protected void |
updateProperty(javax.jcr.Item item,
String propertyId,
com.vaadin.data.Property property)
Update or remove property. |
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 |
Methods inherited from interface info.magnolia.ui.vaadin.integration.ItemAdapter |
---|
isNew |
Methods inherited from interface com.vaadin.data.Item |
---|
getItemPropertyIds, removeItemProperty |
Constructor Detail |
---|
public AbstractJcrNodeAdapter(javax.jcr.Node jcrNode)
Method Detail |
---|
public boolean isNode()
protected void initCommonAttributes(javax.jcr.Item jcrItem)
AbstractJcrAdapter
initCommonAttributes
in class AbstractJcrAdapter
protected void setPrimaryNodeTypeName(String primaryNodeTypeName)
public String getPrimaryNodeTypeName()
protected Map<String,AbstractJcrNodeAdapter> getRemovedChildren()
public javax.jcr.Node getJcrItem()
getJcrItem
in interface JcrItemAdapter
getJcrItem
in class AbstractJcrAdapter
public boolean addItemProperty(Object id, com.vaadin.data.Property property)
public com.vaadin.data.Property getItemProperty(Object id)
public javax.jcr.Node applyChanges() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public void updateProperties(javax.jcr.Item item) throws javax.jcr.RepositoryException
AbstractJcrAdapter
AbstractJcrAdapter.changedProperties
and AbstractJcrAdapter.removedProperties
maps. Read-only properties will not be updated and null valued properties will get removed.
updateProperties
in class AbstractJcrAdapter
javax.jcr.RepositoryException
protected void updateProperty(javax.jcr.Item item, String propertyId, com.vaadin.data.Property property)
updateProperties(javax.jcr.Item)
we have to make sure it is removed before running in here as Item.removeItemProperty(java.lang.Object)
is manipulating the AbstractJcrAdapter.changedProperties
list directly.
updateProperty
in class AbstractJcrAdapter
public AbstractJcrNodeAdapter getChild(String nodeName)
nodeName
- name of the child node
public Map<String,AbstractJcrNodeAdapter> getChildren()
public AbstractJcrNodeAdapter addChild(AbstractJcrNodeAdapter child)
public boolean removeChild(AbstractJcrNodeAdapter toRemove)
public AbstractJcrNodeAdapter getParent()
public void setParent(AbstractJcrNodeAdapter parent)
public String getNodeName()
public void setNodeName(String nodeName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |