/** * Wraps a null value into a null property, and returns all other values unchanged.<p> * * @param prop the value to wrap * * @return a wrapped null property, or the original prop if it wasn't null */ public static CmsProperty wrapIfNull(CmsProperty prop) { if (prop == null) { return getNullProperty(); } else { return prop; } }
entry = (Map.Entry)itFilterProperties.next(); property = cms.readPropertyObject(resource, (String)entry.getKey(), true); if (property == CmsProperty.getNullProperty()) { continue; } else {
/** * Reads a property object from a resource specified by a property name.<p> * * Returns <code>{@link CmsProperty#getNullProperty()}</code> if the property is not found.<p> * * @param dbc the current database context * @param resource the resource where the property is read from * @param key the property key name * @param search if <code>true</code>, the property is searched on all parent folders of the resource. * if it's not found attached directly to the resource. * * @return the required property, or <code>{@link CmsProperty#getNullProperty()}</code> if the property was not found * * @throws CmsException if something goes wrong */ public CmsProperty readPropertyObject(CmsDbContext dbc, CmsResource resource, String key, boolean search) throws CmsException { // NOTE: Do not call readPropertyObject(dbc, resource, key, search, null) for performance reasons // use the list reading method to obtain all properties for the resource List<CmsProperty> properties = readPropertyObjects(dbc, resource, search); int i = properties.indexOf(new CmsProperty(key, null, null)); if (i >= 0) { // property has been found in the map CmsProperty result = properties.get(i); // ensure the result value is not frozen return result.cloneAsProperty(); } return CmsProperty.getNullProperty(); }
} else { result = CmsProperty.getNullProperty();
CmsProperty titleProp = CmsProperty.getNullProperty();
CmsProperty titleProp = CmsProperty.getNullProperty();
/** * Returns the encoding of the file. * Encoding is read from the content-encoding property and defaults to the systems default encoding. * Since properties can change without rewriting content, the actual encoding can differ. * * @param cms {@link CmsObject} used to read properties of the given file. * @param file the file for which the encoding is requested * @return the file's encoding according to the content-encoding property, or the system's default encoding as default. */ public static String getEncoding(CmsObject cms, CmsResource file) { CmsProperty encodingProperty = CmsProperty.getNullProperty(); try { encodingProperty = cms.readPropertyObject(file, CmsPropertyDefinition.PROPERTY_CONTENT_ENCODING, true); } catch (CmsException e) { LOG.debug(e.getLocalizedMessage(), e); } return CmsEncoder.lookupEncoding(encodingProperty.getValue(""), OpenCms.getSystemInfo().getDefaultEncoding()); }
if (property == CmsProperty.getNullProperty()) {
if (property == CmsProperty.getNullProperty()) {
return (property != null) ? property : CmsProperty.getNullProperty();
return (property != null) ? property : CmsProperty.getNullProperty();
/** * Enumeration class for the mode parameter in the * {@link CmsDriverManager#readChangedResourcesInsideProject(CmsDbContext, CmsUUID, CmsReadChangedProjectResourceMode)} * method.<p> */ private static class CmsReadChangedProjectResourceMode { /** * Default constructor.<p> */ protected CmsReadChangedProjectResourceMode() { // noop } }
/** * Initializes the comparator key based on the member variables.<p> * * @param resource the resource to use * @param cms the current OpenCms user contxt * @param property the name of the sort property (case sensitive) */ private void init(CmsResource resource, CmsObject cms, String property) { try { cms.readPropertyDefinition(property); CmsProperty prop = cms.readPropertyObject(resource, property, false); if (prop == CmsProperty.getNullProperty()) { m_propertyValue = ""; } else { m_propertyValue = prop.getValue(); } } catch (CmsDbEntryNotFoundException dbe) { // property are not configured throw new CmsIllegalArgumentException( Messages.get().container(Messages.ERR_COLLECTOR_PARAM_PROPERTY_NOT_FOUND_1, property)); } catch (CmsException cmse) { // something's gone wrong... cmse.printStackTrace(); } }
macro, false); if (property != CmsProperty.getNullProperty()) { return property.getValue(); try { CmsProperty property = m_cms.readPropertyObject(m_cms.getRequestContext().getUri(), macro, true); if (property != CmsProperty.getNullProperty()) { return property.getValue();
return (property != null) ? property : CmsProperty.getNullProperty();
macro, false); if (property != CmsProperty.getNullProperty()) { return property.getValue(); try { CmsProperty property = m_cms.readPropertyObject(m_cms.getRequestContext().getUri(), macro, true); if (property != CmsProperty.getNullProperty()) { return property.getValue();
&& (propertyLoginForm != CmsProperty.getNullProperty()) && CmsStringUtil.isNotEmpty(propertyLoginForm.getValue())) {
&& (propertyLoginForm != CmsProperty.getNullProperty()) && CmsStringUtil.isNotEmpty(propertyLoginForm.getValue())) {
CmsProperty styleProp = CmsProperty.getNullProperty(); if (CmsStringUtil.isNotEmpty(getParamXsltFile())) { styleProp = getCms().readPropertyObject(
CmsProperty styleProp = CmsProperty.getNullProperty(); if (CmsStringUtil.isNotEmpty(getParamXsltFile())) { styleProp = getCms().readPropertyObject(