/** * Sets the value of this property as either shared or * individual value.<p> * * If the given type equals {@link CmsProperty#TYPE_SHARED} then * the value is set as a shared (resource) value, otherwise it * is set as individual (structure) value.<p> * * @param value the value to set * @param type the value type to set */ public void setValue(String value, String type) { checkFrozen(); setAutoCreatePropertyDefinition(true); if (TYPE_SHARED.equalsIgnoreCase(type)) { // set the provided value as shared (resource) value setResourceValue(value); } else { // set the provided value as individual (structure) value setStructureValue(value); } }
/** * Sets the value of this property as either shared or * individual value.<p> * * If the given type equals {@link CmsProperty#TYPE_SHARED} then * the value is set as a shared (resource) value, otherwise it * is set as individual (structure) value.<p> * * @param value the value to set * @param type the value type to set */ public void setValue(String value, String type) { checkFrozen(); setAutoCreatePropertyDefinition(true); if (TYPE_SHARED.equalsIgnoreCase(type)) { // set the provided value as shared (resource) value setResourceValue(value); } else { // set the provided value as individual (structure) value setStructureValue(value); } }
property = new CmsProperty(); property.setName(m_propertyName); property.setAutoCreatePropertyDefinition(true); m_properties.put(m_propertyName, property);
property = new CmsProperty(); property.setName(m_propertyName); property.setAutoCreatePropertyDefinition(true); m_properties.put(m_propertyName, property);
property = new CmsProperty(); property.setName(m_propertyName); property.setAutoCreatePropertyDefinition(true); m_properties.put(m_propertyName, property);
property = new CmsProperty(); property.setName(key); property.setAutoCreatePropertyDefinition(true); properties.put(key, property);
property = new CmsProperty(); property.setName(key); property.setAutoCreatePropertyDefinition(true); properties.put(key, property);
/** * Writes a property for a file or folder.<p> * * @param resourcename the resource-name for which the property will be set * @param key the property-definition name * @param value the value for the property to be set * @param addDefinition flag to indicate if unknown definitions should be added * * @throws CmsException if operation was not successful * * @deprecated use <code>{@link #writePropertyObject(String, CmsProperty)}</code> instead. */ public void writeProperty(String resourcename, String key, String value, boolean addDefinition) throws CmsException { CmsProperty property = new CmsProperty(); property.setName(key); property.setStructureValue(value); property.setAutoCreatePropertyDefinition(addDefinition); writePropertyObject(resourcename, property); }
CmsProperty property = new CmsProperty(propertyKey, propertyVal, propertyVal); property.setAutoCreatePropertyDefinition(true);
/** * Creates a single property object and sets the value individual or shared depending on the OpenCms settings.<p> * * @param name the name of the property * @param value the value to set * @return an initialized property object */ protected static CmsProperty createPropertyObject(String name, String value) { CmsProperty prop = new CmsProperty(); prop.setAutoCreatePropertyDefinition(true); prop.setName(name); if (OpenCms.getWorkplaceManager().isDefaultPropertiesOnStructure()) { prop.setValue(value, CmsProperty.TYPE_INDIVIDUAL); } else { prop.setValue(value, CmsProperty.TYPE_SHARED); } return prop; }
/** * Creates a single property object and sets the value individual or shared depending on the OpenCms settings.<p> * * @param name the name of the property * @param value the value to set * @return an initialized property object */ protected static CmsProperty createPropertyObject(String name, String value) { CmsProperty prop = new CmsProperty(); prop.setAutoCreatePropertyDefinition(true); prop.setName(name); if (OpenCms.getWorkplaceManager().isDefaultPropertiesOnStructure()) { prop.setValue(value, CmsProperty.TYPE_INDIVIDUAL); } else { prop.setValue(value, CmsProperty.TYPE_SHARED); } return prop; }
newProperty.setAutoCreatePropertyDefinition(true); properties.remove(newProperty); properties.add(newProperty); String value = (String)entry.getValue(); newProperty = new CmsProperty(key, value, null); newProperty.setAutoCreatePropertyDefinition(true); properties.remove(newProperty); properties.add(newProperty);
property.setAutoCreatePropertyDefinition(true);
currentProperty.setAutoCreatePropertyDefinition(true);
currentProperty.setAutoCreatePropertyDefinition(true);