首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >cm的自定义子类型:文件夹无法工作

cm的自定义子类型:文件夹无法工作
EN

Stack Overflow用户
提问于 2015-12-05 17:36:53
回答 1查看 618关注 0票数 0

我试图创建一个新的文件夹类型,它继承了cm: myModel.xml中的所有内容,因此我在myModel.xml下创建了一个xml文件,并向其中添加了以下内容:

代码语言:javascript
复制
<?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中添加了下面一行

代码语言:javascript
复制
<value>alfresco/extension/models/myModel.xml</value>

最后在tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml:中

代码语言:javascript
复制
<type name="cm:folder">
            <subtype name="my:folder1" />
            <subtype name="my:folder2" />
</type>

下面的详细信息-> change显示了我的子类型,但是当我尝试应用它们时,我得到了“不能更改文档的类型.”

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-12-07 06:08:02

上下文文件中的模型文件名被提到为

代码语言:javascript
复制
<value>alfresco/extension/models/custModel.xml</value>

在您的描述中,您将名称称为"myModel.xml",这是一个错误吗?否则,您的文件条目看起来没问题。希望你是正确地放置这些条目。

这一项

代码语言:javascript
复制
<namespace uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>

应该是<imports>标记的一部分,而不是<namespaces>

就像这样

代码语言:javascript
复制
 <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>
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34108632

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档