Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.webapp.clipboard
Class ClipboardActionsBean

java.lang.Object
  extended by org.nuxeo.ecm.webapp.base.InputController
      extended by org.nuxeo.ecm.webapp.clipboard.ClipboardActionsBean
All Implemented Interfaces:
Serializable, ClipboardActions

@Name(value="clipboardActions")
@Scope(value=SESSION)
public class ClipboardActionsBean
extends InputController
implements ClipboardActions, Serializable

This is the action listener behind the copy/paste template that knows how to copy/paste the selected user data to the target action listener, and also create/remove the corresponding objects into the backend.

Author:
Razvan Caraghin
See Also:
Serialized Form

Field Summary
static String DELETED_LIFECYCLE_STATE
          Deprecated. use LifeCycleConstants.DELETED_STATE
 
Constructor Summary
ClipboardActionsBean()
           
 
Method Summary
 String clearWorkingList()
          Called when the "delete all" button is clicked on the clipboard.
 void copySelection(List<DocumentModel> copiedDocs)
          Deprecated. 
 String exportAllBlobsFromWorkingListAsZip()
           
 String exportMainBlobFromWorkingListAsZip()
           
 String exportWorklistAsZip()
           
 String exportWorklistAsZip(DocumentModel document)
           
 String exportWorklistAsZip(List<DocumentModel> documents)
           
 String exportWorklistAsZip(List<DocumentModel> documents, boolean exportAllBlobs)
           
 boolean factoryForIsCurrentWorkListEmpty()
           
 List<Action> getActionsForCurrentList()
          Returns the list of available web actions for the currently selected DocumentList.
 List<Action> getActionsForSelection()
          Returns the list of available web actions for the currently selected Documents.
 List<String> getAvailableLists()
          Returns the list of available lists (ie: the lists from the CLIPBOARD Category).
 String getCacheKey()
           
 boolean getCanCopy()
          Checks if copy action is available in the context of the current Document.
 boolean getCanEditListDocs(String listName)
          Deprecated. 
 boolean getCanEditSelectedDocs()
          Checks for documents bulk editing action.
 boolean getCanMove(String listName)
          Checks if the Move action is available in the context of the current Document.
 boolean getCanMoveFromClipboardInside(DocumentModel document)
          Checks if the documents from the clipboard can be moved into the given document
 boolean getCanMoveInside(String listName, DocumentModel document)
          Checks if the Move action is available in the context of the document document.
 boolean getCanMoveWorkingList()
          Checks if there are documents in current worklist can be moved into the current folder.
 boolean getCanPaste(String listName)
          Checks if the Paste action is available in the context of the current Document.
 boolean getCanPasteFromClipboard()
          Shortcut for getCanPaste on the clipboard.
 boolean getCanPasteFromClipboardInside(DocumentModel document)
           
 boolean getCanPasteInside(String listName, DocumentModel document)
           
 boolean getCanPasteWorkList()
          Shortcut for getCanPaste on the currently selected workList.
 List<DocumentModel> getCurrentSelectedList()
          Retries contents of current WorkList.
 String getCurrentSelectedListName()
          Returns the name of the current selected WorkList.
 String getCurrentSelectedListTitle()
           
 List<DocumentsListDescriptor> getDescriptorsForAvailableLists()
          Returns the list of Descriptors for available lists.
 boolean isCacheEnabled()
           
 boolean isCacheEnabledForSelection()
           
 boolean isInitialized()
           
 boolean isWorkListEmpty()
          Checks if the currently selected WorkList is empty.
 String moveClipboardInside(String docId)
           
 String moveDocumentList(String listName)
           
 String moveDocumentList(String listName, String docId)
           
 List<DocumentModel> moveDocumentsToNewParent(DocumentModel destFolder, List<DocumentModel> docs)
           
 String moveWorkingList()
          Called when the "move all" button is clicked on the clipboard/selection
 String pasteClipboard()
           
 String pasteClipboardInside(String docId)
           
 String pasteDocumentList(List<DocumentModel> docPaste)
          Called when the drag and drop is launched in the body fragment.
 String pasteDocumentList(String listName)
          Pastes the content of the list listName into the current context document.
 String pasteDocumentListInside(List<DocumentModel> docPaste, String docId)
           
 String pasteDocumentListInside(String listName, String docId)
           
 String pasteWorkingList()
          Called when the "paste all" button is clicked on the clipboard.
 void putInClipboard(String docId)
           
 void putSelectionInClipboard()
           
 void putSelectionInDefaultWorkList()
           
 void putSelectionInWorkList()
          Copies the lists of selected documents into the current WorkList.
 void putSelectionInWorkList(Boolean forceAppend)
           
 void putSelectionInWorkList(List<DocumentModel> docsList)
          Copies docsList into the current WorkList.
 void putSelectionInWorkList(List<DocumentModel> docsList, Boolean forceAppend)
           
 void releaseClipboardableDocuments()
           
 String removeWorkListItem(DocumentRef ref)
          Called when the delete button is clicked on the clipboard.
 void selectList()
           
 void setCurrentSelectedList(String listId)
          Sets the current selected WorkList.
 
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

DELETED_LIFECYCLE_STATE

@Deprecated
public static final String DELETED_LIFECYCLE_STATE
Deprecated. use LifeCycleConstants.DELETED_STATE
See Also:
Constant Field Values
Constructor Detail

ClipboardActionsBean

public ClipboardActionsBean()
Method Detail

releaseClipboardableDocuments

public void releaseClipboardableDocuments()
Specified by:
releaseClipboardableDocuments in interface ClipboardActions

isInitialized

public boolean isInitialized()
Specified by:
isInitialized in interface ClipboardActions

putSelectionInWorkList

public void putSelectionInWorkList(Boolean forceAppend)
Specified by:
putSelectionInWorkList in interface ClipboardActions

putSelectionInWorkList

public void putSelectionInWorkList()
Description copied from interface: ClipboardActions
Copies the lists of selected documents into the current WorkList.

Specified by:
putSelectionInWorkList in interface ClipboardActions

putSelectionInDefaultWorkList

public void putSelectionInDefaultWorkList()
Specified by:
putSelectionInDefaultWorkList in interface ClipboardActions

putInClipboard

@WebRemote
public void putInClipboard(String docId)
                    throws ClientException
Specified by:
putInClipboard in interface ClipboardActions
Throws:
ClientException

putSelectionInClipboard

public void putSelectionInClipboard()
Specified by:
putSelectionInClipboard in interface ClipboardActions

putSelectionInWorkList

public void putSelectionInWorkList(List<DocumentModel> docsList)
Description copied from interface: ClipboardActions
Copies docsList into the current WorkList.

Specified by:
putSelectionInWorkList in interface ClipboardActions

putSelectionInWorkList

public void putSelectionInWorkList(List<DocumentModel> docsList,
                                   Boolean forceAppend)
Specified by:
putSelectionInWorkList in interface ClipboardActions

copySelection

@Deprecated
public void copySelection(List<DocumentModel> copiedDocs)
Deprecated. 

Description copied from interface: ClipboardActions
Called when the drag and drop is launched in the clipboard fragment. Copies the documents passed to the clipboard.

The selection is added to the clipboard and to the WorkingList.

Specified by:
copySelection in interface ClipboardActions
Parameters:
copiedDocs - the list of documents we want to copy

removeWorkListItem

public String removeWorkListItem(DocumentRef ref)
                          throws ClientException
Description copied from interface: ClipboardActions
Called when the delete button is clicked on the clipboard.

Specified by:
removeWorkListItem in interface ClipboardActions
Throws:
ClientException

clearWorkingList

public String clearWorkingList()
Description copied from interface: ClipboardActions
Called when the "delete all" button is clicked on the clipboard.

Specified by:
clearWorkingList in interface ClipboardActions

pasteDocumentList

public String pasteDocumentList(String listName)
                         throws ClientException
Description copied from interface: ClipboardActions
Pastes the content of the list listName into the current context document.

Specified by:
pasteDocumentList in interface ClipboardActions
Throws:
ClientException

pasteDocumentListInside

public String pasteDocumentListInside(String listName,
                                      String docId)
                               throws ClientException
Specified by:
pasteDocumentListInside in interface ClipboardActions
Throws:
ClientException

pasteDocumentList

public String pasteDocumentList(List<DocumentModel> docPaste)
                         throws ClientException
Description copied from interface: ClipboardActions
Called when the drag and drop is launched in the body fragment. Pastes the documents passed to the clipboard.

Specified by:
pasteDocumentList in interface ClipboardActions
Parameters:
docPaste - the list of doc we want to paste
Throws:
ClientException

pasteDocumentListInside

public String pasteDocumentListInside(List<DocumentModel> docPaste,
                                      String docId)
                               throws ClientException
Specified by:
pasteDocumentListInside in interface ClipboardActions
Throws:
ClientException

moveDocumentsToNewParent

public List<DocumentModel> moveDocumentsToNewParent(DocumentModel destFolder,
                                                    List<DocumentModel> docs)
                                             throws ClientException
Throws:
ClientException

moveDocumentList

public String moveDocumentList(String listName,
                               String docId)
                        throws ClientException
Throws:
ClientException

moveDocumentList

public String moveDocumentList(String listName)
                        throws ClientException
Throws:
ClientException

moveWorkingList

public String moveWorkingList()
Description copied from interface: ClipboardActions
Called when the "move all" button is clicked on the clipboard/selection

Specified by:
moveWorkingList in interface ClipboardActions

pasteWorkingList

public String pasteWorkingList()
Description copied from interface: ClipboardActions
Called when the "paste all" button is clicked on the clipboard.

Specified by:
pasteWorkingList in interface ClipboardActions

pasteClipboard

public String pasteClipboard()
Specified by:
pasteClipboard in interface ClipboardActions

pasteClipboardInside

@WebRemote
public String pasteClipboardInside(String docId)
                            throws ClientException
Specified by:
pasteClipboardInside in interface ClipboardActions
Throws:
ClientException

moveClipboardInside

@WebRemote
public String moveClipboardInside(String docId)
                           throws ClientException
Specified by:
moveClipboardInside in interface ClipboardActions
Throws:
ClientException

factoryForIsCurrentWorkListEmpty

@Factory(value="isCurrentWorkListEmpty",
         scope=EVENT)
public boolean factoryForIsCurrentWorkListEmpty()
Specified by:
factoryForIsCurrentWorkListEmpty in interface ClipboardActions

isWorkListEmpty

public boolean isWorkListEmpty()
Description copied from interface: ClipboardActions
Checks if the currently selected WorkList is empty.

Specified by:
isWorkListEmpty in interface ClipboardActions

exportWorklistAsZip

public String exportWorklistAsZip()
                           throws ClientException
Specified by:
exportWorklistAsZip in interface ClipboardActions
Throws:
ClientException

exportAllBlobsFromWorkingListAsZip

public String exportAllBlobsFromWorkingListAsZip()
                                          throws ClientException
Specified by:
exportAllBlobsFromWorkingListAsZip in interface ClipboardActions
Throws:
ClientException

exportMainBlobFromWorkingListAsZip

public String exportMainBlobFromWorkingListAsZip()
                                          throws ClientException
Specified by:
exportMainBlobFromWorkingListAsZip in interface ClipboardActions
Throws:
ClientException

exportWorklistAsZip

public String exportWorklistAsZip(List<DocumentModel> documents)
                           throws ClientException
Specified by:
exportWorklistAsZip in interface ClipboardActions
Throws:
ClientException

exportWorklistAsZip

public String exportWorklistAsZip(DocumentModel document)
                           throws ClientException
Throws:
ClientException

getCanCopy

public boolean getCanCopy()
Checks if copy action is available in the context of the current Document.

Condition: the list of selected documents is not empty.

Specified by:
getCanCopy in interface ClipboardActions

getCanPaste

public boolean getCanPaste(String listName)
                    throws ClientException
Checks if the Paste action is available in the context of the current Document. Conditions:

Specified by:
getCanPaste in interface ClipboardActions
Throws:
ClientException

getCanPasteInside

public boolean getCanPasteInside(String listName,
                                 DocumentModel document)
                          throws ClientException
Specified by:
getCanPasteInside in interface ClipboardActions
Throws:
ClientException

getCanMoveInside

public boolean getCanMoveInside(String listName,
                                DocumentModel document)
                         throws ClientException
Checks if the Move action is available in the context of the document document. Conditions:

Specified by:
getCanMoveInside in interface ClipboardActions
Throws:
ClientException

getCanMove

public boolean getCanMove(String listName)
                   throws ClientException
Checks if the Move action is available in the context of the current Document. Conditions:

Throws:
ClientException

getCanPasteWorkList

public boolean getCanPasteWorkList()
                            throws ClientException
Description copied from interface: ClipboardActions
Shortcut for getCanPaste on the currently selected workList.

Specified by:
getCanPasteWorkList in interface ClipboardActions
Throws:
ClientException

getCanMoveWorkingList

public boolean getCanMoveWorkingList()
                              throws ClientException
Description copied from interface: ClipboardActions
Checks if there are documents in current worklist can be moved into the current folder.

Specified by:
getCanMoveWorkingList in interface ClipboardActions
Throws:
ClientException

getCanPasteFromClipboard

public boolean getCanPasteFromClipboard()
                                 throws ClientException
Description copied from interface: ClipboardActions
Shortcut for getCanPaste on the clipboard.

Specified by:
getCanPasteFromClipboard in interface ClipboardActions
Throws:
ClientException

getCanPasteFromClipboardInside

public boolean getCanPasteFromClipboardInside(DocumentModel document)
                                       throws ClientException
Specified by:
getCanPasteFromClipboardInside in interface ClipboardActions
Throws:
ClientException

getCanMoveFromClipboardInside

public boolean getCanMoveFromClipboardInside(DocumentModel document)
                                      throws ClientException
Description copied from interface: ClipboardActions
Checks if the documents from the clipboard can be moved into the given document

Specified by:
getCanMoveFromClipboardInside in interface ClipboardActions
Throws:
ClientException

setCurrentSelectedList

public void setCurrentSelectedList(String listId)
Description copied from interface: ClipboardActions
Sets the current selected WorkList.

Specified by:
setCurrentSelectedList in interface ClipboardActions

selectList

public void selectList()
Specified by:
selectList in interface ClipboardActions

getCurrentSelectedList

public List<DocumentModel> getCurrentSelectedList()
Description copied from interface: ClipboardActions
Retries contents of current WorkList.

Specified by:
getCurrentSelectedList in interface ClipboardActions

getCurrentSelectedListName

public String getCurrentSelectedListName()
Description copied from interface: ClipboardActions
Returns the name of the current selected WorkList.

Specified by:
getCurrentSelectedListName in interface ClipboardActions

getCurrentSelectedListTitle

public String getCurrentSelectedListTitle()
Specified by:
getCurrentSelectedListTitle in interface ClipboardActions

getAvailableLists

public List<String> getAvailableLists()
Description copied from interface: ClipboardActions
Returns the list of available lists (ie: the lists from the CLIPBOARD Category).

Specified by:
getAvailableLists in interface ClipboardActions

getDescriptorsForAvailableLists

public List<DocumentsListDescriptor> getDescriptorsForAvailableLists()
Description copied from interface: ClipboardActions
Returns the list of Descriptors for available lists.

Specified by:
getDescriptorsForAvailableLists in interface ClipboardActions

getActionsForCurrentList

public List<Action> getActionsForCurrentList()
Description copied from interface: ClipboardActions
Returns the list of available web actions for the currently selected DocumentList.

Specified by:
getActionsForCurrentList in interface ClipboardActions
Returns:
the WebAction list

getActionsForSelection

public List<Action> getActionsForSelection()
Description copied from interface: ClipboardActions
Returns the list of available web actions for the currently selected Documents.

Specified by:
getActionsForSelection in interface ClipboardActions
Returns:
the WebAction list

getCanEditSelectedDocs

public boolean getCanEditSelectedDocs()
                               throws ClientException
Description copied from interface: ClipboardActions
Checks for documents bulk editing action.

Specified by:
getCanEditSelectedDocs in interface ClipboardActions
Returns:
true if the current selected docs (from clipboard) are editable by the current user
Throws:
ClientException

getCanEditListDocs

@Deprecated
public boolean getCanEditListDocs(String listName)
                           throws ClientException
Deprecated. 

Description copied from interface: ClipboardActions
Checks if documents in the specified list are editable so the bulk editing action can be invoked later.

Specified by:
getCanEditListDocs in interface ClipboardActions
Returns:
true if the docs from the specified working list are editable by the current user
Throws:
ClientException

isCacheEnabled

public boolean isCacheEnabled()
Specified by:
isCacheEnabled in interface ClipboardActions

getCacheKey

public String getCacheKey()
Specified by:
getCacheKey in interface ClipboardActions

isCacheEnabledForSelection

public boolean isCacheEnabledForSelection()
Specified by:
isCacheEnabledForSelection in interface ClipboardActions

exportWorklistAsZip

public String exportWorklistAsZip(List<DocumentModel> documents,
                                  boolean exportAllBlobs)
                           throws ClientException
Specified by:
exportWorklistAsZip in interface ClipboardActions
Throws:
ClientException

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.