Class DocumentTemplate
- java.lang.Object
-
- org.nuxeo.ecm.platform.rendering.fm.adapters.DocumentTemplate
-
- All Implemented Interfaces:
freemarker.template.AdapterTemplateModel,freemarker.template.TemplateHashModel,freemarker.template.TemplateHashModelEx,freemarker.template.TemplateModel
public class DocumentTemplate extends Object implements freemarker.template.TemplateHashModelEx, freemarker.template.AdapterTemplateModel
TODO document template should not be aware of rendering context ?- Author:
- Bogdan Stefanescu
-
-
Field Summary
Fields Modifier and Type Field Description protected DocumentModeldocprotected freemarker.template.ObjectWrapperwrapper
-
Constructor Summary
Constructors Constructor Description DocumentTemplate(freemarker.template.ObjectWrapper wrapper, DocumentModel doc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description freemarker.template.TemplateModelget(String key)ObjectgetAdaptedObject(Class hint)DocumentModelgetDocument()Collection<String>getRawKeys()Collection<Object>getRawValues()CoreSessiongetSession()booleanisEmpty()A doc model is never empty.freemarker.template.TemplateCollectionModelkeys()intsize()freemarker.template.TemplateCollectionModelvalues()
-
-
-
Field Detail
-
wrapper
protected final freemarker.template.ObjectWrapper wrapper
-
doc
protected final DocumentModel doc
-
-
Constructor Detail
-
DocumentTemplate
public DocumentTemplate(freemarker.template.ObjectWrapper wrapper, DocumentModel doc)
-
-
Method Detail
-
getAdaptedObject
public Object getAdaptedObject(Class hint)
- Specified by:
getAdaptedObjectin interfacefreemarker.template.AdapterTemplateModel
-
getDocument
public DocumentModel getDocument()
-
get
public freemarker.template.TemplateModel get(String key) throws freemarker.template.TemplateModelException
- Specified by:
getin interfacefreemarker.template.TemplateHashModel- Throws:
freemarker.template.TemplateModelException
-
getSession
public CoreSession getSession()
-
isEmpty
public boolean isEmpty() throws freemarker.template.TemplateModelExceptionA doc model is never empty.- Specified by:
isEmptyin interfacefreemarker.template.TemplateHashModel- Throws:
freemarker.template.TemplateModelException
-
getRawKeys
public Collection<String> getRawKeys()
-
keys
public freemarker.template.TemplateCollectionModel keys() throws freemarker.template.TemplateModelException- Specified by:
keysin interfacefreemarker.template.TemplateHashModelEx- Throws:
freemarker.template.TemplateModelException
-
getRawValues
public Collection<Object> getRawValues() throws freemarker.template.TemplateModelException
- Throws:
freemarker.template.TemplateModelException
-
values
public freemarker.template.TemplateCollectionModel values() throws freemarker.template.TemplateModelException- Specified by:
valuesin interfacefreemarker.template.TemplateHashModelEx- Throws:
freemarker.template.TemplateModelException
-
size
public int size() throws freemarker.template.TemplateModelException- Specified by:
sizein interfacefreemarker.template.TemplateHashModelEx- Throws:
freemarker.template.TemplateModelException
-
-