Class DocumentWrapper
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<String,Serializable>
-
- org.nuxeo.ecm.automation.core.scripting.DocumentWrapper
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,Serializable>
public class DocumentWrapper extends HashMap<String,Serializable>
Wrap aDocumentModel
to expose in a pretty way more information to mvel scripts.- Author:
- Bogdan Stefanescu
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description protected DocumentModel
doc
protected CoreSession
session
-
Constructor Summary
Constructors Constructor Description DocumentWrapper(CoreSession session, DocumentModel doc)
-
Method Summary
-
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
-
-
-
Field Detail
-
session
protected final CoreSession session
-
doc
protected final DocumentModel doc
-
-
Constructor Detail
-
DocumentWrapper
public DocumentWrapper(CoreSession session, DocumentModel doc)
-
-
Method Detail
-
getDoc
public DocumentModel getDoc()
-
getSession
public CoreSession getSession()
-
getParent
public DocumentWrapper getParent()
-
getParent
public DocumentWrapper getParent(String type)
-
getWorkspace
public DocumentWrapper getWorkspace()
-
getDomain
public DocumentWrapper getDomain()
-
getTitle
public String getTitle()
-
getPath
public String getPath()
-
getRef
public DocumentRef getRef()
- Returns:
- the document ref
- Since:
- 5.6
-
resolvePathAsRef
public DocumentRef resolvePathAsRef(String relative)
-
getDescription
public String getDescription()
-
hasFacet
public boolean hasFacet(String facet)
-
hasSchema
public boolean hasSchema(String schema)
-
addFacet
public boolean addFacet(String facet)
-
removeFacet
public boolean removeFacet(String facet)
-
getType
public String getType()
-
getDocumentType
public DocumentType getDocumentType()
-
getLifeCycle
public String getLifeCycle()
-
isLocked
public boolean isLocked()
-
isFolder
public boolean isFolder()
-
isImmutable
public boolean isImmutable()
-
isProxy
public boolean isProxy()
-
isVersion
public boolean isVersion()
-
isDownloadable
public boolean isDownloadable()
-
isVersionable
public boolean isVersionable()
-
isTrashed
public boolean isTrashed()
- Since:
- 2021.30
-
getId
public String getId()
-
getName
public String getName()
-
getSchemas
public String[] getSchemas()
-
getProperty
public Serializable getProperty(String key)
-
getPropertyValue
public Serializable getPropertyValue(String key)
- Since:
- 5.7.3 Alias for #getProperty.
-
setProperty
public void setProperty(String key, Serializable value)
-
setPropertyValue
public void setPropertyValue(String key, Serializable value)
- Since:
- 5.7.3 Alias for #setProperty.
-
getVersionLabel
public String getVersionLabel()
-
containsKey
public boolean containsKey(Object key)
property map implementation- Specified by:
containsKey
in interfaceMap<String,Serializable>
- Overrides:
containsKey
in classHashMap<String,Serializable>
-
containsValue
public boolean containsValue(Object value)
The behavior of this method was changed -> it is checking if an xpath has a value attached.- Specified by:
containsValue
in interfaceMap<String,Serializable>
- Overrides:
containsValue
in classHashMap<String,Serializable>
-
get
public Serializable get(Object key)
- Specified by:
get
in interfaceMap<String,Serializable>
- Overrides:
get
in classHashMap<String,Serializable>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceMap<String,Serializable>
- Overrides:
isEmpty
in classHashMap<String,Serializable>
-
size
public int size()
- Specified by:
size
in interfaceMap<String,Serializable>
- Overrides:
size
in classHashMap<String,Serializable>
-
keySet
public Set<String> keySet()
- Specified by:
keySet
in interfaceMap<String,Serializable>
- Overrides:
keySet
in classHashMap<String,Serializable>
-
values
public Collection<Serializable> values()
- Specified by:
values
in interfaceMap<String,Serializable>
- Overrides:
values
in classHashMap<String,Serializable>
-
entrySet
public Set<Map.Entry<String,Serializable>> entrySet()
- Specified by:
entrySet
in interfaceMap<String,Serializable>
- Overrides:
entrySet
in classHashMap<String,Serializable>
-
put
public Serializable put(String key, Serializable value)
- Specified by:
put
in interfaceMap<String,Serializable>
- Overrides:
put
in classHashMap<String,Serializable>
-
putAll
public void putAll(Map<? extends String,? extends Serializable> m)
- Specified by:
putAll
in interfaceMap<String,Serializable>
- Overrides:
putAll
in classHashMap<String,Serializable>
-
remove
public Serializable remove(Object key)
- Specified by:
remove
in interfaceMap<String,Serializable>
- Overrides:
remove
in classHashMap<String,Serializable>
-
clear
public void clear()
- Specified by:
clear
in interfaceMap<String,Serializable>
- Overrides:
clear
in classHashMap<String,Serializable>
-
-