Package org.opencms.file

Examples of org.opencms.file.CmsPropertyDefinition


          List<CmsProperty> propertiesToWrite = new ArrayList<CmsProperty>();
 
          // check all property definitions of the resource for new values
          Iterator<CmsPropertyDefinition> i = propertyDef.iterator();
          while (i.hasNext()) {
              CmsPropertyDefinition curPropDef = i.next();
              String propName = CmsEncoder.escapeXml(curPropDef.getName());
              String valueStructure = null;
              String valueResource = null;
 
              if (key(Messages.GUI_PROPERTIES_INDIVIDUAL_0).equals(activeTab)) {
                  // get parameters from the structure tab
                  valueStructure = request.getParameter(PREFIX_VALUE + propName);
                  valueResource = request.getParameter(PREFIX_RESOURCE + propName);
                  if (valueStructure != null
                      && !"".equals(valueStructure.trim())
                      && valueStructure.equals(valueResource)) {
                      // the resource value was shown/entered in input field, set structure value to empty String
                      valueStructure = "";
                  }
              } else {
                  // get parameters from the resource tab
                  valueStructure = request.getParameter(PREFIX_STRUCTURE + propName);
                  valueResource = request.getParameter(PREFIX_VALUE + propName);
              }
 
              // check values for blanks and null
              if (valueStructure != null) {
                  valueStructure = valueStructure.trim();
              } else {
                // This value was not part of the properties
                continue;
              }
 
              if (valueResource != null) {
                  valueResource = valueResource.trim();
              }
 
              // create new CmsProperty object to store
              CmsProperty newProperty = new CmsProperty();
              newProperty.setName(curPropDef.getName());
              newProperty.setStructureValue(valueStructure);
              newProperty.setResourceValue(valueResource);
 
              // get the old property values
              CmsProperty oldProperty = activeProperties.get(curPropDef.getName());
              if (oldProperty == null) {
                  // property was not set, create new empty property object
                  oldProperty = new CmsProperty();
                  oldProperty.setName(curPropDef.getName());
              }
 
              boolean writeStructureValue = false;
              boolean writeResourceValue = false;
              String oldValue = oldProperty.getStructureValue();
View Full Code Here

TOP

Related Classes of org.opencms.file.CmsPropertyDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.