/** * @param siteMapItem * @return String representation of the path */ public static String getPath(HstSiteMapItem siteMapItem) { StringBuffer path = new StringBuffer(siteMapItem.getValue()); while (siteMapItem.getParentItem() != null) { siteMapItem = siteMapItem.getParentItem(); path.insert(0, "/").insert(0, siteMapItem.getValue()); } return path.toString(); }
public static String getPath(HstSiteMapItem siteMapItem, String relPath) { StringBuffer path = new StringBuffer(siteMapItem.getValue()); while (siteMapItem.getParentItem() != null) { siteMapItem = siteMapItem.getParentItem(); path.insert(0, "/").insert(0, siteMapItem.getValue()); } if(relPath == null) { return path.toString(); } if(relPath.startsWith("/")) { path.append(relPath); } else { path.append("/").append(relPath); } return path.toString(); }
public static final void view(StringBuffer buf, String indent, HstSiteMapItem hstSiteMapItem) { if(hstSiteMapItem == null) { buf.append("\n").append(indent).append("+HstSiteMapItem: null"); return; } buf.append("\n").append(indent).append("+HstSiteMapItem: (").append(hstSiteMapItem.hashCode()).append(")"); String newLine = "\n" + indent + SMALL_INDENT + "-"; buf.append(newLine).append("id = ").append(hstSiteMapItem.getId()); buf.append(newLine).append("value = ").append(hstSiteMapItem.getValue()); buf.append(newLine).append("relativecontentpath = ").append(hstSiteMapItem.getRelativeContentPath()); buf.append(newLine).append("componentconfigurationid = ").append(hstSiteMapItem.getComponentConfigurationId()); buf.append(newLine).append("portletcomponentconfigurationid = ").append(hstSiteMapItem.getPortletComponentConfigurationId()); buf.append(newLine).append("iswildcard = ").append(hstSiteMapItem.isWildCard()); for(HstSiteMapItem siteMapItem : hstSiteMapItem.getChildren()) { view(buf, indent+SMALL_INDENT, siteMapItem); } }
@Override protected String getPathInfo() throws ClientException { String pathInfo = ""; if (siteMapItem != null) { if (parentId == null) { pathInfo = "/" + siteMapItem.getName(); } else { // Calling getConfigObject can throw a ClientException HstSiteMapItem parent = siteMapHelper.getConfigObject(parentId); while (parent != null) { pathInfo = parent.getValue() + "/" + pathInfo; parent = parent.getParentItem(); } if (!pathInfo.endsWith("/")) { pathInfo += "/"; } pathInfo = pathInfo + siteMapItem.getName(); } } return pathInfo; } }
if (r != null) { ResolvedLocationMapTreeItemImpl parent; if (HstNodeTypes.INDEX.equals(r.getSiteMapItem().getValue()) && (parent = getResolvedParent(r)) != null) { resolvedLocationMapTreeItemList.add(parent); } else { if (r != null) { ResolvedLocationMapTreeItemImpl parent; if (HstNodeTypes.INDEX.equals(r.getSiteMapItem().getValue()) && (parent = getResolvedParent(r)) != null) { resolvedLocationMapTreeItemList.add(parent); } else { if (r != null) { ResolvedLocationMapTreeItemImpl parent; if (HstNodeTypes.INDEX.equals(r.getSiteMapItem().getValue()) && (parent = getResolvedParent(r)) != null) { resolvedLocationMapTreeItemList.add(parent); } else {
if (HstNodeTypes.INDEX.equals(r.getSiteMapItem().getValue()) && (parent = getResolvedParent(r)) != null) { r = parent;
return; if (INDEX.equals(siteMapItem.getValue())) { log.debug("Skip '{}' from page overview because '{}' items do not need to be shown as pages since the " + "parent item shows the same page", siteMapItem, INDEX);
public SiteMapPageRepresentation represent(final HstSiteMapItem item, final String parentId, final String mountPath, final String homePagePathInfo, final String previewConfigurationPath) throws IllegalArgumentException { id = ((CanonicalInfo)item).getCanonicalIdentifier(); this.parentId = parentId; name = NodeNameCodec.decode(item.getValue()); pageTitle = item.getPageTitle(); pathInfo = HstSiteMapUtils.getPath(item, null); if (pathInfo.equals(homePagePathInfo)) { pathInfo = "/"; renderPathInfo = mountPath; } else { if (pathInfo.startsWith("/")){ renderPathInfo = mountPath + pathInfo; } else { renderPathInfo = mountPath + "/" + pathInfo; } } componentConfigurationId = item.getComponentConfigurationId(); workspaceConfiguration = ((CanonicalInfo) item).isWorkspaceConfiguration(); inherited = !((CanonicalInfo) item).getCanonicalPath().startsWith(previewConfigurationPath + "/"); relativeContentPath = item.getRelativeContentPath(); return this; }
return EVAL_PAGE; webFilesPrefix.insert(0, current.getValue()).insert(0, "/"); current = current.getParentItem();
final HstSiteMapItem pagenotfound = siteMap.getSiteMapItemByRefId(PAGE_NOT_FOUND); if (pagenotfound != null) { String link = pagenotfound.getValue(); try { response.forward('/' + link);
setId(((CanonicalInfo) hstSiteMapItem).getCanonicalIdentifier()); setType(Type.PAGE.getName()); setNodeName(hstSiteMapItem.getValue()); setDisplayName(hstSiteMapItem.getPageTitle() == null ? hstSiteMapItem.getValue() : hstSiteMapItem.getPageTitle()); setNodePath(((CanonicalInfo) hstSiteMapItem).getCanonicalPath());
throw new IllegalArgumentException("Expected object of type ConfigurationLockInfo"); name = NodeNameCodec.decode(item.getValue()); id = ((CanonicalInfo) item).getCanonicalIdentifier();