"Change type" Alfresco 中的下拉 Share 完全为空

"Change type" pulldown in Alfresco Share completely empty

我正在学习 Alfresco 5 的 "Content Modelling" 教程。0.d:

http://docs.alfresco.com/5.0/tasks/dev-extensions-content-models-tutorials-create-custom-content.html

教程的一部分是创建 "custom type"。

问题:我无法在 Alfresco Share 中看到 any "types"。

重现步骤:

  1. 登录到 Alfresco (http://localhost:8080/share)

  2. 点击我用演示创建的文档

  3. Select "Change Types" <=下拉列表完全是空的

这是教程指示我们创建的 customModel.xml 文件中的文件:

<model name="my:custommodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
   <imports>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
   ...
   <namespaces>
      <namespace uri="http://www.mycompany.com/model/content/1.0" prefix="my"/>
   ...
   <types>
     <type name="my:doc">   
        <title>MyCompany Generic Document</title>
        <parent>cm:content</parent>
      ...
     <type name="my:marketingDoc">
        <title>MyCompany Marketing Document</title>
        <parent>my:doc</parent>
      ...
     <type name="my:whitepaper">
         <title>MyCompany Whitepaper</title>
         <parent>my:marketingDoc</parent>
      ...

这是我的配置文件中的一个片段,$ALFRESCO/tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml:

 <config evaluator="model-type" condition="my:whitepaper">
   <forms>
     <form>
       <field-visibility>
         <show id="cm:name" />
         <show id="my:product" />
         ...
 <config evaluator="node-type" condition="my:whitepaper">
   <forms>
     <form>
       <field-visibility>
         <show id="cm:name" />
         <show id="my:product" />
         ...
  <types>
     <type name="cm:content">
        <!-- Custom sub-type added for whitepapers -->
        <subtype name="my:whitepaper" />
        ...

     <type name="cm:folder">
     </type>

     <type name="trx:transferTarget">
        <subtype name="trx:fileTransferTarget" />
     </type>
  </types>

解决方案:

为了使自定义类型可见,我需要编辑 $ALFRESCO/tomcat/webapps/share/WEB-INF/classes/alfresco/messages/slingshot.properties:

  ...
# Types
type.cm_content=Content Base Type
type.cm_folder=Folder Base Type
type.trx_transferTarget=Transfer Target
type.trx_fileTransferTarget=File Transfer Target

type.my_doc=Tutorial Doctype
type.my_marketingdoc=Tutorial Marketing Doctype
type.my_whitepaper=Tutorial Whitepaper Doctype
  <= This will make the types visible in the
     "Alfresco Share > My Documents > Change Type" pull-down

您上传的文档默认为 cm:content 类型。

如果您想更改其类型,请在存储库内容模型中定义您自己的类型,如下所示:

<type name="my:subtype">
        <title>My subtype</title>
        <parent>cm:content</parent>
  </type>

然后在 share-config-custom.xml 中将其添加为 cm:content 的子类型,如下所示:

  <type name="cm:content">
        <subtype name="my:subtype" />
    </type>