Package org.opencms.file

Examples of org.opencms.file.CmsProperty


     */
    public String getDefault(String propertydef) {

        try {
            String parentFolder = CmsResource.getParentFolder(getParamResource());
            CmsProperty property = getCms().readPropertyObject(parentFolder, propertydef, true);
            String propertyValue = property.getValue();
            if (!CmsStringUtil.isEmpty(propertyValue)) {
                return property.getValue();
            }
        } catch (CmsException e) {
            if (LOG.isErrorEnabled()) {
                LOG.error(e);
            }
View Full Code Here


        String localized = key(titleKey);
              if (localized.startsWith(CmsMessages.UNKNOWN_KEY_EXTENSION)) {
                  localized = titleKey;
              }
       
              CmsProperty currentProperty = (CmsProperty)getActiveProperties().get(name);
              String propValue = null;
              if (currentProperty != null) {
                propValue = currentProperty.getValue();
                if (propValue != null) {
                    propValue = propValue.trim();
                }
            }
        fields.add(new PropertyBean(name, propValue, localized, type, config));
View Full Code Here

              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();
              String newValue = newProperty.getStructureValue();
 
              // write the structure value if the existing structure value is not null and we want to delete the structure value
              writeStructureValue = (oldValue != null && newProperty.isDeleteStructureValue());
              // or if we want to write a value which is neither the delete value or an empty value
              writeStructureValue |= !newValue.equals(oldValue)
                  && !"".equalsIgnoreCase(newValue)
                  && !CmsProperty.DELETE_VALUE.equalsIgnoreCase(newValue);
              // set the structure value explicitly to null to leave it as is in the database
              if (!writeStructureValue) {
                  newProperty.setStructureValue(null);
              }
 
              oldValue = oldProperty.getResourceValue();
              newValue = newProperty.getResourceValue();
 
              // write the resource value if the existing resource value is not null and we want to delete the resource value
              writeResourceValue = (oldValue != null && newProperty.isDeleteResourceValue());
              // or if we want to write a value which is neither the delete value or an empty value
View Full Code Here

            result.append("\";\n");
        }
      }
      // check if the navigation text property value has to be added
      if (showNavigation() && isNavigationPropertiesShown()) {
          CmsProperty property = (CmsProperty)getActiveProperties().get(CmsPropertyDefinition.PROPERTY_NAVTEXT);
          if (property != null) {
              String propValue = property.getValue();
              if (propValue != null) {
                  propValue = propValue.trim();
                  propValue = CmsStringUtil.escapeJavaScript(propValue);
                  // create the JS output for a single property
                  result.append("\tdocument.getElementById(\"");
View Full Code Here

        StringBuffer checkbox = new StringBuffer();
        checkbox.append(buildTableRowStart(propertyText));
        String checked = "";
        if (getActiveProperties().containsKey(propertyName)) {
            // the property is used, so create text field with checkbox and hidden field
            CmsProperty currentProperty = (CmsProperty)getActiveProperties().get(propertyName);

            String propValue = currentProperty.getValue();
            if (propValue != null) {
                propValue = propValue.trim();
            }
            propValue = CmsEncoder.escapeXml(propValue);
            if (propertyValue.equals(propValue)) {
View Full Code Here

        if (!editable) {
            disabled = " disabled=\"disabled\"";
        }
        String propValue = "";
        // the property is used, so create text field with checkbox and hidden field
        CmsProperty currentProperty = (CmsProperty)getActiveProperties().get(propertyName);
        if (currentProperty != null) {
            propValue = currentProperty.getValue();
            if (!CmsStringUtil.isEmpty(propValue)) {
                propValue = propValue.trim();
            }
        }
View Full Code Here

TOP

Related Classes of org.opencms.file.CmsProperty

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.