Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.webapp.contentbrowser
Class DocumentActionsBean

java.lang.Object
  extended by org.nuxeo.ecm.webapp.base.InputController
      extended by org.nuxeo.ecm.webapp.contentbrowser.DocumentActionsBean
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, SelectDataModelListener, StatefulBaseLifeCycle, DocumentActions

@Name(value="documentActions")
@Scope(value=CONVERSATION)
public class DocumentActionsBean
extends InputController
implements DocumentActions, java.io.Serializable

Author:
Razvan Caraghin, M.-A. Darche
See Also:
Serialized Form

Field Summary
static java.lang.String DEFAULT_SUMMARY_LAYOUT
           
 
Fields inherited from interface org.nuxeo.ecm.webapp.contentbrowser.DocumentActions
CHILDREN_DOCUMENT_LIST
 
Constructor Summary
DocumentActionsBean()
           
 
Method Summary
 java.lang.String checkCurrentDocAndProcessSelectPage(java.lang.String providerName, java.lang.String listName, java.lang.Boolean selection, java.lang.String currentDocRef)
          Handle complete table selection event after having ensured that the navigation context stills points to currentDocumentRef to protect against browsers' back button errors
 java.lang.String checkCurrentDocAndProcessSelectRow(java.lang.String docRef, java.lang.String providerName, java.lang.String listName, java.lang.Boolean selection, java.lang.String currentDocRef)
          Handle row selection event after having ensured that the navigation context stills points to currentDocumentRef to protect against browsers' back button errors
 java.lang.String createDocument()
          Returns the create view of a document type.
 java.lang.String createDocument(java.lang.String typeName)
          Returns the create view of given document type.
 void destroy()
           
 java.lang.String download()
           
 void download(DocumentView docView)
          Downloads file as described by given document view.
 java.lang.String downloadFromList()
           
 java.lang.String editDocument()
          Returns the edit view of a document.
 boolean getCanUnpublish()
          This method is used to test wheter the looged user has enough rights for the unpublish support.
 Type getChangeableDocumentType()
           
 SelectDataModel getChildrenSelectModel()
           
 java.lang.String getComment()
           
 java.lang.String getCurrentDocumentSummaryLayout()
           
 Type getCurrentType()
           
 java.lang.String getFileName(DocumentModel doc)
           
 SelectDataModel getSectionChildrenSelectModel()
           
 boolean getWriteRight()
          Checks the current document write permission.
 void initialize()
           
 java.lang.String processSelectPage(java.lang.String providerName, java.lang.String listName, java.lang.Boolean selection)
           
 java.lang.String processSelectRow(java.lang.String docRef, java.lang.String providerName, java.lang.String listName, java.lang.Boolean selection)
           
 void processSelectRowEvent(SelectDataModelRowEvent event)
           
 void readState()
          Activate method.
 java.lang.String saveDocument()
          Badly named method that actually creates a document.
 java.lang.String saveDocument(DocumentModel newDocument)
           
 void saveState()
          Passivate method.
 void setComment(java.lang.String comment)
           
 java.lang.String updateCurrentDocument()
          Deprecated. should update changeableDocument and use updateDocument
 java.lang.String updateDocument()
          Saves changes hold by the changeableDocument document model.
 java.lang.String updateDocumentAsNewVersion()
          Saves changes in current version and then create a new current one.
 
Methods inherited from class org.nuxeo.ecm.webapp.base.InputController
computeOutcome, getAdministrator, logDocumentWithName, logDocumentWithTitle, removeDocumentFromList
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SUMMARY_LAYOUT

public static java.lang.String DEFAULT_SUMMARY_LAYOUT
Constructor Detail

DocumentActionsBean

public DocumentActionsBean()
Method Detail

initialize

public void initialize()
Specified by:
initialize in interface DocumentActions

destroy

@Destroy
public void destroy()
Specified by:
destroy in interface DocumentActions

saveState

public void saveState()
Description copied from interface: StatefulBaseLifeCycle
Passivate method.

Specified by:
saveState in interface StatefulBaseLifeCycle

readState

public void readState()
Description copied from interface: StatefulBaseLifeCycle
Activate method.

Specified by:
readState in interface StatefulBaseLifeCycle

getCurrentDocumentSummaryLayout

@Factory(autoCreate=true,
         value="currentDocumentSummaryLayout",
         scope=EVENT)
public java.lang.String getCurrentDocumentSummaryLayout()

getCurrentType

@Factory(autoCreate=true,
         value="currentDocumentType",
         scope=EVENT)
public Type getCurrentType()
Specified by:
getCurrentType in interface DocumentActions
Returns:
ecm type for current document, null if current doc is null.

getChangeableDocumentType

public Type getChangeableDocumentType()
Specified by:
getChangeableDocumentType in interface DocumentActions

editDocument

public java.lang.String editDocument()
                              throws ClientException
Returns the edit view of a document.

Specified by:
editDocument in interface DocumentActions
Throws:
ClientException

getFileName

public java.lang.String getFileName(DocumentModel doc)
                             throws ClientException
Throws:
ClientException

download

public java.lang.String download()
                          throws ClientException
Specified by:
download in interface DocumentActions
Throws:
ClientException

download

public void download(DocumentView docView)
              throws ClientException
Description copied from interface: DocumentActions
Downloads file as described by given document view.

To be used by url pattern descriptors performing a download.

Specified by:
download in interface DocumentActions
Parameters:
docView - the document view as generated through the url service
Throws:
ClientException - when document is not found or file is not retrieved correctly.

downloadFromList

public java.lang.String downloadFromList()
                                  throws ClientException
Specified by:
downloadFromList in interface DocumentActions
Throws:
ClientException

updateCurrentDocument

@Deprecated
public java.lang.String updateCurrentDocument()
                                       throws ClientException
Deprecated. should update changeableDocument and use updateDocument

Updates document considering that current document model holds edited values.

Method called from page action.

Specified by:
updateCurrentDocument in interface DocumentActions
Throws:
ClientException

updateDocument

public java.lang.String updateDocument()
                                throws ClientException
Saves changes hold by the changeableDocument document model.

Specified by:
updateDocument in interface DocumentActions
Throws:
ClientException

updateDocumentAsNewVersion

public java.lang.String updateDocumentAsNewVersion()
                                            throws ClientException
Saves changes in current version and then create a new current one.

Specified by:
updateDocumentAsNewVersion in interface DocumentActions
Throws:
ClientException

createDocument

public java.lang.String createDocument()
                                throws ClientException
Returns the create view of a document type.

Specified by:
createDocument in interface DocumentActions
Throws:
ClientException

createDocument

public java.lang.String createDocument(java.lang.String typeName)
                                throws ClientException
Returns the create view of given document type.

Specified by:
createDocument in interface DocumentActions
Throws:
ClientException

saveDocument

public java.lang.String saveDocument()
                              throws ClientException
Badly named method that actually creates a document.

Specified by:
saveDocument in interface DocumentActions
Throws:
ClientException

saveDocument

public java.lang.String saveDocument(DocumentModel newDocument)
                              throws ClientException
Specified by:
saveDocument in interface DocumentActions
Throws:
ClientException

getChildrenSelectModel

@Factory(value="currentChildrenSelectModel",
         scope=EVENT)
public SelectDataModel getChildrenSelectModel()
                                       throws ClientException
Specified by:
getChildrenSelectModel in interface DocumentActions
Throws:
ClientException

getSectionChildrenSelectModel

public SelectDataModel getSectionChildrenSelectModel()
                                              throws ClientException
Specified by:
getSectionChildrenSelectModel in interface DocumentActions
Throws:
ClientException

processSelectRowEvent

public void processSelectRowEvent(SelectDataModelRowEvent event)
Specified by:
processSelectRowEvent in interface SelectDataModelListener

checkCurrentDocAndProcessSelectRow

@WebRemote
public java.lang.String checkCurrentDocAndProcessSelectRow(java.lang.String docRef,
                                                                     java.lang.String providerName,
                                                                     java.lang.String listName,
                                                                     java.lang.Boolean selection,
                                                                     java.lang.String currentDocRef)
                                                    throws ClientException
Handle row selection event after having ensured that the navigation context stills points to currentDocumentRef to protect against browsers' back button errors

Specified by:
checkCurrentDocAndProcessSelectRow in interface DocumentActions
Throws:
ClientException - if currentDocRef is not a valid document

processSelectRow

@WebRemote
public java.lang.String processSelectRow(java.lang.String docRef,
                                                   java.lang.String providerName,
                                                   java.lang.String listName,
                                                   java.lang.Boolean selection)
Specified by:
processSelectRow in interface DocumentActions

checkCurrentDocAndProcessSelectPage

@WebRemote
public java.lang.String checkCurrentDocAndProcessSelectPage(java.lang.String providerName,
                                                                      java.lang.String listName,
                                                                      java.lang.Boolean selection,
                                                                      java.lang.String currentDocRef)
                                                     throws ClientException
Handle complete table selection event after having ensured that the navigation context stills points to currentDocumentRef to protect against browsers' back button errors

Specified by:
checkCurrentDocAndProcessSelectPage in interface DocumentActions
Throws:
ClientException - if currentDocRef is not a valid document

processSelectPage

@WebRemote
public java.lang.String processSelectPage(java.lang.String providerName,
                                                    java.lang.String listName,
                                                    java.lang.Boolean selection)
Specified by:
processSelectPage in interface DocumentActions

getWriteRight

public boolean getWriteRight()
                      throws ClientException
Description copied from interface: DocumentActions
Checks the current document write permission.

Specified by:
getWriteRight in interface DocumentActions
Returns:
true if the user has WRITE permission on current document
Throws:
ClientException

getComment

public java.lang.String getComment()
Specified by:
getComment in interface DocumentActions

setComment

public void setComment(java.lang.String comment)
Specified by:
setComment in interface DocumentActions

getCanUnpublish

public boolean getCanUnpublish()
Description copied from interface: DocumentActions
This method is used to test wheter the looged user has enough rights for the unpublish support.

Specified by:
getCanUnpublish in interface DocumentActions
Returns:
- true if the user can unpublish

- false otherwise


Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.