org.nuxeo.ecm.platform.rendering.api
Class DefaultDocumentView
java.lang.Object
org.nuxeo.ecm.platform.rendering.api.DefaultDocumentView
- All Implemented Interfaces:
- DocumentView
public class DefaultDocumentView
- extends Object
- implements DocumentView
Base class to build views for Document oriented contexts (contexts that are
bound to a document).
Note that this class cannot be used with contexts for which the
RenderingContext#getDocument()
method is returning null.
This implementation ensure that the context argument is never used so it can
be used outside the scope of a rendering context to get a view over the
document.
- Author:
- Bogdan Stefanescu
UNKNOWN
public static final Object UNKNOWN
DEFAULT
public static final DefaultDocumentView DEFAULT
- The singleton instance that should be used by clients. Warn that this
static field must be defined at the end of the class after any other
field class since it will try to register these fields (otherwise fields
will not be defined yet at the time of the initialization of that static
member
DefaultDocumentView
public DefaultDocumentView()
DefaultDocumentView
public DefaultDocumentView(Map<String,DefaultDocumentView.Field> fields)
addField
public final void addField(DefaultDocumentView.Field field)
addFields
public final void addFields(Collection<DefaultDocumentView.Field> fields)
removeField
public final void removeField(String name)
getField
public DefaultDocumentView.Field getField(String name)
get
public Object get(DocumentModel doc,
String name)
throws Exception
- Specified by:
get
in interface DocumentView
- Throws:
Exception
keys
public Collection<String> keys(DocumentModel doc)
- Specified by:
keys
in interface DocumentView
getFields
public Map<String,DefaultDocumentView.Field> getFields()
isEmpty
public boolean isEmpty()
size
public int size(DocumentModel doc)
Copyright © 2011 Nuxeo SAS. All Rights Reserved.