4 Replies Latest reply on Mar 21, 2007 7:34 AM by Fredrik Forsberg

    Identify a portlet instance before rendered?

    Fredrik Forsberg Newbie

      Hello all.

      I am using JBoss 4.0.5, JBoss portal 2.6 and JBoss seam 1.1.0.

      My usecase is this:

      I have a default portal and a page called 'Contacts' which contains two portlet instances 'PortletInstanceInternalContacts' and 'PortletInstanceExternalContacts'.
      The instances originiates from the same portlet 'MyContactsPortlet'.

      <?xml version="1.0" encoding="UTF-8"?>
      <portlet-app
       xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd /opt/SUNWps/dtd/portlet.xsd"
       version="1.0">
       <portlet>
       <portlet-name>MyContactsPortlet</portlet-name>
       <init-param>
       <name>default-view</name>
       <value>/contacts.jsp</value>
       </init-param>
       <portlet-class>org.apache.myfaces.portlet.MyFacesGenericPortlet</portlet-class>
       <supports>
       <mime-type>text/html</mime-type>
       <portlet-mode>VIEW</portlet-mode>
       </supports>
       <portlet-info>
       <title></title>
       </portlet-info>
       </portlet>
      
      </portlet-app>
      


      The difference between the two instances is that they shall display slightly different data from backend.
      The solution would be to send a parameter from the portletinstance to backend to sort of identify itself and
      be able to fetch correct data.


      My question is:

      I want to create multiple instances of the same portlet and be able to identify the instances from each other
      to populate them with data based on a parameter.

      How can I get this parameter?

      What can/should it be based on?

      Is the portletinstance name feasable and how can I find out this portletinstance name?