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?
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?
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.