Nuxeo Enterprise Platform 5.3

org.nuxeo.ecm.webapp.liveedit
Class LiveEditBootstrapHelper

java.lang.Object
  extended by org.nuxeo.ecm.webapp.liveedit.LiveEditBootstrapHelper
All Implemented Interfaces:
Serializable, LiveEditConstants

@Scope(value=EVENT)
@Name(value="liveEditHelper")
public class LiveEditBootstrapHelper
extends Object
implements Serializable, LiveEditConstants

The LiveEdit bootstrap procedure works as follows:

Please refer to the nuxeo book chapter on desktop integration for details on the format of the nxedit URLs and the XML bootstrap file.

Author:
Thierry Delprat NXP-1959 the bootstrap file is managing the 'create new document [from template]' case too. The URL is containing an action identifier., Rux rdarlea@nuxeo.com, Olivier Grisel ogrisel@nuxeo.com (split url functions into JSF DocumentModelFunctions module)
See Also:
Serialized Form

Field Summary
protected  String action
           
protected  String blobField
          Deprecated. use blobPropertyField instead
protected  String blobPropertyName
           
protected  Map<String,Boolean> cachedEditableBlobs
           
protected  Map<String,Boolean> cachedEditableStates
           
protected  String docRef
           
protected  String docType
           
protected  CoreSession documentManager
           
protected static String DUBLINCORE_SCHEMA
           
protected  String filenameField
          Deprecated. use filenamePropertyField instead
protected  String filenamePropertyName
           
protected  LiveEditClientConfig liveEditClientConfig
           
protected  String mimetype
           
protected  MimetypeRegistry mimetypeRegistry
           
protected static String MODIFIED_FIELD
           
protected  NavigationContext navigationContext
           
protected  String repoID
           
protected  String schema
          Deprecated. use blobPropertyField and filenamePropertyField instead
protected  String templateBlobField
           
protected  String templateDocRef
           
protected  String templateRepoID
           
protected  String templateSchema
           
 
Fields inherited from interface org.nuxeo.ecm.platform.ui.web.tag.fn.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
 
Constructor Summary
LiveEditBootstrapHelper()
           
 
Method Summary
protected static org.dom4j.Element addTextElement(org.dom4j.Element parent, org.dom4j.QName newElementName, String value)
           
protected  boolean cacheBlobToFalse(String cacheKey)
           
 void getBootstrap()
          Creates the bootstrap file.
protected static String getEditId(DocumentModel doc, CoreSession session, String userName)
           
protected  String getFileExtension(String mimetype)
           
protected  List<String> getFileExtensions(String mimetype)
           
protected  MimetypeRegistry getMimetypeRegistry()
           
protected  CoreSession getSession(String repositoryName)
           
 boolean isCurrentDocumentLiveEditable()
           
 boolean isCurrentDocumentLiveEditable(String propertyName)
           
 boolean isCurrentDocumentLiveEditable(String schemaName, String fieldName)
           
 boolean isDocumentLiveEditable(DocumentModel documentModel, String propertyName)
           
 boolean isDocumentLiveEditable(DocumentModel documentModel, String schemaName, String fieldName)
           
 boolean isLiveEditable(Blob blob)
           
 boolean isMimeTypeLiveEditable(String mimetype)
           
 boolean isMSExcelLiveEdititable()
           
 boolean isMSPowerpointLiveEdititable()
           
 boolean isMSWordLiveEdititable()
           
 boolean isOOCalcLiveEdititable()
           
 boolean isOOPresentationLiveEdititable()
           
 boolean isOOTextLiveEdititable()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODIFIED_FIELD

protected static final String MODIFIED_FIELD
See Also:
Constant Field Values

DUBLINCORE_SCHEMA

protected static final String DUBLINCORE_SCHEMA
See Also:
Constant Field Values

navigationContext

@In(create=true)
protected transient NavigationContext navigationContext

documentManager

@In(create=true,
    required=false)
protected transient CoreSession documentManager

action

@RequestParameter
protected String action

repoID

@RequestParameter
protected String repoID

templateRepoID

@RequestParameter
protected String templateRepoID

docRef

@RequestParameter
protected String docRef

templateDocRef

@RequestParameter
protected String templateDocRef

liveEditClientConfig

@In(create=true)
protected LiveEditClientConfig liveEditClientConfig

schema

@Deprecated
@RequestParameter
protected String schema
Deprecated. use blobPropertyField and filenamePropertyField instead

templateSchema

@RequestParameter
protected String templateSchema

blobField

@Deprecated
@RequestParameter
protected String blobField
Deprecated. use blobPropertyField instead

blobPropertyName

@RequestParameter
protected String blobPropertyName

templateBlobField

@RequestParameter
protected String templateBlobField

filenameField

@Deprecated
@RequestParameter
protected String filenameField
Deprecated. use filenamePropertyField instead

filenamePropertyName

@RequestParameter
protected String filenamePropertyName

mimetype

@RequestParameter
protected String mimetype

docType

@RequestParameter
protected String docType

mimetypeRegistry

protected MimetypeRegistry mimetypeRegistry

cachedEditableStates

protected final Map<String,Boolean> cachedEditableStates

cachedEditableBlobs

protected final Map<String,Boolean> cachedEditableBlobs
Constructor Detail

LiveEditBootstrapHelper

public LiveEditBootstrapHelper()
Method Detail

getSession

protected CoreSession getSession(String repositoryName)
                          throws ClientException
Throws:
ClientException

getBootstrap

public void getBootstrap()
                  throws Exception
Creates the bootstrap file. It is called from the browser's addon. The URL composition tells the case and what to create. The structure is depicted in the NXP-1881. Rux NXP-1959: add new tag on root level describing the action: actionEdit, actionNew or actionFromTemplate.

Throws:
Exception

getFileExtension

protected String getFileExtension(String mimetype)
                           throws Exception
Throws:
Exception

getFileExtensions

protected List<String> getFileExtensions(String mimetype)
                                  throws Exception
Throws:
Exception

addTextElement

protected static org.dom4j.Element addTextElement(org.dom4j.Element parent,
                                                  org.dom4j.QName newElementName,
                                                  String value)

getEditId

protected static String getEditId(DocumentModel doc,
                                  CoreSession session,
                                  String userName)

isLiveEditable

public boolean isLiveEditable(Blob blob)
                       throws ClientException
Throws:
ClientException

isMimeTypeLiveEditable

public boolean isMimeTypeLiveEditable(String mimetype)
                               throws ClientException
Throws:
ClientException

isMSWordLiveEdititable

@Factory(value="msword_liveeditable",
         scope=SESSION)
public boolean isMSWordLiveEdititable()
                               throws ClientException
Throws:
ClientException

isMSExcelLiveEdititable

@Factory(value="msexcel_liveeditable",
         scope=SESSION)
public boolean isMSExcelLiveEdititable()
                                throws ClientException
Throws:
ClientException

isMSPowerpointLiveEdititable

@Factory(value="mspowerpoint_liveeditable",
         scope=SESSION)
public boolean isMSPowerpointLiveEdititable()
                                     throws ClientException
Throws:
ClientException

isOOTextLiveEdititable

@Factory(value="ootext_liveeditable",
         scope=SESSION)
public boolean isOOTextLiveEdititable()
                               throws ClientException
Throws:
ClientException

isOOCalcLiveEdititable

@Factory(value="oocalc_liveeditable",
         scope=SESSION)
public boolean isOOCalcLiveEdititable()
                               throws ClientException
Throws:
ClientException

isOOPresentationLiveEdititable

@Factory(value="oopresentation_liveeditable",
         scope=SESSION)
public boolean isOOPresentationLiveEdititable()
                                       throws ClientException
Throws:
ClientException

isCurrentDocumentLiveEditable

public boolean isCurrentDocumentLiveEditable()
                                      throws ClientException
Throws:
ClientException

isCurrentDocumentLiveEditable

public boolean isCurrentDocumentLiveEditable(String schemaName,
                                             String fieldName)
                                      throws ClientException
Throws:
ClientException

isCurrentDocumentLiveEditable

public boolean isCurrentDocumentLiveEditable(String propertyName)
                                      throws ClientException
Throws:
ClientException

isDocumentLiveEditable

public boolean isDocumentLiveEditable(DocumentModel documentModel,
                                      String schemaName,
                                      String fieldName)
                               throws ClientException
Throws:
ClientException

isDocumentLiveEditable

public boolean isDocumentLiveEditable(DocumentModel documentModel,
                                      String propertyName)
                               throws ClientException
Throws:
ClientException

cacheBlobToFalse

protected boolean cacheBlobToFalse(String cacheKey)

getMimetypeRegistry

protected MimetypeRegistry getMimetypeRegistry()
                                        throws Exception
Throws:
Exception

Nuxeo Enterprise Platform 5.3

Copyright © 2010 Nuxeo SAS. All Rights Reserved.