Package org.hippoecm.frontend.model
Class JcrItemModel<T extends Item>
java.lang.Object
org.apache.wicket.model.LoadableDetachableModel<T>
org.hippoecm.frontend.model.JcrItemModel<T>
- All Implemented Interfaces:
Serializable
,org.apache.wicket.model.IDetachable
,org.apache.wicket.model.IModel<T>
,org.apache.wicket.util.io.IClusterable
public class JcrItemModel<T extends Item>
extends org.apache.wicket.model.LoadableDetachableModel<T>
Model for JCR
Item
s. The model tracks the Item as well as it can, using the first referencable ancestor
plus a relative path as the identification/retrieval method. When the Item (or one of its ancestors) is moved, this
is transparent.
In development, when the model is serialized, it checks whether it has been detached properly.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
detach()
boolean
boolean
exists()
Determine whether the Item exists.Retrieve the JcrItemModel for the parentNode
.getPath()
The absolute JCR path for the Item.Retrieve the JCR path for the Item, relative to the first referencable ancestorgetUuid()
Retrieve the identifier (UUID) of the first referencable ancestor nodeint
hashCode()
protected T
load()
protected T
toString()
Methods inherited from class org.apache.wicket.model.LoadableDetachableModel
getObject, isAttached, of, onAttach, onDetach, 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
-
JcrItemModel
-
JcrItemModel
-
-
Method Details
-
getUuid
Retrieve the identifier (UUID) of the first referencable ancestor node- Returns:
- the UUID
-
getRelativePath
Retrieve the JCR path for the Item, relative to the first referencable ancestor- Returns:
- the relative path
-
getPath
The absolute JCR path for the Item.- Returns:
- the absolute path
-
exists
public boolean exists()Determine whether the Item exists. This will retrieve the Item from the repository. If the Item has been loaded in this request cycle (e.g. usingIModel.getObject()
), but has since been removed, the returned information may be incorrect.- Returns:
- true when the Item exists
-
getParentModel
Retrieve the JcrItemModel for the parentNode
.- Returns:
- the parent JcrItemModel
-
load
-
loadModel
-
detach
public void detach() -
toString
-
equals
-
hashCode
public int hashCode()
-