cancel
Showing results for 
Search instead for 
Did you mean: 

Prefilling (custom) properties

nils_kassube
Champ in-the-making
Champ in-the-making
How do I prefill document properties via server-side JavaScript or, if it has to be, Java code? Is there documentation on how to build your own data type?

Cheers,
Nils
3 REPLIES 3

dozyarmadillo
Champ on-the-rise
Champ on-the-rise
I would start by checking out the developer guide at http://wiki.alfresco.com/wiki/Developer_Guide#Creating_new_Content_Models. You should find infomation on creating new content models there.

Regards

Mark

nils_kassube
Champ in-the-making
Champ in-the-making
I've read the wiki before posting the question. The documentation describes how to create your own content model, but only using existing data types (string, etc.)  That is why I did ask 😉

Is it so unusal to add a "computed property" to a document? Or did I overlook something obvious?

Cheers,
Nils

rivarola
Champ on-the-rise
Champ on-the-rise
I've also had a look at data types to extend them but it appears that they are referenced as enums in the Java code and thus cannot be extended without modifying native Alfresco code.
The usual way to add computed properties is through the aspects. Your aspect will declare a custom property and a custom behaviour will re-compute it when some events are trigerred.
Have a look at the NodeServicePolicies interface for the policies entry point.