Version 2

    When using the nukes-core.sar portal you must include two files that dictates how to create portlet instances. These files must be located in /WEB-INF directory of the

    web application.

     

    nukes-instances.xml

     

    This file refers to portlet and triggers instance creation of portlets.

     

    <?xml version="1.0" standalone="yes"?> <instances>    <instance>       <name>HelloWorldPortletInstance</name>       <component-name>HelloWorldPortlet</component-name>    </instance>    <instance>       <name>PreferencesPortletInstance</name>       <component-name>PreferencesPortlet</component-name>    </instance> </instances>

     

    That takes the two portlet defined in portlet.xml and create one instance for each of them. The instance names are important :

     

    • They must be unique

    • They are used later to create windows for these portlets

     

    nukes-windows.xml

     

    This files create window viewport for portlet instances :

     

    <?xml version="1.0" standalone="yes"?> <windows>    <window>       <name>HelloPortletWindow1</name>       <instance-name>HelloWorldPortletInstance</instance-name>       <region>left</region>       <height>0</height>    </window>    <window>       <name>PreferencesPortletWindow1</name>       <instance-name>PreferencesPortletInstance</instance-name>       <region>user1</region>       <height>1</height>    </window>    <window>       <name>HelloPortletWindow2</name>       <instance-name>HelloWorldPortletInstance</instance-name>       <region>right</region>       <height>0</height>    </window>    <window>       <name>PreferencesPortletWindow2</name>       <instance-name>PreferencesPortletInstance</instance-name>       <region>user2</region>       <height>1</height>    </window> </windows>

     

    For each of the instances created before, we create two windows which makes a total of 4 windows. When a window is created we always refer to an instance name

    and we also give that window a unique name. For now two parameters are used to define the position of the window in the rendered HTML, region and height.

     

    The region value describe where to put the window on the screen, the possible values are left, right, bottom, user1, user2, inset.

    The height value defines how to stack the windows for a given region.