You can grab the PortalCMS service and use the API to create whatever content you need inside the CMS programmatically
For examples of how to do that, look at the CMSAdminPortlet in our codebase and also the test cases in the cms test suite
Actually I do not need to create new content I just need to change what is currently displayed in the CMS portlet.
I can't see any command in the API that allows me to do that. I know I could change the content just by using an URL but I need to change the portlet page on my portlet at the same time via the jbpm navigation.
Hence how can I do both change the content of the CMS and change the page in my custom portlet at the same time in the same action?
Yes... that is a common "UI navigation feature" requierement.
you go from a page to another one, and want the menu to show also the new "active" page.
you need two things, for which the JSR-168 does not give much help.
(but read it anyway... to know what it provide and what to add to it in your own portal).
1) IPC : inter portlet communication. To have the portlet that change it's status (ie: in it's processAction method) warn the others that it has changed. The portlets may share (or send each other) a "fooState" instance that tell them all the properties of the current state.
If they share, it is a "message" IPC. if they send an action, it is more a "event" IPC.
2) caching : if you want these portlet to refresh even if an actionURL did not called them, you may suppress the cache for them. but then, you loose the cache advantage. so to keep it, the best is to reset the cache of the target portlet, when necessary.
for 1) : see the IPC feature, in JSR-168 draft version 2 and in jboss portal 2.6.
These feature of IPC have been developped in these version.
With current version, you can also have a look at :
I have done something like that to have a menu "follow" the change in the portal général UI changes.
for 2) : i am looking at this right now. coming to the forum to see what's about caching mecanism, and how to adapt it to comply with this need.
the need to reset the cache of one portlet with "a command" is not in the JSR-168. I guess this can be done. don't know if it will be easy ... and quite clean programming.
about cache : use the 2.4 SP1 where caching has been debugged intensively.
hope it helps.
The question then becomes: Do you know if the CMS portlet supports IPC? Or do I have to extended so it does?
yes, you have to extend it, so it does.
same for the cache feature (invalidation, if you use it for CMS Portlet), you have to add it.