cancel
Showing results for 
Search instead for 
Did you mean: 

Using aspects alone instead of types to set properties on documents

kartech11
Confirmed Champ
Confirmed Champ

I have just been reading about aspects and types in Alfresco content model.

I very basic question that I have is that I feel types are very restrictive compared to aspects. 

Lets say I upload a document that is a  Cash Invoice document and associate some values to the invoice. Later I realise that it was actually a credit invoice document. If I had uploaded the document to a type, then to reassign it to a different type I would have to delete and reupload the document. On the other hand, had I attached an aspect to the invoice document and later found out that it was an incorrect aspect, I could go to manage aspect and add/remove aspect and modify the properties in the aspect. This gives me more flexibility.

So my question is, 

1. Are there any drawbacks to the above approach of having only aspects instead of types?

2. Can I add/remove type of a document after it has been uploaded to alfresco?

2 REPLIES 2

jayesh_prajapat
Star Contributor
Star Contributor

Hi 

Here is my input on your questions,

1. Are there any drawbacks to the above approach of having only aspects instead of types?

This is completely depends on problem you are solving. The example you quoted above, I don't see any issue because all you are interested in is property. 

Any single document in repository would belong to at least on content type. If you want to identify your document with some type name and with some set of default properties, you can certainly use type approach. 

In other hand, aspect you can use to decide behavior for your document. If I quot some random example here then, you may want to have some set of additional property with document if invoice is paid vs. invoice is rejected. in this case you can plan to have aspect with respective property,  ex. paid aspect may have property with which medium its paid, via which bank etc. and reject invoice aspect may have property like reason for rejection etc.

2. Can I add/remove type of a document after it has been uploaded to alfresco?

You can change content type once after document is created. You can also do the same using action in Alfresco share.

Hope above comment will helpful to you!

-Jayesh Prajapati

www.enprowess.com

Thanks Jayes, does using aspects affect my searches?