This content has been marked as final.
Show 3 replies
-
1. Re: Deployment of same portlet with different config
rab.boyce Apr 6, 2006 10:57 AM (in response to scottdawson)did you ever manage to solve this problem?
-
2. Re: Deployment of same portlet with different config
scottdawson Apr 6, 2006 6:02 PM (in response to scottdawson)Yes, I was overlooking the obvious. Probably the best way to deploy two (or more) instances of a portlet is with multiple portlet elements in portlet.xml, so you end up with something like this:
<portlet-app ...> <portlet> <portlet-name>MyPortlet</portlet-name> <portlet-class>com.unisys.portlets.ThePortlet</portlet-class> <!-- portlet configuration goes here, like title, init-params, preferences, etc. --> </portlet> <portlet> <portlet-name>YourPortlet</portlet-name> <portlet-class>com.unisys.portlets.ThePortlet</portlet-class> <!-- portlet configuration goes here, like title, init-params, preferences, etc. --> </portlet> </portlet-app>
There are at least 2 advantages to solving the problem this way:
1) You can change almost anything configurable: the title, init-params, preferences; anything in portlet.xml
2) It's JSR-168 compliant and so it should be portable
Alternatively, there are a couple of JBoss Portal-specific ways you can solve the problem but they only allow you to override Preferences and not other attributes like the portlet title. The first Portal-specific way is to override preferences in the *-object.xml file, documented here:http://docs.jboss.com/jbportal/v2.2/reference-guide/en/html/xmldescriptors.html#d0e860
The other way is to use the JBoss Portal management portlet to create multiple instances of a portlet and then override preferences, documented here:
http://docs.jboss.com/jbportal/v2.2/user-guide/en/html/dynamicity.html#d0e1177
Regards,
Scott Dawson
Unisys -
3. Re: Deployment of same portlet with different config
scottdawson Apr 12, 2006 5:29 PM (in response to scottdawson)The JBoss Portal Reference Guide shows how to override preferences in the *-object.xml file (section 3.5). I can't get it to work. Has anyone been successful with this? Here is the example XML from the reference guide:
<deployment> <if-exists>overwrite</if-exists> <instance> <instance-name>HelloWorldPortletInstance</instance-name> <component-ref>helloworld.HelloWorldPortlet</component-ref> <preferences> <preference> <name>foo</name> <value>bar</value> <read-only>false</read-only> </preference> </preferences> </instance> </deployment>
I don't get any errors but the specified override values do not take effect. I've tried dropping the database, deleting the temp directories, etc.
Thanks,
Scott