@Name(value="documentActions") @Scope(value=CONVERSATION) public class DocumentActionsBean extends InputController implements DocumentActions, Serializable
Modifier and Type | Field and Description |
---|---|
protected ActionContextProvider |
actionContextProvider |
static String |
BLOB_ACTIONS_CATEGORY |
protected String |
comment |
protected DeleteActions |
deleteActions |
protected CoreSession |
documentManager |
protected DocumentsListsManager |
documentsListsManager |
protected String |
fileFieldFullName |
protected String |
filename |
protected String |
filenameFieldFullName |
static String |
LIFE_CYCLE_TRANSITION_KEY |
protected Map<String,String> |
messages |
protected NavigationContext |
navigationContext |
protected String |
parentDocumentPath |
protected Boolean |
restoreCurrentTabs
Boolean request parameter used to restore current tabs (current tab and subtab) after edition.
|
protected WebActions |
webActions |
actionManager, currentDocument, currentUser, eventManager, facesMessages, resourcesAccessor, typeManager, typesTool
CHILDREN_DOCUMENT_LIST
Constructor and Description |
---|
DocumentActionsBean() |
Modifier and Type | Method and Description |
---|---|
String |
createDocument()
Creates a document with type given by
TypesTool and stores it in the context as the current changeable
document. |
String |
createDocument(String typeName)
Creates a document with given type and stores it in the context as the current changeable document.
|
void |
download(DocumentView docView)
Downloads file as described by given document view.
|
void |
followTransition(DocumentModel changedDocument) |
List<AppLink> |
getAppLinks(String docId,
String blobXPath) |
List<Action> |
getBlobActions(DocumentModel doc,
String blobXPath,
Blob blob) |
boolean |
getCanUnpublish()
This method is used to test whether the logged user has enough rights for the unpublish support.
|
boolean |
getCanUpdateMainBlob()
Checks if the main blob can be updated by a user-initiated action.
|
Type |
getChangeableDocumentType() |
Type |
getCurrentType() |
String |
getFileName(DocumentModel doc) |
boolean |
getWriteRight()
Checks the current document write permission.
|
String |
saveDocument()
Creates the document from the changeableDocument put in request.
|
String |
saveDocument(DocumentModel newDocument)
Creates the given document.
|
String |
updateCurrentDocument()
Updates document considering that current document model holds edited values.
|
protected String |
updateDocument(DocumentModel doc) |
String |
updateDocument(DocumentModel doc,
Boolean restoreCurrentTabs)
Saves changes held by the given document, and updates the current document context with the new version.
|
computeOutcome, extractReferences, getAdministrator, logDocumentWithName, logDocumentWithTitle, removeDocumentFromList, setFacesMessage
public static final String LIFE_CYCLE_TRANSITION_KEY
public static final String BLOB_ACTIONS_CATEGORY
@In(create=true) protected transient NavigationContext navigationContext
@RequestParameter protected String fileFieldFullName
@RequestParameter protected String filenameFieldFullName
@In(create=true, required=false) protected transient CoreSession documentManager
@In(required=false, create=true) protected transient DocumentsListsManager documentsListsManager
@In(create=true) protected transient DeleteActions deleteActions
@In(create=true, required=false) protected transient ActionContextProvider actionContextProvider
@RequestParameter protected Boolean restoreCurrentTabs
This is useful when editing the document from a layout toggled to edit mode from summary-like page.
@In(create=true) protected transient WebActions webActions
@RequestParameter protected String parentDocumentPath
public DocumentActionsBean()
@Factory(autoCreate=true, value="currentDocumentType", scope=EVENT) public Type getCurrentType()
getCurrentType
in interface DocumentActions
null
if current doc is null.public Type getChangeableDocumentType()
getChangeableDocumentType
in interface DocumentActions
public String getFileName(DocumentModel doc)
public void download(DocumentView docView)
DocumentActions
To be used by url pattern descriptors performing a download.
download
in interface DocumentActions
docView
- the document view as generated through the url servicepublic String updateDocument(DocumentModel doc, Boolean restoreCurrentTabs)
DocumentActions
Makes it possible to specify whether current tabs should be restored or not after edition.
updateDocument
in interface DocumentActions
protected String updateDocument(DocumentModel doc)
public String updateCurrentDocument()
DocumentActions
updateCurrentDocument
in interface DocumentActions
public String createDocument()
DocumentActions
TypesTool
and stores it in the context as the current changeable
document.
Returns the create view of given document type.
createDocument
in interface DocumentActions
public String createDocument(String typeName)
DocumentActions
Returns the create view of given document type.
createDocument
in interface DocumentActions
public String saveDocument()
DocumentActions
saveDocument
in interface DocumentActions
public String saveDocument(DocumentModel newDocument)
DocumentActions
saveDocument
in interface DocumentActions
public boolean getWriteRight()
DocumentActions
getWriteRight
in interface DocumentActions
true
if the user has WRITE permission on current documentpublic boolean getCanUnpublish()
DocumentActions
getCanUnpublish
in interface DocumentActions
@Observer(value="beforeDocumentChanged") public void followTransition(DocumentModel changedDocument)
followTransition
in interface DocumentActions
public List<Action> getBlobActions(DocumentModel doc, String blobXPath, Blob blob)
@WebRemote public List<AppLink> getAppLinks(String docId, String blobXPath)
public boolean getCanUpdateMainBlob()
Copyright © 2018 Nuxeo. All rights reserved.