Today I was working on a new feature in the CMS. I had to do some flowscript coding in order to implement this feature. By default you can create an instance of a Java class in flowscript by using the following syntax:
cocoon.createObject(Packages.nl.hippo.cms.Class);
Since I did not want to hardcode my class file, but wanted to create a configurable object, I had to find a solution. So first I set the value of the variable in the DefaultsModule. (this can also be a XMLFileInputModule so you can really make this configurable from outside of you Cocoon application.
So now from my flowscript I can fetch the value of the cms-object constant.
You will have to declare the import for the Cocoon input package at the top of your flowscript before this will work.
Well that’s it! I could not find any documentation about how to do this. I hope this small chunk of code will help others out in the future.
Usefull links: