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 aDocumentModelto 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 DocumentModeldocprotected CoreSessionsession 
- 
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:
 containsKeyin interfaceMap<String,Serializable>- Overrides:
 containsKeyin 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:
 containsValuein interfaceMap<String,Serializable>- Overrides:
 containsValuein classHashMap<String,Serializable>
 
- 
get
public Serializable get(Object key)
- Specified by:
 getin interfaceMap<String,Serializable>- Overrides:
 getin classHashMap<String,Serializable>
 
- 
isEmpty
public boolean isEmpty()
- Specified by:
 isEmptyin interfaceMap<String,Serializable>- Overrides:
 isEmptyin classHashMap<String,Serializable>
 
- 
size
public int size()
- Specified by:
 sizein interfaceMap<String,Serializable>- Overrides:
 sizein classHashMap<String,Serializable>
 
- 
keySet
public Set<String> keySet()
- Specified by:
 keySetin interfaceMap<String,Serializable>- Overrides:
 keySetin classHashMap<String,Serializable>
 
- 
values
public Collection<Serializable> values()
- Specified by:
 valuesin interfaceMap<String,Serializable>- Overrides:
 valuesin classHashMap<String,Serializable>
 
- 
entrySet
public Set<Map.Entry<String,Serializable>> entrySet()
- Specified by:
 entrySetin interfaceMap<String,Serializable>- Overrides:
 entrySetin classHashMap<String,Serializable>
 
- 
put
public Serializable put(String key, Serializable value)
- Specified by:
 putin interfaceMap<String,Serializable>- Overrides:
 putin classHashMap<String,Serializable>
 
- 
putAll
public void putAll(Map<? extends String,? extends Serializable> m)
- Specified by:
 putAllin interfaceMap<String,Serializable>- Overrides:
 putAllin classHashMap<String,Serializable>
 
- 
remove
public Serializable remove(Object key)
- Specified by:
 removein interfaceMap<String,Serializable>- Overrides:
 removein classHashMap<String,Serializable>
 
- 
clear
public void clear()
- Specified by:
 clearin interfaceMap<String,Serializable>- Overrides:
 clearin classHashMap<String,Serializable>
 
 - 
 
 -