Big honkin' merge from head. Sheesh!

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3617 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-08-27 01:01:30 +00:00
parent e2c66899cc
commit 8031cc6574
322 changed files with 20776 additions and 6550 deletions

View File

@@ -46,7 +46,6 @@ import org.alfresco.service.namespace.QName;
protected M2Class m2Class;
protected QName name;
protected QName parentName = null;
protected boolean archive = false;
private Map<QName, M2PropertyOverride> propertyOverrides = new HashMap<QName, M2PropertyOverride>();
private Map<QName, PropertyDefinition> properties = new HashMap<QName, PropertyDefinition>();
@@ -57,8 +56,9 @@ import org.alfresco.service.namespace.QName;
private List<AspectDefinition> defaultAspects = new ArrayList<AspectDefinition>();
private List<QName> defaultAspectNames = new ArrayList<QName>();
private List<AspectDefinition> inheritedDefaultAspects = new ArrayList<AspectDefinition>();
private Boolean archive = null;
private Boolean inheritedArchive = null;
/**
* Construct
*
@@ -74,7 +74,7 @@ import org.alfresco.service.namespace.QName;
// Resolve Names
this.name = QName.createQName(m2Class.getName(), resolver);
this.archive = m2Class.isArchive();
this.archive = m2Class.getArchive();
if (m2Class.getParentName() != null && m2Class.getParentName().length() > 0)
{
this.parentName = QName.createQName(m2Class.getParentName(), resolver);
@@ -162,8 +162,8 @@ import org.alfresco.service.namespace.QName;
public String toString()
{
StringBuilder sb = new StringBuilder(120);
sb.append("ClassDef ")
.append("[ name=").append(name)
sb.append("ClassDef")
.append("[name=").append(name)
.append("]");
return sb.toString();
}
@@ -191,6 +191,15 @@ import org.alfresco.service.namespace.QName;
{
((M2AssociationDefinition)def).resolveDependencies(query);
}
for (Map.Entry<QName, M2PropertyOverride> override : propertyOverrides.entrySet())
{
PropertyDefinition propDef = query.getProperty(override.getKey());
if (propDef == null)
{
throw new DictionaryException("Class " + name.toPrefixString() + " attempting to override property " + override.getKey().toPrefixString() + " which does not exist");
}
}
for (QName aspectName : defaultAspectNames)
{
@@ -280,6 +289,13 @@ import org.alfresco.service.namespace.QName;
inheritedDefaultAspects.add(def);
}
}
// resolve archive inheritance
if (parentClass != null && archive == null)
{
// archive not explicitly set on this class and there is a parent class
inheritedArchive = ((M2ClassDefinition)parentClass).isArchive();
}
}
/* (non-Javadoc)
@@ -340,8 +356,23 @@ import org.alfresco.service.namespace.QName;
return (m2Class instanceof M2Aspect);
}
/**
* @return Returns the archive flag, which defaults to <tt>false</tt>
*/
public boolean isArchive()
{
if (archive == null)
{
if (inheritedArchive != null)
{
return inheritedArchive.booleanValue();
}
else
{
// default to false
return false;
}
}
return archive;
}