public void updatedNode(Node node) { // set stale flag to force session context state reset synchronized (this) { stale = true; } // log updated node event if (log.isDebugEnabled()) { if (node != null) { log.debug("Page manager update event, (node=" + node.getPath() + "): set session context state stale"); } else { log.debug("Page manager update event: set session context state stale"); } } }
/** * SiteViewMenuDefinitionLocator - custom menu definition constructor * * @param menuDefinition custom menu definition * @param definitionNode defining page or folder * @param path menu definition path * @param override menu definition override flag */ public SiteViewMenuDefinitionLocator(MenuDefinition menuDefinition, Node definitionNode, String path, boolean override) { this.menuDefinition = menuDefinition; this.locator = definitionNode.getPath() + "|" + menuDefinition.getName(); this.path = path; this.override = override; }
public void setParent(Node parent) { // set node parent this.parent = parent; // update path if required if (parent != null) { String parentPath = parent.getPath(); if ((parentPath.equals(Folder.PATH_SEPARATOR) && (path.lastIndexOf(Folder.PATH_SEPARATOR) > 0)) || (!parentPath.equals(Folder.PATH_SEPARATOR) && !parentPath.equals(path.substring(0, path.lastIndexOf(Folder.PATH_SEPARATOR))))) { // set path path = parentPath + Folder.PATH_SEPARATOR + getName(); // reset logicalPath logicalPath = null; } } }
/** * get - return proxy Node by name or path * * @param name node name * @return Node proxy */ public Node get(String name) { // search nodes for matching name or path for (Node node : this) { if (node.getName().equals(name) || node.getPath().equals(name)) { return node; } } return null; }
/** * inclusiveSubset - construct new NodeSet containing Node * proxies whose name or path matches * the specified regex pattern * * @param regex proxy Node name/path match pattern * @return proxy NodeSet list */ public NodeSet inclusiveSubset(String regex) { // search for matching nodes List<Node> subsetNodes = null; Pattern pattern = Pattern.compile(regex); for (Node node : this) { if (pattern.matcher(node.getName()).matches() || pattern.matcher(node.getPath()).matches()) { if (subsetNodes == null) { subsetNodes = new ArrayList<Node>(nodes.size()); } subsetNodes.add(node); } } // wrap matching nodes in new NodeSet if (subsetNodes != null) return new NodeSetImpl(subsetNodes); return null; }
/** * <p> * getUrl * </p> * * @return url of folder */ public String getUrl() { return getParent(false).getPath() + PATH_SEPARATOR + getType(); }
/** * exclusiveSubset - construct new NodeSet containing Node * proxies whose name or path does not match * the specified regex pattern * * @param regex proxy Node name/path match pattern * @return proxy NodeSet list */ public NodeSet exclusiveSubset(String regex) { // search for matching nodes List<Node> subsetNodes = null; Pattern pattern = Pattern.compile(regex); for (Node node : this) { if (!pattern.matcher(node.getName()).matches() && !pattern.matcher(node.getPath()).matches()) { if (subsetNodes == null) { subsetNodes = new ArrayList<Node>(nodes.size()); } subsetNodes.add(node); } } // wrap matching nodes in new NodeSet if (subsetNodes != null) return new NodeSetImpl(subsetNodes); return null; }
/** * * <p> * add * </p> * * @see org.apache.jetspeed.page.document.NodeSet#add(org.apache.jetspeed.page.document.Node) * @param node */ public void add( Node node ) { String path = node.getPath(); nodes.put(path, node); if (subsets.containsKey(node.getType())) { subsets.get(node.getType()).add(node); } }
/** * <p> * remove * </p> * * @param node to remove * @return removed node */ public Node remove(Node node) { String path = node.getPath(); if (nodes.get(path) == node) { nodes.remove(path); if (subsets.containsKey(node.getType())) { ((NodeSetImpl) subsets.get(node.getType())).remove(node); } } return null; } }
String parentPath = parent.getPath(); if ((parentPath.equals(Folder.PATH_SEPARATOR) && (this.path.lastIndexOf(Folder.PATH_SEPARATOR) > 0)) ||
public NodeBean(Node node) { super(node); path = node.getPath(); name = node.getName(); GenericMetadata metadata = node.getMetadata(); if (metadata != null) { metadataBean = new GenericMetadataBean(metadata); } type = node.getType(); url = node.getUrl(); hidden = node.isHidden(); }
File documentFile = new File(this.documentRootDir, node.getPath()); throw new FailedToDeleteFolderException(documentFile.getAbsolutePath()+" document cannot be deleted.");
if (findNode.getPath().equals(nodePath))
String path = node.getPath(); List<SiteViewMenuDefinitionLocator> locators = menuDefinitionLocatorsCache.get(path); if (locators == null)