我试图创建一个新的文件夹类型,它继承了cm: myModel.xml中的所有内容,因此我在myModel.xml下创建了一个xml文件,并向其中添加了以下内容:
<?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>
然后,我在tomcat/shared/classes/alfresco/extension/custom-model-context.xml中添加了下面一行
<value>alfresco/extension/models/myModel.xml</value>最后在tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml:中
<type name="cm:folder">
<subtype name="my:folder1" />
<subtype name="my:folder2" />
</type>下面的详细信息-> change显示了我的子类型,但是当我尝试应用它们时,我得到了“不能更改文档的类型.”
发布于 2015-12-07 06:08:02
上下文文件中的模型文件名被提到为
<value>alfresco/extension/models/custModel.xml</value>在您的描述中,您将名称称为"myModel.xml",这是一个错误吗?否则,您的文件条目看起来没问题。希望你是正确地放置这些条目。
这一项
<namespace uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>应该是<imports>标记的一部分,而不是<namespaces>
就像这样
<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>https://stackoverflow.com/questions/34108632
复制相似问题