Package org.hippoecm.frontend.model
Class JcrNodeModel
- All Implemented Interfaces:
Serializable
,org.apache.wicket.model.IDetachable
,org.apache.wicket.model.IModel<Node>
,org.apache.wicket.util.io.IClusterable
,IObservable
The model for a JCR
Node
. It maintains a reference to a (possibly null)
Node object. In addition, it is IObservable
, broadcasting JCR Event
s
for property changes and child node additions or removals.
In general, no guarantees are made on the existence of the Node. I.e. the referenced node may disappear or it may even never have existed.
- See Also:
-
Constructor Summary
ConstructorDescriptionJcrNodeModel
(String path) Create a JcrNodeModel based on an absolute JCR path.JcrNodeModel
(Node node) Create a JcrNodeModel based on a JCR Node.JcrNodeModel
(JcrItemModel model) Create a JcrNodeModel based on an JcrItemModel. -
Method Summary
Modifier and TypeMethodDescriptionvoid
detach()
boolean
Equivalence of observables; observation will only be started on one instance.getNode()
Retrieve the node from the repository.Retrieve a JcrNodeModel for the parent node.int
hashCode()
void
setObservationContext
(IObservationContext<? extends IObservable> context) Store the observation context to be used to dispatch events.void
Start the observation by listening to JCREvent
s.void
Stop listening to JCREvent
s.toString()
Methods inherited from class org.hippoecm.frontend.model.ItemModelWrapper
getItemModel, setItemModel, setObject
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.wicket.model.IModel
as, combineWith, filter, flatMap, isPresent, map, orElse, orElseGet
-
Constructor Details
-
JcrNodeModel
Create a JcrNodeModel based on an JcrItemModel. The JcrItemModel should provide access to the Node to be wrapped by this model.- Parameters:
model
- the Item model
-
JcrNodeModel
Create a JcrNodeModel based on a JCR Node.- Parameters:
node
- the node to wrap
-
JcrNodeModel
Create a JcrNodeModel based on an absolute JCR path.- Parameters:
path
- the JCR path to the Node.
-
-
Method Details
-
getNode
Retrieve the node from the repository. May return null when the node no longer exists or the model was initially created with a null object. -
getObject
- Specified by:
getObject
in interfaceorg.apache.wicket.model.IModel<Node>
- Overrides:
getObject
in classItemModelWrapper<Node>
-
getParentModel
Retrieve a JcrNodeModel for the parent node.- Returns:
- a model for the parent Node
-
detach
public void detach()- Specified by:
detach
in interfaceorg.apache.wicket.model.IDetachable
- Specified by:
detach
in interfaceorg.apache.wicket.model.IModel<Node>
- Overrides:
detach
in classItemModelWrapper<Node>
-
setObservationContext
Store the observation context to be used to dispatch events.- Specified by:
setObservationContext
in interfaceIObservable
-
startObservation
public void startObservation()Start the observation by listening to JCREvent
s.- Specified by:
startObservation
in interfaceIObservable
-
stopObservation
public void stopObservation()Stop listening to JCREvent
s.- Specified by:
stopObservation
in interfaceIObservable
-
toString
-
equals
Description copied from interface:IObservable
Equivalence of observables; observation will only be started on one instance.- Specified by:
equals
in interfaceIObservable
- Overrides:
equals
in classObject
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceIObservable
- Overrides:
hashCode
in classObject
- See Also:
-