Actually, a portlet is only a small part of a screen. If you look at the default portal provided by JBoss Portal, the home page has around 5 portlets.
Also, a single portlet can appear multiple times, both on a given page, and on multiple pages. As an example, one of my portlets has a certain portlet appearing 4 times on the home page, and then once or twice on all of the other pages.
It also depends on how the screens are designed. Another of my portals places all of the html text within the Content Management System (CMS) and then uses the CMS portlet (which appears on multiple pages) to display the HTML. In this case there is a lot of data being presented to the user, but very little input. Input will typically require its own portlet.
thanks for the reply!
So, how does your 'portlet-instances.xml' look like?
<?xml version="1.0" standalone="yes"?>
<!DOCTYPE deployments PUBLIC
"-//JBoss Portal//DTD Portlet Instances 2.6//EN"
Is it possible to have one generic portlet and the rest extends it?
Thanks in advance!
To declare multiple instances of a portal, assuming the portal is named p1, portlet-instances.xml would contain:
<deployments> <deployment> <instance> <instance-id>inst1</instance-id> <portlet-ref>p1</portlet-ref> <preferences> <preference> <name>xxx</name> <value>aaaaaaa</value> </preference> </preferences> </instance> </deployment> <deployment> <instance> <instance-id>inst2</instance-id> <portlet-ref>p2</portlet-ref> <preferences> <preference> <name>xxx</name> <value>bbbbbbb</value> </preference> </preferences> </instance> </deployment> . . . </deployments>
The key is that the portlet is coded to use the use the preferences to customize it.
You can define a base portlet class that does a lot of the common tasks and extend that class. You would then, in portlet.xml, declare a portlet for each of the subclasses.