did you ever manage to solve this problem?
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:
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.