cm:文件夹的Alfresco自定义子类型不工作
我试图创建一个新的文件夹类型,它继承了cm:folder的所有内容,因此我在tomcat/shared/classes/alfresco/extension/models下为myModel.xml创建了一个xml文件,并向其中添加了以下内容:cm:文件夹的Alfresco自定义子类型不工作,alfresco,models,alfresco-share,Alfresco,Models,Alfresco Share,我试图创建一个新的文件夹类型,它继承了cm:folder的所有内容,因此我在tomcat/shared/classes/alfresco/extension/models下为myModel.xml创建了一个xml文件,并向其中添加了以下内容: <?xml version="1.0" encoding="UTF-8"?> <!-- xsi:schemaLocation="http://www.alfresco.org/model/dictionary/1.0 model
<?xml version="1.0" encoding="UTF-8"?>
<!-- xsi:schemaLocation="http://www.alfresco.org/model/dictionary/1.0 modelSchema.xsd" -->
<model name="my:custmodel"
xmlns="http://www.alfresco.org/model/dictionary/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<description>custom folder test</description>
<author>Max Mustermann</author>
<published>2015-11-24</published>
<version>1.0</version>
<imports>
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
<import uri="http://www.alfresco.org/model/system/1.0" prefix="sys"/>
</imports>
<namespaces>
<namespace uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
<namespace uri="http://www.alfresco.org/model/rendition/1.0" prefix="rn"/>
<namespace uri="http://www.alfresco.org/model/exif/1.0" prefix="exif"/>
<namespace uri="http://www.alfresco.org/model/audio/1.0" prefix="audio"/>
<namespace uri="http://www.alfresco.org/model/webdav/1.0" prefix="webdav"/>
<namespace uri="http://www.example.com/model/content/1.0" prefix="my" />
</namespaces>
<types>
<type name="my:folder1">
<title>folder1</title>
<parent>cm:folder</parent>
<archive>true</archive>
</type>
<type name="my:folder2">
<title>folder2</title>
<parent>cm:folder</parent>
<archive>true</archive>
</type>
</types>
自定义文件夹测试
马克斯·穆斯特曼
2015-11-24
1
折叠1
cm:文件夹
真的
折叠2
cm:文件夹
真的
然后我在tomcat/shared/classes/alfresco/extension/custom-model-context.xml中添加了以下行
<value>alfresco/extension/models/myModel.xml</value>
alfresco/extension/models/myModel.xml
最后在tomcat/shared/classes/alfresco/web extension/share-config-custom.xml中:
<type name="cm:folder">
<subtype name="my:folder1" />
<subtype name="my:folder2" />
</type>
现在,在“详细信息->更改类型”下,我的子类型出现了,但当我尝试应用它们时,我得到“无法更改文档类型…”上下文文件中的模型文件名如下所示
<value>alfresco/extension/models/custModel.xml</value>
alfresco/extension/models/custModel.xml
在您的描述中,您的名字是“myModel.xml”,这是打字错误吗?否则,您的文件条目看起来很正常。希望您正确放置这些条目
此条目
<namespace uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
应该是
标记的一部分,而不是
像这样的
<imports>
<!-- Import Alfresco Dictionary Definitions -->
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
<!-- Import Alfresco Content Domain Model Definitions -->
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
</imports>
我更改了这篇stackoverflow帖子的真实模型名,并在给小费时犯了这个错误,而且xml标题也丢失了,我现在更正了它…非常感谢,我刚到alfresco,但在你的帮助下我成功了