public final class DocumentModelFunctions extends Object implements LiveEditConstants
ACTION, ACTION_CREATE_DOCUMENT, ACTION_CREATE_DOCUMENT_FROM_TEMPLATE, ACTION_EDIT_DOCUMENT, actionSelectorTag, BLOB_FIELD, BLOB_PROPERTY_NAME, DEFAULT_BLOB_FIELD, DEFAULT_DOCTYPE, DEFAULT_FILENAME_FIELD, DEFAULT_SCHEMA, DEFAULT_SUB_BLOB_FIELD, DOC_REF, DOC_TYPE, docBlobFieldNameTag, docBlobFieldPathTag, docFieldNameTag, docfieldPathTag, docFileAuthorizedExtensionsTag, docFileAuthorizedExtensionTag, docFileExtensionTag, docFilenameFieldNameTag, docFilenameFieldPathTag, docfileNameTag, docIsLockedTag, docIsVersionTag, docMimetypeTag, docPathTag, docRefTag, docRepositoryTag, docSchemaNameTag, docTitleTag, docTypeTag, documentTag, editIdTag, FILENAME_FIELD, FILENAME_PROPERTY_NAME, liveEditTag, MIMETYPE, REPO_ID, requestBaseURLTag, requestCookiesTag, requestCookieTag, requestHeadersTag, requestHeaderTag, requestInfoTag, SCHEMA, serverInfoTag, serverVersionTag, TEMPLATE_BLOB_FIELD, TEMPLATE_DOC_REF, TEMPLATE_REPO_ID, TEMPLATE_SCHEMA, templateDocumentTag, URL_ENCODE_CHARSET, userInfoTag, userLocaleTag, userNameTag, userPasswordTag, userTokenTag, wsdlAccessWebServiceTag, wsdlLEWebServiceTag, wsdlLocationsTag, XML_LE_NAMESPACE
Modifier and Type | Method and Description |
---|---|
static String |
bigFileUrl(DocumentModel doc,
String blobPropertyName,
String filename) |
static String |
bigIconExpandedPath(DocumentModel document) |
static String |
bigIconPath(DocumentModel document) |
static boolean |
canModify(DocumentModel document)
Returns true if document can be modified.
|
static String |
complexFileUrl(String patternName,
DocumentModel doc,
int index,
String filename)
Convenient method to get the REST URL of a blob inside the
Files schema. |
static String |
complexFileUrl(String patternName,
DocumentModel doc,
String listElement,
int index,
String blobPropertyName,
String filename)
Get the REST URL for a blob inside a list of complex type.
|
static String |
complexLiveEditUrl(DocumentModel doc,
String listPropertyName,
int index,
String blobPropertyName,
String filenamePropertyName)
Build the nxedit URL for the "edit existing document" use case
|
static Object |
defaultValue(String propertyName)
Returns the default value for given property name.
|
static Object |
defaultValue(String schemaName,
String fieldName)
Deprecated.
use defaultValue(propertyName) instead
|
static String |
documentUrl(DocumentModel doc) |
static String |
documentUrl(DocumentModel doc,
javax.servlet.http.HttpServletRequest req) |
static String |
documentUrl(String patternName,
DocumentLocation docLoc,
String viewId,
Map<String,String> parameters,
boolean newConversation,
javax.servlet.http.HttpServletRequest req) |
static String |
documentUrl(String patternName,
DocumentModel doc,
String viewId,
Map<String,String> parameters,
boolean newConversation) |
static String |
documentUrl(String patternName,
DocumentModel doc,
String viewId,
Map<String,String> parameters,
boolean newConversation,
javax.servlet.http.HttpServletRequest req) |
static String |
extractJSessionId(javax.servlet.http.HttpServletRequest request)
Extract the current JSESSIONID value from the request context
|
static String |
fileDescription(DocumentModel document,
String blobPropertyName,
String filePropertyName,
String filename) |
static String |
fileIconPath(Blob blob) |
static String |
fileUrl(String patternName,
DocumentModel doc,
String blobPropertyName,
String filename) |
static String |
fileUrl(String baseURL,
String patternName,
DocumentModel doc,
String blobPropertyName,
String filename) |
static Collection<String> |
getAvailableLifeCycleTransitions(String lifeCycleName,
String currentState)
Returns all the available transitions given the current state.
|
static String |
getLabelFromId(String directoryName,
String id)
Deprecated.
|
static String |
getPropertyPath(String listPropertyName,
int index,
String subPropertyName) |
static boolean |
hasPermission(DocumentModel document,
String permission) |
static String |
iconExpandedPath(DocumentModel document) |
static String |
iconPath(DocumentModel document) |
static boolean |
isDirty(DocumentModel doc) |
static boolean |
isDocumentModel(Object value) |
static String |
liveCreateFromTemplateUrl(DocumentModel template)
Build the nxedit URL for the "create new document from template" use case with "File" doc type and "file" schema
|
static String |
liveCreateFromTemplateUrl(DocumentModel template,
String templateSchemaName,
String templateBlobFieldName,
String docType,
String schemaName,
String blobFieldName,
String filenameFieldName)
Build the nxedit URL for the "create new document from template" use case
|
static String |
liveCreateUrl(String mimetype)
Build the nxedit URL for the "create new document" use case with a document using the file:content field as Blob
holder
|
static String |
liveCreateUrl(String mimetype,
String docType,
String schemaName,
String blobFieldName,
String filenameFieldName)
Build the nxedit URL for the "create new document" use case
|
static String |
liveEditUrl(DocumentModel doc)
Build the nxedit URL for the "edit existing document" use case for a document using the file:content field as
Blob holder
|
static String |
liveEditUrl(DocumentModel doc,
String schemaName,
String blobFieldName,
String filenameFieldName)
Build the nxedit URL for the "edit existing document" use case
|
static String |
repositoryUrl(String patternName,
String repositoryName,
String viewId,
Map<String,String> parameters,
boolean newConversation)
Computes an URL for a
repositoryName only. |
static String |
repositoryUrl(String patternName,
String repositoryName,
String viewId,
Map<String,String> parameters,
boolean newConversation,
javax.servlet.http.HttpServletRequest req)
Computes an URL for a
repositoryName only. |
static void |
resetDefaultViewCache()
Reset default view cache.
|
static String |
titleFromId(String documentId) |
static String |
titleOrId(DocumentModel document) |
static TypeInfo |
typeInfo(DocumentModel document) |
static String |
typeLabel(DocumentModel document) |
static String |
typeView(DocumentModel document,
String viewId) |
public static TypeInfo typeInfo(DocumentModel document)
public static String typeLabel(DocumentModel document)
public static String typeView(DocumentModel document, String viewId)
public static String iconPath(DocumentModel document)
public static String iconExpandedPath(DocumentModel document)
public static String bigIconPath(DocumentModel document)
public static String bigIconExpandedPath(DocumentModel document)
public static String titleOrId(DocumentModel document)
public static String titleFromId(String documentId) throws ClientException
ClientException
public static boolean isDocumentModel(Object value)
public static boolean isDirty(DocumentModel doc) throws ClientException
ClientException
public static boolean hasPermission(DocumentModel document, String permission) throws ClientException
ClientException
public static boolean canModify(DocumentModel document) throws ClientException
A document can be modified if current user has 'Write' permission on it and document is mutable (no archived version).
document
- ClientException
@Deprecated public static Object defaultValue(String schemaName, String fieldName)
schemaName
- the schema namefieldName
- the field namepublic static Object defaultValue(String propertyName)
propertyName
- as xpathpublic static String fileUrl(String baseURL, String patternName, DocumentModel doc, String blobPropertyName, String filename)
public static String fileUrl(String patternName, DocumentModel doc, String blobPropertyName, String filename)
public static String bigFileUrl(DocumentModel doc, String blobPropertyName, String filename)
public static String fileDescription(DocumentModel document, String blobPropertyName, String filePropertyName, String filename)
public static String complexFileUrl(String patternName, DocumentModel doc, int index, String filename)
Files
schema.patternName
- doc
- The document model.index
- index of the element containing the blob. index
starts at 0.filename
- The filename of the blob.null
if an error occurred.public static String complexFileUrl(String patternName, DocumentModel doc, String listElement, int index, String blobPropertyName, String filename)
http://localhost/nuxeo/nxfile/server/docId/files:files%5B0%5D/file/image.png
for the blob property
'file' of the first element inside the 'files:files' list.patternName
- doc
- The document model.listElement
- Element containing a list of complex type.index
- Index of the element containing the blob inside the list. index
starts at 0.blobPropertyName
- The property containing the blob.filename
- Filename of the blob.null
if an error occurred.public static String documentUrl(DocumentModel doc, javax.servlet.http.HttpServletRequest req)
public static String documentUrl(DocumentModel doc)
public static String documentUrl(String patternName, DocumentModel doc, String viewId, Map<String,String> parameters, boolean newConversation)
public static String documentUrl(String patternName, DocumentModel doc, String viewId, Map<String,String> parameters, boolean newConversation, javax.servlet.http.HttpServletRequest req)
public static String documentUrl(String patternName, DocumentLocation docLoc, String viewId, Map<String,String> parameters, boolean newConversation, javax.servlet.http.HttpServletRequest req)
public static String repositoryUrl(String patternName, String repositoryName, String viewId, Map<String,String> parameters, boolean newConversation)
repositoryName
only.public static String repositoryUrl(String patternName, String repositoryName, String viewId, Map<String,String> parameters, boolean newConversation, javax.servlet.http.HttpServletRequest req)
repositoryName
only.public static String liveEditUrl(DocumentModel doc) throws ClientException
ClientException
- if the URL encoding failspublic static String liveEditUrl(DocumentModel doc, String schemaName, String blobFieldName, String filenameFieldName) throws ClientException
ClientException
- if the URL encoding failspublic static String complexLiveEditUrl(DocumentModel doc, String listPropertyName, int index, String blobPropertyName, String filenamePropertyName) throws ClientException
ClientException
- if the URL encoding failspublic static String liveCreateUrl(String mimetype) throws ClientException
mimetype
- the mime type of the newly created documentClientException
- if the URL encoding failspublic static String liveCreateUrl(String mimetype, String docType, String schemaName, String blobFieldName, String filenameFieldName) throws ClientException
mimetype
- the mime type of the newly created documentdocType
- the document type of the document to createschemaName
- the schema of the blob to hold the new attachmentblobFieldName
- the field name of the blob to hold the new attachmentfilenameFieldName
- the field name of the filename of the new attachmentClientException
- if the URL encoding failspublic static String liveCreateFromTemplateUrl(DocumentModel template) throws ClientException
template
- the document holding the blob to be used as templateClientException
- if the URL encoding failspublic static String liveCreateFromTemplateUrl(DocumentModel template, String templateSchemaName, String templateBlobFieldName, String docType, String schemaName, String blobFieldName, String filenameFieldName) throws ClientException
template
- the document holding the blob to be used as templatetemplateSchemaName
- the schema of the blob holding the templatetemplateBlobFieldName
- the field name of the blob holding the templatedocType
- the document type of the new document to createschemaName
- the schema of the new blob to be saved as attachmentblobFieldName
- the field name of the new blob to be saved as attachmentfilenameFieldName
- the field name of the filename of the attachmentClientException
- if the URL encoding failspublic static String extractJSessionId(javax.servlet.http.HttpServletRequest request)
request
- the current HttpServletRequest request@Deprecated public static String getLabelFromId(String directoryName, String id) throws DirectoryException
DirectoryFunctions.getDirectoryEntry(String, String)
directoryName
- the directory nameid
- the label idDirectoryException
public static String getPropertyPath(String listPropertyName, int index, String subPropertyName)
public static Collection<String> getAvailableLifeCycleTransitions(String lifeCycleName, String currentState) throws LifeCycleException
lifeCycleName
- the Life Cycle namecurrentState
- the state from which the transitions should startLifeCycleException
public static void resetDefaultViewCache()
Copyright © 2015 Nuxeo SA. All rights reserved.