Content and folder node archival

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2767 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2006-05-04 16:04:55 +00:00
parent 35f3eda32f
commit fcad8b7a1f
29 changed files with 722 additions and 198 deletions

View File

@@ -145,6 +145,17 @@ public class DictionaryDAOTest extends TestCase
// make sure it is the correct type of constraint
assertTrue("Expected type REGEX constraint", constraint instanceof RegexConstraint);
}
public void testArchive()
{
QName testFileQName = QName.createQName(TEST_URL, "file");
ClassDefinition fileClassDef = service.getClass(testFileQName);
assertTrue("File type should have the archive flag", fileClassDef.isArchive());
QName testFolderQName = QName.createQName(TEST_URL, "folder");
ClassDefinition folderClassDef = service.getClass(testFolderQName);
assertFalse("Folder type should not have the archive flag", folderClassDef.isArchive());
}
public void testMandatoryEnforced()
{

View File

@@ -130,7 +130,11 @@ import org.alfresco.service.namespace.QName;
return type.isAspect();
}
public boolean isArchive()
{
return type.isArchive();
}
/* (non-Javadoc)
* @see org.alfresco.repo.dictionary.ClassDefinition#getProperties()
*/

View File

@@ -32,6 +32,7 @@ public abstract class M2Class
private String title = null;
private String description = null;
private String parentName = null;
private boolean archive = false;
private List<M2Property> properties = new ArrayList<M2Property>();
private List<M2PropertyOverride> propertyOverrides = new ArrayList<M2PropertyOverride>();
@@ -91,6 +92,16 @@ public abstract class M2Class
}
public boolean isArchive()
{
return archive;
}
public void setArchive(boolean archive)
{
this.archive = archive;
}
public M2Property createProperty(String name)
{
M2Property property = new M2Property();

View File

@@ -46,6 +46,7 @@ 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>();
@@ -73,6 +74,7 @@ import org.alfresco.service.namespace.QName;
// Resolve Names
this.name = QName.createQName(m2Class.getName(), resolver);
this.archive = m2Class.isArchive();
if (m2Class.getParentName() != null && m2Class.getParentName().length() > 0)
{
this.parentName = QName.createQName(m2Class.getParentName(), resolver);
@@ -316,14 +318,6 @@ import org.alfresco.service.namespace.QName;
}
return value;
}
/* (non-Javadoc)
* @see org.alfresco.repo.dictionary.ClassDefinition#isAspect()
*/
public boolean isAspect()
{
return (m2Class instanceof M2Aspect);
}
/* (non-Javadoc)
* @see org.alfresco.repo.dictionary.ClassDefinition#getParentName()
@@ -333,6 +327,19 @@ import org.alfresco.service.namespace.QName;
return parentName;
}
/* (non-Javadoc)
* @see org.alfresco.repo.dictionary.ClassDefinition#isAspect()
*/
public boolean isAspect()
{
return (m2Class instanceof M2Aspect);
}
public boolean isArchive()
{
return archive;
}
/* (non-Javadoc)
* @see org.alfresco.repo.dictionary.ClassDefinition#getProperties()
*/

View File

@@ -110,6 +110,7 @@
<type name="test:file">
<parent>test:base</parent>
<archive>true</archive>
<properties>
<property name="test:fileprop">

View File

@@ -60,6 +60,7 @@
<value name="title" field="title" usage="optional"/>
<value name="description" field="description" usage="optional"/>
<value name="parent" field="parentName" usage="optional"/>
<value name="archive" field="archive" usage="optional"/>
<structure name="properties" usage="optional">
<collection field="properties" item-type="org.alfresco.repo.dictionary.M2Property" factory="org.alfresco.repo.dictionary.M2Model.createList"/>