@Name(value="breadcrumbActions") @Scope(value=CONVERSATION) @Install(precedence=10) public class BreadcrumbActionsBean extends Object implements BreadcrumbActions, Serializable
Algorithm for rebuilding the path:
d1 -> d2 -> d3 -> d4
A new document is selected, which is a child of d2, named d2.5. We need to add d2.5 to the list after all unneeded documents have been removed to the list. In the end the list should look like this: d1 -> d2 -> d2.5. We need to remove all the documents in the list after d2, and add d2.5 to the list. TODO: fix bug when selecting an item located on a different branch than the current one so that its parent is not found in the current branch
Modifier and Type | Field and Description |
---|---|
static String |
BREADCRUMB_USER_DOMAINS_PROVIDER |
Constructor and Description |
---|
BreadcrumbActionsBean() |
Modifier and Type | Method and Description |
---|---|
List<PathElement> |
getBackendPath()
Computes the current path by making calls to backend.
|
List<DocumentModel> |
getUserDomains() |
boolean |
isNavigationBreadcrumb() |
boolean |
isUserDomain(DocumentModel doc) |
String |
navigateToParent() |
void |
resetUserDomains() |
public static final String BREADCRUMB_USER_DOMAINS_PROVIDER
public String navigateToParent() throws ClientException
navigateToParent
in interface BreadcrumbActions
ClientException
@Factory(value="backendPath", scope=EVENT) public List<PathElement> getBackendPath() throws ClientException
GR: removed the Factory annotation because it made the method be called too early in case of processing that involves changing the current document. Multiple invocation of this method is anyway very cheap.
getBackendPath
in interface BreadcrumbActions
ClientException
@Factory(value="isNavigationBreadcrumb", scope=EVENT) public boolean isNavigationBreadcrumb()
public List<DocumentModel> getUserDomains()
public boolean isUserDomain(DocumentModel doc)
@Observer(value={"locationSelectionChanged","documentChildrenChanged","documentChanged"}) public void resetUserDomains()
Copyright © 2015 Nuxeo SA. All rights reserved.