/** * Gets the name of the property.<p> * * @return the name of the property */ public String getName() { return m_propData.getName(); }
/** * Adds a user setting.<p> * * @param value the current value of the user setting * @param config the configuration for the user setting * * @param basic true if this is a basic user setting */ public void addSetting(String value, CmsXmlContentProperty config, boolean basic) { m_values.put(config.getName(), value); m_settingConfiguration.put(config.getName(), config); if (basic) { m_basicOptions.add(config.getName()); } }
/** * Initializes the element settings for this content handler.<p> * * @param root the "settings" element from the appinfo node of the XML content definition * @param contentDefinition the content definition the element settings belong to */ protected void initSettings(Element root, CmsXmlContentDefinition contentDefinition) { Iterator<Element> itProperties = CmsXmlGenericWrapper.elementIterator(root, APPINFO_SETTING); while (itProperties.hasNext()) { Element element = itProperties.next(); CmsXmlContentProperty setting = new CmsXmlContentProperty( element.attributeValue(APPINFO_ATTR_NAME), element.attributeValue(APPINFO_ATTR_TYPE), element.attributeValue(APPINFO_ATTR_WIDGET), element.attributeValue(APPINFO_ATTR_WIDGET_CONFIG), element.attributeValue(APPINFO_ATTR_RULE_REGEX), element.attributeValue(APPINFO_ATTR_RULE_TYPE), element.attributeValue(APPINFO_ATTR_DEFAULT), element.attributeValue(APPINFO_ATTR_NICE_NAME), element.attributeValue(APPINFO_ATTR_DESCRIPTION), element.attributeValue(APPINFO_ATTR_ERROR), element.attributeValue(APPINFO_ATTR_PREFERFOLDER)); String name = setting.getName(); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(name)) { m_settings.put(name, setting); } } }
/** * Parses the settings for the dynamic function from the XML content.<p> * * @param cms the current CMS context * @param location the location from which to read the dynamic function settings * @param functionResource the dynamic function resource * * @return the parsed map of settings for the dynamic function */ protected Map<String, CmsXmlContentProperty> parseSettings( CmsObject cms, I_CmsXmlContentLocation location, CmsResource functionResource) { LinkedHashMap<String, CmsXmlContentProperty> settingConfigs = new LinkedHashMap<String, CmsXmlContentProperty>(); List<I_CmsXmlContentValueLocation> locations = location.getSubValues("SettingConfig"); for (I_CmsXmlContentValueLocation settingLoc : locations) { CmsXmlContentProperty settingConfigBean = parseProperty(cms, settingLoc); settingConfigs.put(settingConfigBean.getName(), settingConfigBean); } return settingConfigs; }
/** * Parses the settings.<p> * * @param formatterLoc the formatter value location */ private void parseSettings(I_CmsXmlContentLocation formatterLoc) { for (I_CmsXmlContentValueLocation settingLoc : formatterLoc.getSubValues(N_SETTING)) { CmsPropertyConfig propConfig = CmsConfigurationReader.parseProperty(m_cms, settingLoc); CmsXmlContentProperty property = propConfig.getPropertyData(); m_settings.put(property.getName(), property); } }
/** * Resolves the macros in a single property.<p> * * @param property the property in which macros should be resolved * @param resolver the macro resolver to use * * @return a new property with resolved macros */ public static CmsXmlContentProperty resolveMacrosInProperty( CmsXmlContentProperty property, I_CmsMacroResolver resolver) { String propName = property.getName(); CmsXmlContentProperty result = new CmsXmlContentProperty( propName, property.getType(), property.getWidget(), resolver.resolveMacros(property.getWidgetConfiguration()), property.getRuleRegex(), property.getRuleType(), property.getDefault(), resolver.resolveMacros(property.getNiceName()), resolver.resolveMacros(property.getDescription()), resolver.resolveMacros(property.getError()), property.isPreferFolder() ? "true" : "false"); return result; }