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); } }
private void add2LocationMap(HstSiteMapItem siteMapItem) { String normPath = PathUtils.normalizePath(siteMapItem.getRelativeContentPath()); if( !(normPath == null || "".equals(normPath))) { this.addSiteMapItem(normPath, siteMapItem); } for(HstSiteMapItem child : siteMapItem.getChildren()) { add2LocationMap(child); } }
private void add2LocationMap(final HstSiteMapItem siteMapItem) { final String normPath = PathUtils.normalizePath(siteMapItem.getRelativeContentPath()); if (siteMapItem.isExcludedForLinkRewriting()){ log.debug("'{}' will not be used for link rewriting as it is marked deleted or is configured to be " + "excluded for link rewriting.", siteMapItem); return; } if (StringUtils.isNotEmpty(normPath)) { log.debug("Adding to location map path '{}' for sitemap item '{}'", normPath, siteMapItem.getQualifiedId()); addSiteMapItem(normPath, siteMapItem); } for(HstSiteMapItem child : siteMapItem.getChildren()) { add2LocationMap(child); } }
relativeContentPath = (String)pp.resolveProperty("relativeContentPath", hstSiteMapItem.getRelativeContentPath()); pageTitle = (String)pp.resolveProperty("pageTitle", hstSiteMapItem.getPageTitle());
if(!unresolvedPath.contains(propertyPlaceHolder)) { log.debug("The SiteMapItem with id '{}' and relative content path '{}' can only be used in a context aware link rewriting", siteMapItem.getId(), siteMapItem.getRelativeContentPath()); ((HstSiteMapItemService)siteMapItem).setUseableInRightContextOnly(true);
String propertyPlaceHolder = PropertyParser.DEFAULT_PLACEHOLDER_PREFIX + ((String)param) + PropertyParser.DEFAULT_PLACEHOLDER_SUFFIX; if(!unresolvedPath.contains(propertyPlaceHolder)) { log.debug("The SiteMapItem with id '{}' and relative content path '{}' can only be used in a context aware link rewriting", hstSiteMapItem.getId(), hstSiteMapItem.getRelativeContentPath()); ((HstSiteMapItemService)hstSiteMapItem).setUseableInRightContextOnly(true);
relativeContentPath = (String)pp.resolveProperty("relativeContentPath", hstSiteMapItem.getRelativeContentPath());
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; }
if(parentItem == null || parentItem.getRelativeContentPath() == null) { log.error("Cannot use '{}' for a sitemap item that does not have a parent or a parent without relative content path. Used at: '{}'", PARENT_PROPERTY_PLACEHOLDER, id); } else { relativeContentPath = relativeContentPath.replace(PARENT_PROPERTY_PLACEHOLDER, parentItem.getRelativeContentPath());
@Override public Response call() throws Exception { final HstSiteMapItem siteMapItem = siteMapHelper.getConfigObject(siteMapItemUuid); final HstSite site = getPageComposerContextService().getEditingPreviewSite(); final HstComponentsConfiguration componentsConfiguration = site.getComponentsConfiguration(); String componentConfigurationId = siteMapItem.getComponentConfigurationId(); final HstComponentConfiguration page = componentsConfiguration.getComponentConfiguration(componentConfigurationId); DocumentRepresentation primaryDocumentRepresentation = null; final String relativeContentPath = siteMapItem.getRelativeContentPath(); final String rootContentPath = getPageComposerContextService().getEditingMount().getContentPath(); if (relativeContentPath != null) { final String absPath; if (relativeContentPath.startsWith("/")) { absPath = rootContentPath + relativeContentPath; } else { absPath = rootContentPath + "/" + relativeContentPath; } primaryDocumentRepresentation = getDocumentRepresentationHstConfigUser(absPath); primaryDocumentRepresentation.setSelected(true); } Set<DocumentRepresentation> availableDocumentRepresentations = findAvailableDocumentRepresentations( getPageComposerContextService(), page, primaryDocumentRepresentation, true, rootContentPath + "/"); final SiteMapItemRepresentation siteMapItemRepresentation = new SiteMapItemRepresentation() .represent(siteMapItem, getPageComposerContextService().getEditingMount(), primaryDocumentRepresentation, availableDocumentRepresentations); return ok("Sitemap item loaded successfully", siteMapItemRepresentation); } });
versionStamp = lockedOn.getTimeInMillis(); relativeContentPath = item.getRelativeContentPath(); scheme = item.getScheme(); wildCard = item.isWildCard();