-
1. Re: default portlet preferences
Peter Johnson Aug 4, 2006 11:08 AM (in response to P P)Why not just hard-code the value in your Java source?
-
2. Re: default portlet preferences
P P Aug 7, 2006 2:49 AM (in response to P P)I want admin to be able to modify it from the portlet itself, but not to influence only his preferences, but also the default preferences.
-
3. Re: default portlet preferences
Antoine Herzog Aug 7, 2006 8:00 PM (in response to P P)look at the Management Portlet and how it does this ?
you will find thing that you can reuse for what you want to do in the Edit mode of your portlet...
look also at the concept of Dynamicity, in the wiki and forum (and the web, as I quit remember Roy Russo has written things on this).
it is what allow the administrator to modify the portal configuration dinamically...
The configuration of a portlet is stored in the database of jbp, so the default preference are there to.
It is were you must change them for what you want to do. -
4. Re: default portlet preferences
P P Aug 8, 2006 4:00 AM (in response to P P)The Management Portlet isn't written by jboss, so I can't get a look at
its code.
I've seen the preferences in the database, but I want to change them
programmaticaly -- how can I access them from the code? -
5. Re: default portlet preferences
P P Aug 8, 2006 4:15 AM (in response to P P)I think I could do it by getting the reference to the current instance and then by calling getPreferences() I would have had access to management of these preferences (I'm also not sure whether it would affect only current user or the default preferences).
But I am experiencing a problem -- I get the reference to the InstanceContainer, but when I try to call getInstance(..), a Hibernate exception saying 'unable to locate current JTA transaction' is thrown.
What could I do (I've got no idea about Hibernate). -
6. Re: default portlet preferences
Boleslaw Dawidowicz Aug 8, 2006 4:38 AM (in response to P P)It's opensource - all stuff you get in portal you can get from CVS. Nothing is hidden ;)
For transaction error - you need to set in your jboss-portlet.xml<portlet> <portlet-name>PortletName</portlet-name> <transaction> <trans-attribute>Required</trans-attribute> </transaction> </portlet>
or cover your code with transaction context by your self -
7. Re: default portlet preferences
P P Aug 8, 2006 5:01 AM (in response to P P)Thanks, that does it.
Everything else worked just as I wanted, so the problem is solved.