Reputation: 121881
I'm working through the "Content Modelling" tutorials for Alfresco 5.0.d:
Part of the tutorial is creating a "custom type".
PROBLEM: I'm not able to see any "types" in Alfresco Share.
STEPS TO REPRODUCE:
Log on to Alfresco (http://localhost:8080/share)
Click on a document I created with the the demo
Select "Change Types" <= the pulldown is completely empty
This is from the customModel.xml
file the tutorial instructed us to create:
<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>
...
Here is a snippet from my configuration file, $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>
SOLUTION:
To make the custom type visible, I needed to edit $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
Upvotes: 0
Views: 785
Reputation: 1419
A document you upload will be of type cm:content by default.
If you want to change its type, define your own type in a repository content model, like this:
<type name="my:subtype"> <title>My subtype</title> <parent>cm:content</parent> </type>
Then add it as a subtype for cm:content in share-config-custom.xml like this:
<type name="cm:content"> <subtype name="my:subtype" /> </type>
Upvotes: 2