@Name(value="navigationContext") @Scope(value=CONVERSATION) @Install(precedence=10) public class NavigationContextBean extends Object implements NavigationContext, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected DocumentModel |
currentDocument |
protected DocumentModelList |
currentDocumentChildren |
protected List<DocumentModel> |
currentDocumentParents |
protected DocumentModel |
currentSuperSpace |
protected CoreSession |
documentManager |
| Constructor and Description |
|---|
NavigationContextBean() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkIfUpdateNeeded(DocumentModel ctxDoc,
DocumentModel newDoc) |
DocumentModel |
factoryChangeableDocument()
Gets current document for edition.
|
DocumentModel |
factoryCurrentContentRoot()
Gets the currentContentRootWorkspace and puts it in Page context.
|
DocumentModel |
factoryCurrentDocument()
Gets the currentDocument and puts it in Page context.
|
DocumentModel |
factoryCurrentDomain()
Gets the currentDomain and puts it in Page context.
|
RepositoryLocation |
factoryCurrentServerLocation()
Gets the current ServerLocation and puts it in Page Context.
|
DocumentModel |
factoryCurrentSuperSpace()
Gets the currentSuperSpace and puts it in Page context.
|
DocumentModel |
factoryCurrentWorkspace()
Gets the currentWorkspace and puts it in Page context.
|
String |
getActionResult(DocumentModel doc,
UserAction action)
Performs context updates and returns the view associated with the document and action passed.
|
DocumentModel |
getChangeableDocument()
This is used for documents about to be created, which are not yet persisted thus not all their fields might be
valid (like its reference).
|
DocumentModel |
getCurrentContentRoot()
Gets the current Content Root (Workspaces, Sections, Templates...).
|
DocumentModel |
getCurrentDocument()
Current Document other than Domain or Workspace.
|
String |
getCurrentDocumentFullUrl() |
String |
getCurrentDocumentUrl() |
DocumentModel |
getCurrentDomain()
Current Domain, if user has read permission on it.
|
String |
getCurrentDomainPath()
Finds the path to current domain.
|
DocumentModelList |
getCurrentPath()
Returns a list of the DocumentsModels (to build the BreadCrumb for example).
|
List<PathElement> |
getCurrentPathList() |
RepositoryLocation |
getCurrentServerLocation() |
DocumentModel |
getCurrentSuperSpace()
Returns the currentSuperSpace (Section, Workspace...).
|
DocumentModel |
getCurrentWorkspace()
Gets the current Workspace.
|
protected PathElement |
getDocumentPathElement(DocumentModel doc) |
CoreSession |
getOrCreateDocumentManager()
Returns the current documentManager if any or create a new session to the current location.
|
RepositoryLocation |
getSelectedServerLocation()
Deprecated.
use getCurrentServerLocation() instead
|
protected ServerContextBean |
getServerLocator() |
String |
goBack() |
String |
goHome()
go to the root server, the root document or to the dashboard if the latest document are not accessible.
|
void |
init()
Callback for component initialization.
|
void |
invalidateCurrentDocument()
Will trigger reloading of current document data from the server.
|
String |
navigateTo(RepositoryLocation serverLocation,
DocumentRef docRef)
Initializes the context for the given refs and returns the default view for the doc.
|
String |
navigateToDocument(DocumentModel doc)
Updates the context with given document and returns its default view.
|
String |
navigateToDocument(DocumentModel doc,
String viewId)
Initializes the context for the given doc and returns its given view.
|
String |
navigateToDocument(DocumentModel docModel,
VersionModel versionModel) |
String |
navigateToDocumentWithView(DocumentModel doc,
String viewId)
Initializes the context for the given doc and returns its given view.
|
String |
navigateToId(String documentId)
Updates the context and returns the view for the given document id.
|
String |
navigateToRef(DocumentRef docRef)
Updates the context and returns the view for the given document ref.
|
String |
navigateToURL()
Initializes the context for the given refs and returns the default view for the doc.
|
String |
navigateToURL(String documentUrl)
Initializes the context for the given refs and returns the default view for the doc.
|
void |
resetCurrentContext()
Resets all context variables.
|
protected void |
resetCurrentPath() |
void |
saveCurrentDocument()
Saves the current copy of the document to server.
|
void |
selectionChanged() |
void |
setChangeableDocument(DocumentModel changeableDocument) |
void |
setCurrentContentRoot(DocumentModel crDocumentModel)
Sets the current ContentRoot.
|
void |
setCurrentDocument(DocumentModel documentModel) |
void |
setCurrentDomain(DocumentModel domainDocModel) |
void |
setCurrentServerLocation(RepositoryLocation serverLocation)
Switches to a new server location by updating the context and updating to the CoreSession (DocumentManager).
|
void |
setCurrentWorkspace(DocumentModel workspaceDocModel) |
protected void |
updateContextVariables()
Updates variables according to hierarchy rules and to the new currentDocument.
|
void |
updateDocumentContext(DocumentModel doc)
Updates the current document in the (session) context and resets the other common structures (breadcrumbs, etc).
|
protected DocumentModel currentDocument
protected DocumentModel currentSuperSpace
protected DocumentModelList currentDocumentChildren
protected List<DocumentModel> currentDocumentParents
@In(create=true,
required=false)
protected transient CoreSession documentManager
public NavigationContextBean()
@Create public void init()
NavigationContextinit in interface NavigationContext@BypassInterceptors public DocumentModel getCurrentDocument()
NavigationContextgetCurrentDocument in interface NavigationContextpublic String getCurrentDomainPath()
NavigationContextThis method tries hard to always returns an answer: the path to current domain is deduced from the path of current document (assuming that it would be the first element of this path).
If current document is null, the same logic is applied to the first document found amongst all documents user has access to.
getCurrentDomainPath in interface NavigationContextpublic void setCurrentDocument(DocumentModel documentModel)
setCurrentDocument in interface NavigationContext@BypassInterceptors public DocumentModel getChangeableDocument()
NavigationContextgetChangeableDocument in interface NavigationContextpublic void setChangeableDocument(DocumentModel changeableDocument)
setChangeableDocument in interface NavigationContextpublic DocumentModelList getCurrentPath()
NavigationContextgetCurrentPath in interface NavigationContextpublic DocumentModel getCurrentSuperSpace()
NavigationContextgetCurrentSuperSpace in interface NavigationContextpublic void invalidateCurrentDocument()
NavigationContextinvalidateCurrentDocument in interface NavigationContext@BypassInterceptors public DocumentModel getCurrentDomain()
NavigationContextgetCurrentDomain in interface NavigationContextpublic void setCurrentDomain(DocumentModel domainDocModel)
setCurrentDomain in interface NavigationContextprotected boolean checkIfUpdateNeeded(DocumentModel ctxDoc, DocumentModel newDoc)
public void saveCurrentDocument()
NavigationContextsaveCurrentDocument in interface NavigationContextpublic List<PathElement> getCurrentPathList()
getCurrentPathList in interface NavigationContextprotected ServerContextBean getServerLocator()
public RepositoryLocation getCurrentServerLocation()
getCurrentServerLocation in interface NavigationContext@Deprecated public RepositoryLocation getSelectedServerLocation()
getSelectedServerLocation in interface NavigationContextpublic void setCurrentServerLocation(RepositoryLocation serverLocation)
setCurrentServerLocation in interface NavigationContextserverLocation - new server location to connect topublic CoreSession getOrCreateDocumentManager()
getOrCreateDocumentManager in interface NavigationContext@BypassInterceptors public DocumentModel getCurrentWorkspace()
NavigationContextgetCurrentWorkspace in interface NavigationContext@Factory(value="currentDocument",
scope=EVENT)
public DocumentModel factoryCurrentDocument()
NavigationContextfactoryCurrentDocument in interface NavigationContext@Factory(value="changeableDocument",
scope=EVENT)
public DocumentModel factoryChangeableDocument()
NavigationContextfactoryChangeableDocument in interface NavigationContext@Factory(value="currentDomain",
scope=EVENT)
public DocumentModel factoryCurrentDomain()
NavigationContextfactoryCurrentDomain in interface NavigationContext@Factory(value="currentWorkspace",
scope=EVENT)
public DocumentModel factoryCurrentWorkspace()
NavigationContextfactoryCurrentWorkspace in interface NavigationContext@Factory(value="currentContentRoot",
scope=EVENT)
public DocumentModel factoryCurrentContentRoot()
NavigationContextfactoryCurrentContentRoot in interface NavigationContextpublic RepositoryLocation factoryCurrentServerLocation()
NavigationContextfactoryCurrentServerLocation in interface NavigationContext@Factory(value="currentSuperSpace",
scope=EVENT)
public DocumentModel factoryCurrentSuperSpace()
NavigationContextfactoryCurrentSuperSpace in interface NavigationContextpublic void setCurrentWorkspace(DocumentModel workspaceDocModel)
public void updateDocumentContext(DocumentModel doc)
NavigationContextupdateDocumentContext in interface NavigationContextdoc - DocumentModel that will be set as current documentprotected void updateContextVariables()
public void resetCurrentContext()
NavigationContextresetCurrentContext in interface NavigationContextpublic String getActionResult(DocumentModel doc, UserAction action)
NavigationContextgetActionResult in interface NavigationContextpublic String goHome()
NavigationContextgoHome in interface NavigationContextpublic String goBack()
goBack in interface NavigationContextpublic String navigateToId(String documentId)
NavigationContextnavigateToId in interface NavigationContextpublic String navigateToRef(DocumentRef docRef)
NavigationContextnavigateToRef in interface NavigationContextpublic String navigateToDocument(DocumentModel doc)
NavigationContextThe default view is configured on the UI document type definition.
navigateToDocument in interface NavigationContextpublic String navigateToDocument(DocumentModel doc, String viewId)
NavigationContextIf view is not found, use default view.
navigateToDocument in interface NavigationContextviewId - for the document as defined in its typepublic String navigateToDocumentWithView(DocumentModel doc, String viewId)
NavigationContext
If view is not found, use default view set on the UI document type. This is an alias to
navigateToDocument(DocumentModel doc, String viewId), to resolve ambiguity when method is invoked by
an EL expression.
navigateToDocumentWithView in interface NavigationContextviewId - for the document as defined in its typepublic String navigateToDocument(DocumentModel docModel, VersionModel versionModel)
navigateToDocument in interface NavigationContextpublic void selectionChanged()
selectionChanged in interface NavigationContextpublic String getCurrentDocumentUrl()
getCurrentDocumentUrl in interface NavigationContextpublic String getCurrentDocumentFullUrl()
getCurrentDocumentFullUrl in interface NavigationContext@Begin(id="#{conversationIdGenerator.currentOrNewMainConversationId}",
join=true)
public String navigateTo(RepositoryLocation serverLocation,
DocumentRef docRef)
NavigationContextnavigateTo in interface NavigationContext@Begin(id="#{conversationIdGenerator.currentOrNewMainConversationId}",
join=true)
public String navigateToURL(String documentUrl)
NavigationContextnavigateToURL in interface NavigationContext@Begin(id="#{conversationIdGenerator.currentOrNewMainConversationId}",
join=true)
public String navigateToURL()
NavigationContextTakes parameter String docRef from the Request.
navigateToURL in interface NavigationContextNavigationContext.navigateToURL()protected void resetCurrentPath()
protected PathElement getDocumentPathElement(DocumentModel doc)
public DocumentModel getCurrentContentRoot()
NavigationContextgetCurrentContentRoot in interface NavigationContextpublic void setCurrentContentRoot(DocumentModel crDocumentModel)
NavigationContextsetCurrentContentRoot in interface NavigationContextCopyright © 2016 Nuxeo SA. All rights reserved.