Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.automation.core.scripting
Class DocumentWrapper

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<String,Serializable>
          extended by org.nuxeo.ecm.automation.core.scripting.DocumentWrapper
All Implemented Interfaces:
Serializable, Cloneable, Map<String,Serializable>

public class DocumentWrapper
extends HashMap<String,Serializable>

Wrap a DocumentModel 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,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Constructor Summary
DocumentWrapper(CoreSession session, DocumentModel doc)
           
 
Method Summary
 boolean addFacet(String facet)
           
 void clear()
           
 boolean containsKey(Object key)
          property map implementation
 boolean containsValue(Object value)
          The behavior of this method was changed -> it is checking if an xpath has a value attached.
 Set<Map.Entry<String,Serializable>> entrySet()
           
 Serializable get(Object key)
           
 String getDescription()
           
 DocumentModel getDoc()
           
 DocumentType getDocumentType()
           
 DocumentWrapper getDomain()
           
 Set<String> getFacets()
           
 String getId()
           
 String getLifeCycle()
           
 String getName()
           
 DocumentWrapper getParent()
           
 DocumentWrapper getParent(String type)
           
 String getPath()
           
 Serializable getProperty(String key)
           
 String[] getSchemas()
           
 CoreSession getSession()
           
 String getTitle()
           
 String getType()
           
 String getVersionLabel()
           
 DocumentWrapper getWorkspace()
           
 boolean hasFacet(String facet)
           
 boolean hasSchema(String schema)
           
 boolean isDownloadable()
           
 boolean isEmpty()
           
 boolean isFolder()
           
 boolean isImmutable()
           
 boolean isLocked()
           
 boolean isProxy()
           
 boolean isVersion()
           
 boolean isVersionable()
           
 Set<String> keySet()
           
 Serializable put(String key, Serializable value)
           
 void putAll(Map<? extends String,? extends Serializable> m)
           
 Serializable remove(Object key)
           
 boolean removeFacet(String facet)
           
 String resolvePath(String relative)
           
 DocumentRef resolvePathAsRef(String relative)
           
 void setProperty(String key, Serializable value)
           
 int size()
           
 Collection<Serializable> values()
           
 
Methods inherited from class java.util.HashMap
clone
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

DocumentWrapper

public DocumentWrapper(CoreSession session,
                       DocumentModel doc)
Method Detail

getDoc

public DocumentModel getDoc()

getSession

public CoreSession getSession()

getParent

public DocumentWrapper getParent()
                          throws Exception
Throws:
Exception

getParent

public DocumentWrapper getParent(String type)
                          throws Exception
Throws:
Exception

getWorkspace

public DocumentWrapper getWorkspace()
                             throws Exception
Throws:
Exception

getDomain

public DocumentWrapper getDomain()
                          throws Exception
Throws:
Exception

getTitle

public String getTitle()
                throws Exception
Throws:
Exception

getPath

public String getPath()

resolvePath

public String resolvePath(String relative)

resolvePathAsRef

public DocumentRef resolvePathAsRef(String relative)

getDescription

public String getDescription()
                      throws Exception
Throws:
Exception

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()
                    throws Exception
Throws:
Exception

isLocked

public boolean isLocked()

isFolder

public boolean isFolder()

isImmutable

public boolean isImmutable()

isProxy

public boolean isProxy()

isVersion

public boolean isVersion()

isDownloadable

public boolean isDownloadable()
                       throws Exception
Throws:
Exception

isVersionable

public boolean isVersionable()

getId

public String getId()

getName

public String getName()

getSchemas

public String[] getSchemas()

getFacets

public Set<String> getFacets()

getProperty

public Serializable getProperty(String key)
                         throws Exception
Throws:
Exception

setProperty

public void setProperty(String key,
                        Serializable value)
                 throws Exception
Throws:
Exception

getVersionLabel

public String getVersionLabel()

containsKey

public boolean containsKey(Object key)
property map implementation

Specified by:
containsKey in interface Map<String,Serializable>
Overrides:
containsKey in class HashMap<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 interface Map<String,Serializable>
Overrides:
containsValue in class HashMap<String,Serializable>

get

public Serializable get(Object key)
Specified by:
get in interface Map<String,Serializable>
Overrides:
get in class HashMap<String,Serializable>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map<String,Serializable>
Overrides:
isEmpty in class HashMap<String,Serializable>

size

public int size()
Specified by:
size in interface Map<String,Serializable>
Overrides:
size in class HashMap<String,Serializable>

keySet

public Set<String> keySet()
Specified by:
keySet in interface Map<String,Serializable>
Overrides:
keySet in class HashMap<String,Serializable>

values

public Collection<Serializable> values()
Specified by:
values in interface Map<String,Serializable>
Overrides:
values in class HashMap<String,Serializable>

entrySet

public Set<Map.Entry<String,Serializable>> entrySet()
Specified by:
entrySet in interface Map<String,Serializable>
Overrides:
entrySet in class HashMap<String,Serializable>

put

public Serializable put(String key,
                        Serializable value)
Specified by:
put in interface Map<String,Serializable>
Overrides:
put in class HashMap<String,Serializable>

putAll

public void putAll(Map<? extends String,? extends Serializable> m)
Specified by:
putAll in interface Map<String,Serializable>
Overrides:
putAll in class HashMap<String,Serializable>

remove

public Serializable remove(Object key)
Specified by:
remove in interface Map<String,Serializable>
Overrides:
remove in class HashMap<String,Serializable>

clear

public void clear()
Specified by:
clear in interface Map<String,Serializable>
Overrides:
clear in class HashMap<String,Serializable>

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.