cancel
Showing results for 
Search instead for 
Did you mean: 

Add a custom aspect dynamically.

maina
Champ in-the-making
Champ in-the-making
Hi all,

I'm try to find a way to add a custom aspect dynamically.

I read that in Alfresco I can create a custom aspect adding in the customModel.xml file a tag <aspect name="custom:detail"> …
When Alfresco start I can set a new aspect directly via my java application
as content.setProperty("custom:key", "value");.
In this case I assume that I have to know the custom aspects in advance.

My problem is that I don't know the aspect associated to the document and I can not create in the customModel.xml with cutom aspects.
For each typology of documents I have different aspects and so I have to create them dynamically.

Can I do that with SDK?

Many thanks.
Andrea
1 REPLY 1

andy
Champ on-the-rise
Champ on-the-rise
Hi

Your aspects need to be defiend in a model. You can add an aspect to a node at any time using the Java API.

You can also create rules on a folder to do soemthing like - when a file is added to this folder and has ending .doc - add this aspect. You can extract document metadata in this way. You can add you own actions.

See the wiki for more details.

Andy