Added sys:incomplete aspect.

Extended <mandatory> definition in the DD.
The "mandatory" properties in our system have, until now, been optional, i.e. the integrity has not been enforced.
It is possible to have
   <mandatory enforced="true">true</mandatory>, which means "mandatory and enforced", but
   <mandatory enforced="false">true</mandatory>, which means "mandatory but not enforced".
Our system properties have been marked as "mandatory".
Dublin core has had the properties marked as "required".  Currently, if the Dublin Core is added, the node is tagged with sys:incomplete.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2562 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2006-03-21 21:46:15 +00:00
parent 764675cb2a
commit fd13fe7a51
23 changed files with 718 additions and 53 deletions

View File

@@ -139,15 +139,27 @@ import org.alfresco.service.namespace.QName;
property.setDefaultValue(defaultValue == null ? propertyDef.getDefaultValue() : defaultValue);
// Process Mandatory Value
Boolean isMandatory = override.isMandatory();
if (isMandatory != null)
Boolean isOverrideMandatory = override.isMandatory();
boolean isOverrideMandatoryEnforced = override.isMandatoryEnforced();
if (isOverrideMandatory != null && propertyDef.isMandatory())
{
if (propertyDef.isMandatory() == true && isMandatory == false)
// the override specified whether the property should be mandatory or not
// check that the mandatory enforcement is not relaxed
if (!isOverrideMandatory)
{
throw new DictionaryException("Cannot relax mandatory attribute of property " + propertyDef.getName().toPrefixString());
throw new DictionaryException(
"d_dictionary.property.err.cannot_relax_mandatory",
propertyDef.getName().toPrefixString());
}
else if (!isOverrideMandatoryEnforced && propertyDef.isMandatoryEnforced())
{
throw new DictionaryException(
"d_dictionary.property.err.cannot_relax_mandatory_enforcement",
propertyDef.getName().toPrefixString());
}
}
property.setMandatory(isMandatory == null ? propertyDef.isMandatory() : isMandatory);
property.setMandatory(isOverrideMandatory == null ? propertyDef.isMandatory() : isOverrideMandatory);
property.setMandatoryEnforced(isOverrideMandatoryEnforced);
// Copy all other properties as they are
property.setDescription(propertyDef.getDescription());
@@ -260,7 +272,11 @@ import org.alfresco.service.namespace.QName;
return m2Property.isMandatory();
}
public boolean isMandatoryEnforced()
{
return m2Property.isMandatoryEnforced();
}
/* (non-Javadoc)
* @see org.alfresco.repo.dictionary.PropertyDefinition#isProtected()
*/