Added types cm:avmcontent (derived from cm:content) TYPE_AVM_CONTENT and

cm:avmfolder (derived from cm:folder) TYPE_AVM_FOLDER as handles for UI.
Fixed configuration goofs I introduced recently that caused Node Browsing
to barf on content nodes. 


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3725 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-09-08 04:47:21 +00:00
parent 9c8ae2b7c4
commit 08ecce31b6
6 changed files with 21 additions and 9 deletions

View File

@@ -79,6 +79,11 @@
</properties> </properties>
</type> </type>
<type name="cm:avmcontent">
<title>AVM Content</title>
<parent>cm:content</parent>
</type>
<type name="cm:dictionaryModel"> <type name="cm:dictionaryModel">
<title>Dictionary Model</title> <title>Dictionary Model</title>
<parent>cm:content</parent> <parent>cm:content</parent>
@@ -138,6 +143,11 @@
<parent>cm:folder</parent> <parent>cm:folder</parent>
</type> </type>
<type name="cm:avmfolder">
<title>AVM Folder</title>
<parent>cm:folder</parent>
</type>
<type name="cm:person"> <type name="cm:person">
<title>Person</title> <title>Person</title>
<parent>sys:base</parent> <parent>sys:base</parent>

View File

@@ -68,7 +68,7 @@
<ref bean="dictionaryService"/> <ref bean="dictionaryService"/>
</property> </property>
<property name="avmService"> <property name="avmService">
<ref bean="AVMService"/> <ref bean="avmService"/>
</property> </property>
<property name="policyComponent"> <property name="policyComponent">
<ref bean="policyComponent"/> <ref bean="policyComponent"/>

View File

@@ -97,7 +97,7 @@ public interface ContentModel
// content type and aspect constants // content type and aspect constants
static final QName TYPE_CONTENT = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "content"); static final QName TYPE_CONTENT = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "content");
static final QName PROP_CONTENT = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "content"); static final QName PROP_CONTENT = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "content");
static final QName PROP_READONLY = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "readonly"); static final QName TYPE_AVM_CONTENT = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "avmcontent");
// title aspect // title aspect
static final QName ASPECT_TITLED = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "titled"); static final QName ASPECT_TITLED = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "titled");
@@ -143,6 +143,7 @@ public interface ContentModel
static final QName TYPE_FOLDER = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "folder"); static final QName TYPE_FOLDER = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "folder");
/** child association type supported by {@link #TYPE_FOLDER} */ /** child association type supported by {@link #TYPE_FOLDER} */
static final QName ASSOC_CONTAINS = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "contains"); static final QName ASSOC_CONTAINS = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "contains");
static final QName TYPE_AVM_FOLDER = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "avmfolder");
// person // person
static final QName TYPE_PERSON = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "person"); static final QName TYPE_PERSON = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "person");

View File

@@ -280,7 +280,7 @@ public class AVMContext implements ApplicationContextAware
{ {
if (fNodeService == null) if (fNodeService == null)
{ {
fNodeService = (NodeService)fAppContext.getBean("NodeService"); fNodeService = (NodeService)fAppContext.getBean("nodeService");
} }
return fNodeService; return fNodeService;
} }

View File

@@ -268,11 +268,11 @@ public class AVMNodeService extends AbstractNodeServiceImpl implements NodeServi
// Do the creates for supported types, or error out. // Do the creates for supported types, or error out.
try try
{ {
if (nodeTypeQName.equals(ContentModel.TYPE_FOLDER)) if (nodeTypeQName.equals(ContentModel.TYPE_AVM_FOLDER))
{ {
fAVMService.createDirectory(avmPath, nodeName); fAVMService.createDirectory(avmPath, nodeName);
} }
else if (nodeTypeQName.equals(ContentModel.TYPE_CONTENT)) else if (nodeTypeQName.equals(ContentModel.TYPE_AVM_CONTENT))
{ {
fAVMService.createFile(avmPath, nodeName); fAVMService.createFile(avmPath, nodeName);
} }
@@ -450,11 +450,11 @@ public class AVMNodeService extends AbstractNodeServiceImpl implements NodeServi
(String)avmVersionPath[1]); (String)avmVersionPath[1]);
if (desc.isDirectory()) if (desc.isDirectory())
{ {
return ContentModel.TYPE_FOLDER; return ContentModel.TYPE_AVM_FOLDER;
} }
else else
{ {
return ContentModel.TYPE_CONTENT; return ContentModel.TYPE_AVM_CONTENT;
} }
} }
catch (AVMNotFoundException e) catch (AVMNotFoundException e)
@@ -1153,6 +1153,7 @@ public class AVMNodeService extends AbstractNodeServiceImpl implements NodeServi
*/ */
public List<ChildAssociationRef> getChildAssocs(NodeRef nodeRef) throws InvalidNodeRefException public List<ChildAssociationRef> getChildAssocs(NodeRef nodeRef) throws InvalidNodeRefException
{ {
Object [] avmVersionPath = AVMNodeConverter.ToAVMVersionPath(nodeRef); Object [] avmVersionPath = AVMNodeConverter.ToAVMVersionPath(nodeRef);
int version = (Integer)avmVersionPath[0]; int version = (Integer)avmVersionPath[0];
String path = (String)avmVersionPath[1]; String path = (String)avmVersionPath[1];

View File

@@ -2300,7 +2300,7 @@ public class AVMServiceTest extends AVMServiceTestBase
setupBasicTree(); setupBasicTree();
FileFolderService ffs = (FileFolderService)fContext.getBean("FileFolderService"); FileFolderService ffs = (FileFolderService)fContext.getBean("FileFolderService");
assertTrue(ffs.create(AVMNodeConverter.ToNodeRef(-1, "main:/a/b/c"), assertTrue(ffs.create(AVMNodeConverter.ToNodeRef(-1, "main:/a/b/c"),
"banana", ContentModel.TYPE_CONTENT) != null); "banana", ContentModel.TYPE_AVM_CONTENT) != null);
fService.createSnapshot("main"); fService.createSnapshot("main");
System.out.println(recursiveList("main", -1, true)); System.out.println(recursiveList("main", -1, true));
} }