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 resolveComponentConfiguration() { // check whether there is a more specific mapping String componentConfigurationId = resolveMappedConponentConfigurationId(); HstSite hstSite = hstSiteMapItem.getHstSiteMap().getSite(); if (componentConfigurationId == null && hstSiteMapItem.getComponentConfigurationId() == null) { log.debug("The ResolvedSiteMapItemImpl does not have a component configuration id because the sitemap item '{}' does not have one", hstSiteMapItem.getId()); } else { if (componentConfigurationId == null) { log.debug("No mapped component configuration id, getting the default componentconfiguration id"); componentConfigurationId = hstSiteMapItem.getComponentConfigurationId(); } if (componentConfigurationId != null) { final String resolvedComponentConfigurationId = (String)pp.resolveProperty("componentConfigurationId", componentConfigurationId); hstComponentConfiguration = hstSite.getComponentsConfiguration().getComponentConfiguration(resolvedComponentConfigurationId); if (hstComponentConfiguration == null) { log.warn("ResolvedSiteMapItemImpl cannot be created correctly, because the component configuration id {} cannot be found.", componentConfigurationId); } } } isComponentResolved = true; }
private void sanitizeSiteMapItem(final HstSiteMapItem hstSiteMapItem, final HstComponentsConfiguration hstComponentsConfiguration) { HstComponentConfiguration hstComponentConfiguration = hstComponentsConfiguration.getComponentConfiguration(hstSiteMapItem.getComponentConfigurationId()); if(hstComponentConfiguration == null) { log.info("HST Configuration info: The sitemap item '{}' does not point to a HST Component.", hstSiteMapItem.getId()); } else { sanitizeHstComponentConfiguration(hstComponentConfiguration); } for(HstSiteMapItem child : hstSiteMapItem.getChildren()) { sanitizeSiteMapItem(child, hstComponentsConfiguration); } }
private void sanitizeSiteMapItem(HstSiteMapItem hstSiteMapItem) { HstComponentConfiguration hstComponentConfiguration = this.getComponentsConfiguration().getComponentConfiguration(hstSiteMapItem.getComponentConfigurationId()); if(hstComponentConfiguration == null) { log.info("HST Configuration info: The sitemap item '{}' does not point to a HST Component.", hstSiteMapItem.getId()); } else { sanitizeHstComponentConfiguration(hstComponentConfiguration); } for(HstSiteMapItem child : hstSiteMapItem.getChildren()) { sanitizeSiteMapItem(child); } }
if (siteMapItem.getComponentConfigurationId() != null && siteMapItem.isExplicitPath()) { final HstComponentConfiguration cc = configuration.getComponentConfiguration(siteMapItem.getComponentConfigurationId()); if (cc == null) { log.warn("'{}' for site '{}' contains unresolvable hst:componentconfigurationid '{}'.", siteMapItem, siteMapItem.getHstSiteMap().getSite().getName(), siteMapItem.getComponentConfigurationId()); } else {
if (hstSiteMapItem.getComponentConfigurationId() == null && hstSiteMapItem.getPortletComponentConfigurationId() == null) { log.debug("The ResolvedSiteMapItemImpl does not have a component configuration id because the sitemap item '{}' does not have one", hstSiteMapItem.getId()); } else { String componentConfigurationId = hstSiteMapItem.getComponentConfigurationId();
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; }
.getComponentConfiguration(sourceSiteMapItem.getComponentConfigurationId());
@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); } });
componentConfigurationId = item.getComponentConfigurationId(); final HstComponentConfiguration page = mount.getHstSite().getComponentsConfiguration().getComponentConfiguration(componentConfigurationId); hasContainerItemInPageDefinition = hasContainerItemInPageDefinition(page);