cancel
Showing results for 
Search instead for 
Did you mean: 

Create rule to specialize document type

rohit_chakrabor
Champ on-the-rise
Champ on-the-rise
I am developing a JAVA webscript to add rules to specific folders. I want to add a rule that uses the Specialize Type action and change the type of document to a custom type. I know the syntax but am not sure how to set the following code to a custom type:

ruleParameters.put(SpecialiseTypeActionExecuter.PARAM_TYPE_NAME, ContentModel.TYPE_CONTENT);   


Instead of ContentModel.TYPE_CONTENT I want to add the custom type.
Any help will be appreciated.
2 REPLIES 2

gravitonian
Star Collaborator
Star Collaborator
Hi,

Let's say you have a Content Model with the following namespace and type:


<namespaces>
    <namespace uri="http://www.alfresco.com/training/model/content/1.0" prefix="alft"/>
</namespaces>

<type name="alft:itDocument">
    <title>My Company IT Document</title>
    <parent>cm:content</parent>
</type>


Then use the following type of syntax (basically you need to create a QName):


ruleParameters.put(SpecialiseTypeActionExecuter.PARAM_TYPE_NAME, QName.createQName("http://www.alfresco.com/training/model/content/1.0", "itDocument"));   

Thanks a lot. This is what I was looking for.