【发布时间】:2015-12-13 21:10:18
【问题描述】:
我尝试创建一个新的文件夹类型,它继承了 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 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>
现在在 details->change Typ 下,出现了我的子类型,但是当我尝试应用它们时,我得到“无法更改文档类型...”
【问题讨论】:
标签: alfresco models alfresco-share