protected String getUserWorkspacePath() { String currentDocumentPath = getCurrentDocumentPath(); if (StringUtils.isBlank(currentPersonalWorkspacePath)) { reset(); return currentDocumentPath; } if (userWorkspacePath == null || !userWorkspacePath.contains(currentPersonalWorkspacePath)) { // navigate to another personal workspace reset(); return documentManager.exists(new PathRef(currentPersonalWorkspacePath)) ? currentPersonalWorkspacePath : findFarthestContainerPath(currentDocumentPath); } return userWorkspacePath; }
protected List<DocumentTreeNode> getTreeRoots(boolean showRoot, DocumentModel currentDocument) { return getTreeRoots(showRoot, currentDocument, DEFAULT_TREE_PLUGIN_NAME); }
@Observer(value = { EventNames.GO_PERSONAL_WORKSPACE }, create = true) public void switchToUserWorkspace() { userWorkspacePath = getCurrentDocumentPath(); reset(); }
reset(); treeInvalidator.invalidationDone(); userWorkspacePath = getUserWorkspacePath(); DocumentTreeNode treeRoot = newDocumentTreeNode(globalRoot, treeName); currentTree.add(treeRoot); log.debug("Tree initialized with additional global root"); DocumentTreeNode treeRoot = newDocumentTreeNode(firstAccessibleParent, treeName); currentTree.add(treeRoot); log.debug("Tree initialized with document: " + firstAccessibleParent.getId());
public String forceTreeRefresh() throws IOException { resetCurrentDocumentData(); FacesContext context = FacesContext.getCurrentInstance(); HttpServletResponse response = (HttpServletResponse) context.getExternalContext().getResponse(); response.setContentType("application/xml; charset=UTF-8"); response.getWriter().write("<response>OK</response>"); context.responseComplete(); return null; }
@Observer(value = { EventNames.USER_ALL_DOCUMENT_TYPES_SELECTION_CHANGED }, create = false) @BypassInterceptors public void resetCurrentDocumentData() { currentDocumentPath = null; if (checkIfTreeInvalidationNeeded()) { trees.clear(); return; } // reset tree in case an accessible parent is finally found this time // for the new current document for (List<DocumentTreeNode> tree : trees.values()) { if (tree != null && tree.isEmpty()) { tree = null; } } }
@Observer(value = { EventNames.GO_HOME, EventNames.DOMAIN_SELECTION_CHANGED, EventNames.DOCUMENT_CHANGED, EventNames.DOCUMENT_SECURITY_CHANGED, EventNames.DOCUMENT_CHILDREN_CHANGED }, create = false) @BypassInterceptors public void reset() { trees.clear(); resetCurrentDocumentData(); }
public List<DocumentTreeNode> getTreeRoots() { return getTreeRoots(false); }
public List<DocumentTreeNode> getTreeRoots(String treeName) { return getTreeRoots(false, treeName); }
protected List<DocumentTreeNode> getTreeRoots(boolean showRoot, String treeName) { return getTreeRoots(showRoot, navigationContext.getCurrentDocument(), treeName); }
protected List<DocumentTreeNode> getTreeRoots(boolean showRoot) { return getTreeRoots(showRoot, navigationContext.getCurrentDocument(), DEFAULT_TREE_PLUGIN_NAME); }