我正在完成内容建模" Alfresco 5.0.d的教程:
本教程的一部分是创建一个"自定义类型"。
问题:我无法看到任何"类型"在Alfresco Share。
再现的步骤:
登录Alfresco(http://localhost:8080/share)
点击我使用演示
选择"更改类型" < =下拉完全为空
这是教程指示我们创建的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
答案 0 :(得分:2)
您上传的文档默认为cm:content。
如果要更改其类型,请在存储库内容模型中定义您自己的类型,如下所示:
<type name="my:subtype"> <title>My subtype</title> <parent>cm:content</parent> </type>
然后将其作为cm:content的子类型添加到share-config-custom.xml中,如下所示:
<type name="cm:content"> <subtype name="my:subtype" /> </type>