public Link getLink(Folder folder, String name) throws DocumentNotFoundException, NodeException { // perform lookup by path so that cache can be used String linkPath = folder.getPath() + Folder.PATH_SEPARATOR + name; try { return getLink(linkPath); } catch (DocumentNotFoundException dnfe) { throw dnfe; } catch (Exception e) { throw new DocumentNotFoundException("Link " + linkPath + " not found.", e); } }
public void removePageSecurity(PageSecurity pageSecurity) throws NodeException, FailedToDeleteDocumentException { // check for edit access pageSecurity.checkAccess(JetspeedActions.EDIT); try { FolderImpl folder = getNodeFolder(Folder.PATH_SEPARATOR); // remove page security handlerFactory.getDocumentHandler(PageSecurity.DOCUMENT_TYPE).removeDocument(pageSecurity); // update folder ((NodeSetImpl)folder.getAllNodes()).remove(pageSecurity); // notify page manager listeners notifyRemovedNode(pageSecurity); } catch (FolderNotFoundException fnfe) { throw new NodeException(fnfe.getMessage()); } catch (DocumentNotFoundException dnfe) { throw new NodeException(dnfe.getMessage()); } }
throw new NodeException(dnfe.getMessage());
public PageSecurity getPageSecurity() throws DocumentNotFoundException, NodeException { // get page security instance if (!pageSecurityCached) { // use PageManager to get and cache page security // instance for this folder return getPageManager().getPageSecurity(this); } if (pageSecurity == null) { throw new DocumentNotFoundException("Page security document not found"); } // check for view access on document pageSecurity.checkAccess(JetspeedActions.VIEW); return pageSecurity; }
throw new NodeException(dnfe.getMessage());
/** * <p> * getPageSecurity * </p> * * @see org.apache.jetspeed.page.PageManager#getPageSecurity() * @return page security instance * @throws DocumentNotFoundException * @throws UnsupportedDocumentTypeException * @throws NodeException */ public PageSecurity getPageSecurity() throws DocumentNotFoundException, UnsupportedDocumentTypeException, NodeException { // get page security via folder, (always allow access) try { FolderImpl folder = getNodeFolder(Folder.PATH_SEPARATOR); return folder.getPageSecurity(); } catch (FolderNotFoundException fnfe) { throw new DocumentNotFoundException(fnfe.getMessage()); } }
/** * 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()); }
/** * <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 Link getLink(String name) throws DocumentNotFoundException, NodeException { // get link instance if links collection not available if (!linksCached) { // use PageManager to get link instance without // caching the links collection for this folder return getPageManager().getLink(this, name); } // select link by name from cached links collection Link link = (Link)getLinksNodeSet().get(name); if (link == null) { throw new DocumentNotFoundException("Link not found: " + name); } // check for view access on link link.checkAccess(JetspeedActions.VIEW); return link; }
/** * <p> * getLink * </p> * * @param name * @param checkAccess flag * @return link * @throws DocumentNotFoundException * @throws NodeException */ public Link getLink(String name, boolean checkAccess) throws DocumentNotFoundException, NodeException { // get link Link link = (Link) getAllNodes().subset(Link.DOCUMENT_TYPE).get(name); if (link == null) { throw new DocumentNotFoundException("Jetspeed PSML link not found: " + name); } // check access if (checkAccess) { link.checkAccess(JetspeedActions.VIEW); } return link; }
/** * <p> * getLink * </p> * * @see org.apache.jetspeed.page.PageManager#getLink(java.lang.String) * @param path * @return link * @throws DocumentNotFoundException * @throws UnsupportedDocumentTypeException * @throws NodeException */ public Link getLink(String path) throws DocumentNotFoundException, UnsupportedDocumentTypeException, NodeException { // get link via folder, (access checked in Folder.getLink()) try { FolderImpl folder = getNodeFolder(path); return folder.getLink(getNodeName(path)); } catch (FolderNotFoundException fnfe) { throw new DocumentNotFoundException(fnfe.getMessage()); } }
throw new DocumentNotFoundException("Document " + f.getAbsolutePath() + " is not valid", e); throw new DocumentNotFoundException("Document not found: " + path);
throw new DocumentNotFoundException("Document " + path + " not found."); throw new DocumentNotFoundException("Document " + path + " not found.", e);
throw new DocumentNotFoundException("Link " + path + " not found."); throw new DocumentNotFoundException("Link " + path + " not found.", e);