cancel
Showing results for 
Search instead for 
Did you mean: 

Change cm:folder to custom folder type

mplebani
Champ in-the-making
Champ in-the-making
Hi,
In my content model I specialize the cm:folder with two different types: mp:customFolderA and mp:customFolderB.

In the site folder I created a mp:customFolderA called mplebani using JCR API. Using behaviors I'm able to intercept any changes in this mplebani folder, like subfolder creation.

Any time in the mplebani folder a new folder is create using WebDAV access I want to change the primary type of this folder from cm:folder to mp:customFolderB.

Is there a way using JCR or Alfresco Service to change the primary type of a folder?

– Marco
4 REPLIES 4

sujaypillai
Confirmed Champ
Confirmed Champ
Hello Marco,

I think attaching an aspect to the child node to inherit the parent type may help you out.

Check out more here : http://docs.alfresco.com/4.0/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Fconcepts%2Fmetadata-mo...

mplebani
Champ in-the-making
Champ in-the-making
Hi,
probably my post was misunderstading. Let me try to explain my problem better.

1. Using a webscript I create a mp:customFolderA in the Site folder. This is an initial setup for the content repository.
2. After the setup made by an administrator, fhe final user use ONLY the WebDAV access. It creates folder and upload files. Using standard Alfresco capabilities when he creates a folder using WebDAV this folder has cm:folder as type.
3. I need that every time the user creates a folder using WebDAV the folder has mp:customFolderB as type. Moreover, the "behavior" set some mp:customFolderB folder metadata based on the folder name.


So, the first problem for me is to change the cm:folder to the mp:customFolderB. I'm trying to do this thing programmatically in a behavior, but I think there is an automatic way to have this process.

Cheers
– Marco

mrogers
Star Contributor
Star Contributor
Probably the easiest way to do this is with a rule on the parent folder.

mplebani
Champ in-the-making
Champ in-the-making
Hi mrogers,
do you mean there is a rule that is able to change the type from cm:folder to a custom folder? If yes, can you provide me more information?

Moreover, if I correctly understood, rules are triggered manually by the alfresco web-app user, behaviors are rule automatically triggered.
I think the behavior is better than the rule, in my context. Do you agree?

Thanks
– Marco