cancel
Showing results for 
Search instead for 
Did you mean: 

how to change object's type?

smola
Champ in-the-making
Champ in-the-making
I would like an JCR alternative to this foundation api:

NodeService.setType()

If it is possible. I'm importing files through CIFS and I set up a rule to call my action which will fill some properties and change the cm:custom type to one of my own.

thanks
2 REPLIES 2

derek
Star Contributor
Star Contributor
Hi,

If you wish to use Alfresco as a JCR repository, then you'll need to perform all interaction via the JCR interface.  Otherwise, all the other Alfresco clients (CIFS, WebClient, FTP, etc) use the native Alfresco contentModel.xml.  You'll need to use JCR-specific clients to interact with the JCR model, but data from both types of models can reside in the same repository.

What you are doing with the custom action is fairly normal.  As long as you specialize cm:file or cm:folder to a subtype, then the applications around the repository will continue to work normally.

Regards

davidc
Star Contributor
Star Contributor
I don't recall there being a JCR method to change node type.  However, you can drop into native Alfresco API calls whilst using JCR.  An example is provided at:

http://wiki.alfresco.com/wiki/Introducing_the_Alfresco_Java_Content_Repository_API#Mixing_JCR_and_Al...

So, you can call NodeService.setType() for a JCR Node.