/** * Construct link reference capturing page manager. * * @param pageManager * @param link */ public LinkWeakReference(PageManager pageManager, Link link) { this.pageManager = pageManager; this.path = link.getPath(); this.referentLink = new WeakReference<Link>(link); }
public Link copyLink(Link source, String path) throws NodeException { // create the new link and copy attributes Link link = newLink(path); link.setTitle(source.getTitle()); link.setShortTitle(source.getShortTitle()); link.setSkin(source.getSkin()); link.setVersion(source.getVersion()); link.setTarget(source.getTarget()); link.setUrl(source.getUrl()); link.setHidden(source.isHidden()); // copy locale specific metadata link.getMetadata().copyFields(source.getMetadata().getFields()); // copy security constraints SecurityConstraints srcSecurity = source.getSecurityConstraints(); if ((srcSecurity != null) && !srcSecurity.isEmpty()) { SecurityConstraints copiedSecurity = copySecurityConstraints(LINK_NODE_TYPE, srcSecurity); link.setSecurityConstraints(copiedSecurity); } return link; }
/** * LinkProxy - private constructor used by newInstance() * * @param view site view owner of this proxy * @param locatorName name of profile locator associated * with the proxy delegate * @param parentFolder view parent proxy folder * @param link proxy delegate */ private LinkProxy(SearchPathsSiteView view, String locatorName, Folder parentFolder, Link link) { super(view, locatorName, parentFolder, link.getName(), link.isHidden()); this.linkReference = new LinkWeakReference(view.getPageManager(), link); }
if (isFieldModified(title, link.getTitle())) link.setTitle(title); String shortTitle = getActionParameter(requestContext, "short-title"); if (isFieldModified(shortTitle, link.getShortTitle())) link.setShortTitle(shortTitle); String url = getActionParameter(requestContext, "url"); if (isFieldModified(url, link.getUrl())) link.setUrl(url); String target = getActionParameter(requestContext, "target"); if (isFieldModified(target, link.getTarget())) link.setTarget(target); String hidden = getActionParameter(requestContext, "hidden"); if (isBooleanModified(hidden, link.isHidden())) link.setHidden(!link.isHidden()); count++;
FolderImpl parent = (FolderImpl)link.getParent(); if (parent == null) String linkPath = link.getPath(); String parentPath = linkPath.substring(0, linkPath.lastIndexOf(Folder.PATH_SEPARATOR)); if (parentPath.length() == 0) link.setParent(parent); storeEntity(link, linkPath, true); link.checkAccess(JetspeedActions.EDIT); storeEntity(link, link.getPath(), false); throw new FailedToUpdateDocumentException("Link " + link.getPath() + " not updated.", e);
link.checkAccess(JetspeedActions.EDIT); if (link.getParent() != null) FolderImpl parent = (FolderImpl)ProxyHelper.getRealObject(link.getParent()); throw new FailedToDeleteDocumentException("Link " + link.getPath() + " not removed.", e);
link.checkAccess(JetspeedActions.EDIT); FolderImpl folder = getNodeFolder(link.getPath());
link.checkAccess(JetspeedActions.EDIT); return new LinkBean(link);
/** * getTarget - get target for url of menu option * * @return url target */ public String getTarget() { // only link nodes support target Node node = getNode(); if (node instanceof Link) { return ((Link)node).getTarget(); } return null; }
String path = concatenatePaths(destinationPath, srcLink.getName()); if (!pageManager.linkExists(path))
skin = ((Link)node).getSkin();
if (link.getPath() != null) if (!link.getPath().equals(link.getId())) FolderImpl parentFolder = getNodeFolder(link.getPath()); if (link.getParent() == null) link.setParent(parentFolder); newLink = true; link.checkAccess(JetspeedActions.EDIT); newLink = true; else if (parentAllNodes.get(link.getPath()) != link)
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; }
String path = PageManagerUtils.concatenatePaths(destinationPath, srcLink.getName()); Link dstLink = pageManager.copyLink(srcLink, path); pageManager.updateLink(dstLink);
String spacePath = link.getPath(); Folder folder = pageManager.getFolder(spacePath); if (folder.isHidden() || folder.isReserved())
/** * <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; }
String path = PageManagerUtils.concatenatePaths(destinationPath, srcLink.getName()); if (!pageManager.linkExists(path))
Link dstLink = lookupLink(dest, srcLink.getPath()); if (null != dstLink) context.logger.info("overwriting link " + srcLink.getPath()); dest.removeLink(dstLink); dstLink = dest.copyLink(srcLink, srcLink.getPath()); dest.updateLink(dstLink); context.linkCount++; context.logger.info("skipping link " + srcLink.getPath()); context.logger.info("processing new link " + srcLink.getPath()); dstLink = dest.copyLink(srcLink, srcLink.getPath()); dest.updateLink(dstLink); context.linkCount++;