@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 |
---|---|
protected static String |
BREADCRUMB_PREFIX
View id description prefix for message label (followed by "=").
|
static String |
BREADCRUMB_USER_DOMAINS_PROVIDER |
protected CoreSession |
documentManager |
protected NavigationContext |
navigationContext |
protected ResourcesAccessor |
resourcesAccessor |
protected List<DocumentModel> |
userDomains |
Constructor and Description |
---|
BreadcrumbActionsBean() |
Modifier and Type | Method and Description |
---|---|
List<PathElement> |
getBackendPath()
Computes the current path by making calls to backend.
|
protected int |
getMaxPathCharLen()
Maximum length path that can be displayed without shrinking.
|
protected int |
getMinPathSegmentsLen()
Minimum path segments that must be displayed without shrinking.
|
protected String |
getPathEllipsis() |
List<DocumentModel> |
getUserDomains() |
protected String |
getViewDomainsOutcome() |
boolean |
isNavigationBreadcrumb() |
boolean |
isUserDomain(DocumentModel doc) |
protected List<PathElement> |
makeBackendPathFromLabel(String label) |
String |
navigateToParent() |
protected String |
navigateToPathElement(PathElement pathElement) |
void |
resetUserDomains() |
protected List<PathElement> |
shrinkPathIfNeeded(List<PathElement> paths) |
public static final String BREADCRUMB_USER_DOMAINS_PROVIDER
@In(create=true) protected NavigationContext navigationContext
@In(create=true, required=false) protected CoreSession documentManager
@In(create=true) protected ResourcesAccessor resourcesAccessor
protected List<DocumentModel> userDomains
protected static final String BREADCRUMB_PREFIX
public BreadcrumbActionsBean()
protected int getMinPathSegmentsLen()
protected int getMaxPathCharLen()
protected String getPathEllipsis()
protected String getViewDomainsOutcome()
public String navigateToParent()
navigateToParent
in interface BreadcrumbActions
protected String navigateToPathElement(PathElement pathElement)
@Factory(value="backendPath", scope=EVENT) public List<PathElement> getBackendPath()
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
@Factory(value="isNavigationBreadcrumb", scope=EVENT) public boolean isNavigationBreadcrumb()
protected List<PathElement> shrinkPathIfNeeded(List<PathElement> paths)
protected List<PathElement> makeBackendPathFromLabel(String label)
public List<DocumentModel> getUserDomains()
public boolean isUserDomain(DocumentModel doc)
@Observer(value={"locationSelectionChanged","documentChildrenChanged","documentChanged"}) public void resetUserDomains()
Copyright © 2016 Nuxeo SA. All rights reserved.