for (Object propElement : parentElement.elements(CmsXmlContentProperty.XmlNode.Properties.name())) { parentElement.remove((Element)propElement); Element propElement = parentElement.addElement(CmsXmlContentProperty.XmlNode.Properties.name()); propElement.addElement(CmsXmlContentProperty.XmlNode.Name.name()).addCDATA(propName); Element valueElement = propElement.addElement(CmsXmlContentProperty.XmlNode.Value.name()); boolean isVfs = false; CmsXmlContentProperty propDef = propertiesConf.get(propName); valueElement.addElement(CmsXmlContentProperty.XmlNode.String.name()).addCDATA(propValue); } else { addFileListPropertyValue(cms, valueElement, propValue);
String elementName = CmsXmlContentProperty.XmlNode.Properties.name(); String nameElementName = CmsXmlContentProperty.XmlNode.Name.name(); List<I_CmsXmlContentValueLocation> propertyLocations = baseLocation.getSubValues(elementName); for (I_CmsXmlContentValueLocation propertyLocation : propertyLocations) { String value = null; I_CmsXmlContentValueLocation valueLocation = propertyLocation.getSubValue( CmsXmlContentProperty.XmlNode.Value.name()); I_CmsXmlContentValueLocation stringLocation = valueLocation.getSubValue( CmsXmlContentProperty.XmlNode.String.name()); I_CmsXmlContentValueLocation fileListLocation = valueLocation.getSubValue( CmsXmlContentProperty.XmlNode.FileList.name()); if (stringLocation != null) { value = stringLocation.asString(cms).trim(); List<CmsUUID> idList = new ArrayList<CmsUUID>(); List<I_CmsXmlContentValueLocation> fileLocations = fileListLocation.getSubValues( CmsXmlContentProperty.XmlNode.Uri.name()); for (I_CmsXmlContentValueLocation fileLocation : fileLocations) { CmsUUID structureId = fileLocation.asId(cms);
CmsXmlContentProperty.XmlNode.Properties.name()); itProps.hasNext();) { Element property = itProps.next(); Element propName = property.element(CmsXmlContentProperty.XmlNode.Name.name()); xmlContent.addBookmarkForElement(propName, locale, property, propPath, propDef); Element value = property.element(CmsXmlContentProperty.XmlNode.Value.name()); if (value == null) { Element string = value.element(CmsXmlContentProperty.XmlNode.String.name()); if (string != null) { } else { Element valueFileList = value.element(CmsXmlContentProperty.XmlNode.FileList.name()); if (valueFileList == null) { CmsXmlContentProperty.XmlNode.Uri.name()); itFiles.hasNext();) {
/** * Adds the XML for a property value of a property of type 'vfslist' to the DOM.<p> * * @param cms the current CMS context * @param valueElement the element to which the vfslist property value should be added * @param propValue the property value which should be saved */ protected static void addFileListPropertyValue(CmsObject cms, Element valueElement, String propValue) { // resource list value Element filelistElem = valueElement.addElement(CmsXmlContentProperty.XmlNode.FileList.name()); for (String strId : CmsStringUtil.splitAsList(propValue, CmsXmlContentProperty.PROP_SEPARATOR)) { try { Element fileValueElem = filelistElem.addElement(CmsXmlContentProperty.XmlNode.Uri.name()); CmsVfsFileValueBean fileValue = getFileValueForIdOrUri(cms, strId); // HACK: here we assume weak relations, but it would be more robust to check it, with smth like: // type = xmlContent.getContentDefinition().getContentHandler().getRelationType(fileValueElem.getPath()); CmsRelationType type = CmsRelationType.XML_WEAK; CmsXmlVfsFileValue.fillEntry(fileValueElem, fileValue.getId(), fileValue.getPath(), type); } catch (CmsException e) { // should never happen LOG.error(e.getLocalizedMessage(), e); } } }