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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
DefaultDocumentView.Field
-
Field Summary
-
Constructor Summary
Constructors Constructor Description DefaultDocumentView()
DefaultDocumentView(Map<String,DefaultDocumentView.Field> fields)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addField(DefaultDocumentView.Field field)
void
addFields(Collection<DefaultDocumentView.Field> fields)
Object
get(DocumentModel doc, String name)
DefaultDocumentView.Field
getField(String name)
Map<String,DefaultDocumentView.Field>
getFields()
protected void
initialize()
boolean
isEmpty()
Collection<String>
keys(DocumentModel doc)
void
removeField(String name)
int
size(DocumentModel doc)
-
-
-
Field Detail
-
UNKNOWN
public static final Object UNKNOWN
-
fields
protected final Map<String,DefaultDocumentView.Field> fields
-
SESSION
protected static final DefaultDocumentView.Field SESSION
-
ID
protected static final DefaultDocumentView.Field ID
-
NAME
protected static final DefaultDocumentView.Field NAME
-
PATH
protected static final DefaultDocumentView.Field PATH
-
TYPE
protected static final DefaultDocumentView.Field TYPE
-
SCHEMAS
protected static final DefaultDocumentView.Field SCHEMAS
-
FACETS
protected static final DefaultDocumentView.Field FACETS
-
STATE
protected static final DefaultDocumentView.Field STATE
-
LOCKED
protected static final DefaultDocumentView.Field LOCKED
-
LIFE_CYCLE_STATE
protected static final DefaultDocumentView.Field LIFE_CYCLE_STATE
-
LIFE_CYCLE_POLICY
protected static final DefaultDocumentView.Field LIFE_CYCLE_POLICY
-
ALLOWED_STATE_TRANSITIONS
protected static final DefaultDocumentView.Field ALLOWED_STATE_TRANSITIONS
-
IS_FOLDER
protected static final DefaultDocumentView.Field IS_FOLDER
-
TITLE
protected static final DefaultDocumentView.Field TITLE
-
AUTHOR
protected static final DefaultDocumentView.Field AUTHOR
-
CREATED
protected static final DefaultDocumentView.Field CREATED
-
MODIFIED
protected static final DefaultDocumentView.Field MODIFIED
-
CONTENT
protected static final DefaultDocumentView.Field CONTENT
-
SID
@Deprecated protected static final DefaultDocumentView.Field SID
Deprecated.since 11.1
-
REPOSITORY
protected static final DefaultDocumentView.Field REPOSITORY
-
PARENT
protected static final DefaultDocumentView.Field PARENT
-
CHILDREN
protected static final DefaultDocumentView.Field CHILDREN
-
REF
protected static final DefaultDocumentView.Field REF
-
VERSIONS
protected static final DefaultDocumentView.Field VERSIONS
-
PROXIES
protected static final DefaultDocumentView.Field PROXIES
-
VERSION_LABEL
protected static final DefaultDocumentView.Field VERSION_LABEL
-
SOURCE_ID
protected static final DefaultDocumentView.Field SOURCE_ID
-
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
-
-
Constructor Detail
-
DefaultDocumentView
public DefaultDocumentView()
-
DefaultDocumentView
public DefaultDocumentView(Map<String,DefaultDocumentView.Field> fields)
-
-
Method Detail
-
initialize
protected void initialize()
-
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 PropertyException
- Specified by:
get
in interfaceDocumentView
- Throws:
PropertyException
-
keys
public Collection<String> keys(DocumentModel doc)
- Specified by:
keys
in interfaceDocumentView
-
getFields
public Map<String,DefaultDocumentView.Field> getFields()
-
isEmpty
public boolean isEmpty()
-
size
public int size(DocumentModel doc)
-
-