我正在研究Alfresco 5.0.d的“内容建模”教程:
http://docs.alfresco.com/5.0/tasks/dev-extensions-content-models-tutorials-create-custom-content.html
本教程的一部分是创建一个“自定义类型”。
问题:我不能看到任何“类型”在阿尔弗雷科分享。
复制步骤:
这是本教程指示我们创建的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发布于 2015-12-11 12:11:55
默认情况下,上载的文档类型为cm:content。
如果要更改其类型,请在存储库内容模型中定义自己的类型,如下所示:
我的子类型cm:内容
然后在share-config-custom.xml中将其添加为cm:content的子类型,如下所示:
https://stackoverflow.com/questions/34214940
复制相似问题