public int addPages(Page[] pages) throws NodeException { throw new NodeException("not impl"); }
/** * <p> * registerDocumentHandler * </p> * * @see org.apache.jetspeed.page.document.DocumentHandlerFactory#registerDocumentHandler(org.apache.jetspeed.page.document.DocumentHandler) * @param documentHandler * @throws DocumentTypeAlreadyRegisteredException */ public void registerDocumentHandler( DocumentHandler documentHandler ) throws DocumentTypeAlreadyRegisteredException { if(handlers.containsKey(documentHandler.getType())) { throw new DocumentTypeAlreadyRegisteredException(documentHandler.getType()+" has already been registered."); } // register handler and this with handlers documentHandler.setHandlerFactory(this); handlers.put(documentHandler.getType(), documentHandler); }
/** * * <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> * getPageSecurity * </p> * * @param checkAccess flag * @return page security * @throws DocumentNotFoundException * @throws NodeException */ public PageSecurity getPageSecurity(boolean checkAccess) throws DocumentNotFoundException, NodeException { // check access to this folder in place // of access to page security document if (checkAccess) { checkAccess(JetspeedActions.VIEW); } // get pageSecurity PageSecurity pageSecurity = (PageSecurity) getAllNodes( false ).subset(PageSecurity.DOCUMENT_TYPE).get(PageSecurity.DOCUMENT_TYPE); if (pageSecurity == null) { throw new DocumentNotFoundException("Jetspeed PSML page security not found: " + PageSecurity.DOCUMENT_TYPE); } return pageSecurity; }
public NodeSet subset(String type) { NodeSetImpl subset = new NodeSetImpl(comparator); for (Node node : this) { if (node.getType().equals(type)) { subset.add(node); } } return subset; }
/** * getLink - proxy implementation of Folder.getLink() * * @param proxy this folder proxy * @param name link name including extension * @return link * @throws DocumentNotFoundException * @throws NodeException */ public Link getLink(Object proxy, String name) throws DocumentNotFoundException, NodeException { // search for link by name or absolute path from // aggregated links NodeSet allLinks = getLinks(proxy); if (allLinks != null) { Link link = (Link)allLinks.get(name); if (link != null) { return link; } } throw new DocumentNotFoundException("Link " + name + " not found at " + getPath()); }
/** * 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; }
/** * isEditable - get editable access flag for menu option * * @return editable flag */ public boolean isEditable() { try { getNode().checkAccess(JetspeedActions.EDIT); return true; } catch (SecurityException se) { return false; } }
/** * getShortTitle - get default short title for menu element * * @return short title text */ public String getShortTitle() { // return node or default short title if (node != null) { return node.getShortTitle(); } return getName(); }
public CastorXmlPageManager( IdGenerator generator, DocumentHandlerFactory handlerFactory, FolderHandler folderHandler, FileCache fileCache, boolean permissionsEnabled, boolean constraintsEnabled ) throws FileNotFoundException { super(generator, permissionsEnabled, constraintsEnabled, modelClasses); handlerFactory.setPermissionsEnabled(permissionsEnabled); handlerFactory.setConstraintsEnabled(constraintsEnabled); this.handlerFactory = handlerFactory; this.folderHandler = folderHandler; this.fileCache = fileCache; this.fileCache.addListener(this); }
/** * getUrl - get url of menu option * * @return folder, page, or link url */ public String getUrl() { return getNode().getUrl(); }
/** * isHidden - get hidden state of menu option * * @return hidden state */ public boolean isHidden() { return getNode().isHidden(); }
/** * getTitle - get default title for menu element * * @return title text */ public String getTitle() { // return node or default title if (node != null) { return node.getTitle(); } return getName(); }
public FolderImpl( String path, DocumentHandlerFactory handlerFactory, FolderHandler folderHandler ) { this.metadata = new FolderMetaDataImpl(); this.metadata.setParent(this); this.folderHandler = folderHandler; setPath(path); setReservedType(); setHandlerFactory(handlerFactory); setPermissionsEnabled(handlerFactory.getPermissionsEnabled()); setConstraintsEnabled(handlerFactory.getConstraintsEnabled()); }
public void shutdown() { // propagate to handlers for (DocumentHandler handler : handlers.values()) { handler.shutdown(); } } }
/** * <p> * getUrl * </p> * * @return url of folder */ public String getUrl() { return getParent(false).getPath() + PATH_SEPARATOR + getType(); }
/** * getShortTitle - get locale specific short title for menu * element from metadata * * @param locale preferred locale * @return short title text */ public String getShortTitle(Locale locale) { // return node or default short title for preferred locale if (node != null) { return node.getShortTitle(locale); } return getName(); }