Nuxeo Enterprise Platform 5.4

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

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

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

getParent

public DocumentWrapper getParent(java.lang.String type)
                          throws java.lang.Exception
Throws:
java.lang.Exception

getWorkspace

public DocumentWrapper getWorkspace()
                             throws java.lang.Exception
Throws:
java.lang.Exception

getDomain

public DocumentWrapper getDomain()
                          throws java.lang.Exception
Throws:
java.lang.Exception

getTitle

public java.lang.String getTitle()
                          throws java.lang.Exception
Throws:
java.lang.Exception

getPath

public java.lang.String getPath()
                         throws java.lang.Exception
Throws:
java.lang.Exception

resolvePath

public java.lang.String resolvePath(java.lang.String relative)
                             throws java.lang.Exception
Throws:
java.lang.Exception

resolvePathAsRef

public DocumentRef resolvePathAsRef(java.lang.String relative)
                             throws java.lang.Exception
Throws:
java.lang.Exception

getDescription

public java.lang.String getDescription()
                                throws java.lang.Exception
Throws:
java.lang.Exception

hasFacet

public boolean hasFacet(java.lang.String facet)

hasSchema

public boolean hasSchema(java.lang.String schema)

getType

public java.lang.String getType()

getDocumentType

public DocumentType getDocumentType()

getLifeCycle

public java.lang.String getLifeCycle()
                              throws java.lang.Exception
Throws:
java.lang.Exception

isLocked

public boolean isLocked()
                 throws java.lang.Exception
Throws:
java.lang.Exception

isFolder

public boolean isFolder()
                 throws java.lang.Exception
Throws:
java.lang.Exception

isImmutable

public boolean isImmutable()
                    throws java.lang.Exception
Throws:
java.lang.Exception

isProxy

public boolean isProxy()
                throws java.lang.Exception
Throws:
java.lang.Exception

isVersion

public boolean isVersion()
                  throws java.lang.Exception
Throws:
java.lang.Exception

isDownloadable

public boolean isDownloadable()
                       throws java.lang.Exception
Throws:
java.lang.Exception

isVersionable

public boolean isVersionable()
                      throws java.lang.Exception
Throws:
java.lang.Exception

getId

public java.lang.String getId()

getName

public java.lang.String getName()

getSchemas

public java.lang.String[] getSchemas()

getFacets

public java.util.Set<java.lang.String> getFacets()

getProperty

public java.io.Serializable getProperty(java.lang.String key)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

setProperty

public void setProperty(java.lang.String key,
                        java.io.Serializable value)
                 throws java.lang.Exception
Throws:
java.lang.Exception

getVersionLabel

public java.lang.String getVersionLabel()
                                 throws java.lang.Exception
Throws:
java.lang.Exception

containsKey

public boolean containsKey(java.lang.Object key)
property map implementation

Specified by:
containsKey in interface java.util.Map<java.lang.String,java.io.Serializable>
Overrides:
containsKey in class java.util.HashMap<java.lang.String,java.io.Serializable>

containsValue

public boolean containsValue(java.lang.Object value)
The behavior of this method was changed -> it is checking if an xpath has a value attached.

Specified by:
containsValue in interface java.util.Map<java.lang.String,java.io.Serializable>
Overrides:
containsValue in class java.util.HashMap<java.lang.String,java.io.Serializable>

get

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

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Map<java.lang.String,java.io.Serializable>
Overrides:
isEmpty in class java.util.HashMap<java.lang.String,java.io.Serializable>

size

public int size()
Specified by:
size in interface java.util.Map<java.lang.String,java.io.Serializable>
Overrides:
size in class java.util.HashMap<java.lang.String,java.io.Serializable>

keySet

public java.util.Set<java.lang.String> keySet()
Specified by:
keySet in interface java.util.Map<java.lang.String,java.io.Serializable>
Overrides:
keySet in class java.util.HashMap<java.lang.String,java.io.Serializable>

values

public java.util.Collection<java.io.Serializable> values()
Specified by:
values in interface java.util.Map<java.lang.String,java.io.Serializable>
Overrides:
values in class java.util.HashMap<java.lang.String,java.io.Serializable>

entrySet

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

put

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

putAll

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

remove

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

clear

public void clear()
Specified by:
clear in interface java.util.Map<java.lang.String,java.io.Serializable>
Overrides:
clear in class java.util.HashMap<java.lang.String,java.io.Serializable>

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.