/** * Checks whether a resource has a navigation property.<p> * * @param cms the current CMS context * @param resource the resource to use * * @return true if the resource has a navigation property * * @throws CmsException if something goes wrong */ private boolean hasNavigationProperty(CmsObject cms, CmsResource resource) throws CmsException { List<CmsProperty> props = cms.readPropertyObjects(resource, false); Map<String, String> propMap = CmsProperty.toMap(props); return propMap.containsKey(CmsPropertyDefinition.PROPERTY_NAVPOS) || propMap.containsKey(CmsPropertyDefinition.PROPERTY_NAVTEXT); }
/** * Reads the (compound) values of all properties mapped to a specified resource.<p> * * @param resourcePath the resource to look up the property for * * @return a map of <code>String</code> objects representing all properties of the resource * * @throws CmsException in case there where problems reading the properties * * @deprecated use <code>{@link #readPropertyObjects(String, boolean)}</code> instead. */ public Map readProperties(String resourcePath) throws CmsException { CmsResource resource = readResource(resourcePath, CmsResourceFilter.ALL); List properties = m_securityManager.readPropertyObjects(m_context, resource, false); return CmsProperty.toMap(properties); }
/** * Reads the (compound) values of all properties mapped to a specified resource * with optional direcory upward cascading.<p> * * @param resourcePath the resource to look up the property for * @param search if <code>true</code>, the properties will also be looked up on all parent folders and the results will be merged, if <code>false</code> not (ie. normal property lookup) * * @return Map of <code>String</code> objects representing all properties of the resource * * @throws CmsException in case there where problems reading the properties * * @deprecated use <code>{@link #readPropertyObjects(String, boolean)}</code> instead. */ public Map readProperties(String resourcePath, boolean search) throws CmsException { CmsResource resource = readResource(resourcePath, CmsResourceFilter.ALL); List properties = m_securityManager.readPropertyObjects(m_context, resource, search); return CmsProperty.toMap(properties); }
/** * Returns a CmsJspNavElement for the named resource.<p> * * @param cms context provider for the current request * @param resource the resource name to get the nav information for, * must be a full path name, e.g. "/docs/index.html". * @return a CmsJspNavElement for the given resource */ public static CmsJspNavElement getNavigationForResource(CmsObject cms, String resource) { List properties; try { properties = cms.readPropertyObjects(resource, false); } catch (Exception e) { return null; } int level = CmsResource.getPathLevel(resource); if (resource.endsWith("/")) { level--; } return new CmsJspNavElement(resource, CmsProperty.toMap(properties), level); }
resource = m_cms.readResource(sitePath, resourceFilter); List<CmsProperty> properties = m_cms.readPropertyObjects(resource, false); propertiesMap = CmsProperty.toMap(properties); if (resource.isFolder()) { if (resourceFilter.equals(CmsResourceFilter.DEFAULT)
/** * Internal action method.<p> * * @param action the search action * @param req the current request * * @return String the value of the property or <code>null</code> if not found (and no defaultValue provided) * * @throws CmsException if something goes wrong */ public static Map<String, String> propertiesTagAction(String action, ServletRequest req) throws CmsException { CmsFlexController controller = CmsFlexController.getController(req); // now read the property from the VFS Map<String, String> value = new HashMap<String, String>(); CmsPropertyAction propertyAction = new CmsPropertyAction(req, action); if (null != propertyAction.getVfsUri()) { value = CmsProperty.toMap( controller.getCmsObject().readPropertyObjects(propertyAction.getVfsUri(), propertyAction.isSearch())); } return value; }
case 0: // USE_URI case 1: // USE_PARENT value = CmsProperty.toMap(getCmsObject().readPropertyObjects(getRequestContext().getUri(), false)); break; case 2: // USE_SEARCH case 3: // USE_SEARCH_URI case 4: // USE_SEARCH_PARENT value = CmsProperty.toMap(getCmsObject().readPropertyObjects(getRequestContext().getUri(), true)); break; case 5: // USE_ELEMENT_URI case 6: // USE_THIS value = CmsProperty.toMap(getCmsObject().readPropertyObjects( getController().getCurrentRequest().getElementUri(), false)); case 8: // USE_SEARCH_THIS value = CmsProperty.toMap(getCmsObject().readPropertyObjects( getController().getCurrentRequest().getElementUri(), true)); default: value = CmsProperty.toMap(getCmsObject().readPropertyObjects(toAbsolute(file), false));
Map<String, String> props = CmsProperty.toMap( cms.readPropertyObjects(res, CmsResourceTypeXmlContainerPage.isContainerPage(res))); m_title = props.get(CmsPropertyDefinition.PROPERTY_TITLE);
JSONObject jsonAttachment = new JSONObject(); CmsResource res = clone.readResource(m_rootPath, CmsResourceFilter.IGNORE_EXPIRATION); Map<String, String> props = CmsProperty.toMap(clone.readPropertyObjects(res, false));