public final class DocumentModelUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
decodePropertyName(String propertyPath)
Decodes a property path given in a url.
|
static String |
encodePropertyName(String propertyName)
Encodes a property name to use it in a url.
|
static Object |
getComplexPropertyValue(DocumentModel doc,
String propertyPath)
Obtains a property value given its path.
|
static String |
getFieldName(String propertyName)
Obtains the field name from the full propertyName.
|
static Map<String,Object> |
getProperties(DocumentModel docModel)
Gets all properties defined in declared schemas of a DocumentModel.
|
static Object |
getPropertyValue(DocumentModel doc,
String propertyName)
The given propertyName should have 'schema_name:property_name' format.
|
static String |
getSchemaName(String propertyName)
Obtains the schema name from the full propertyName.
|
public static String encodePropertyName(String propertyName)
propertyName
- like dc:title, file:content.3.filename (?)public static String decodePropertyName(String propertyPath)
propertyPath
- like dc:title file/content/3/filename (?)public static Object getPropertyValue(DocumentModel doc, String propertyName)
null
if any error occurs.public static Object getComplexPropertyValue(DocumentModel doc, String propertyPath)
doc
- the documentpropertyPath
- the property pathnull
if an error occured.public static String getSchemaName(String propertyName)
IllegalArgumentException
- if the propertyName does not have a schema:field patternpublic static String getFieldName(String propertyName)
IllegalArgumentException
- if the propertyName does not have a schema:field patternpublic static Map<String,Object> getProperties(DocumentModel docModel)
Copyright © 2018 Nuxeo. All rights reserved.