Sunday, March 4, 2012

Installing Portlet as a Predeployed J2EE application.

below is the sample xml definition file which can be used for importing a predeployed j2ee applicaiton as a portlet.

<?xml version="1.0" encoding="UTF-8"?>
<request build="wpnext_528_01" type="update" version="7.0.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PortalConfig_7.0.0.xsd">
    <portal action="locate">
       <web-app action="update" active="true" uid="com.ibm.faces.portlet.FacesPortlet.f44b90ed53" predeployed="true">
    <url>file://C:/IBM/WebSphere/wp_profile/installedApps/subbupc/HelloWorldEAR.ear/HelloWorldPortlet.war</url>

    <!-- The context root that is assigned to the web application of the portlet application
         in the predeployed EAR file (reference: application.xml). The context-root
         in this XML file must match with the context-root in the application.xml file.   -->
    <context-root>/HelloWorldPortlet</context-root>

    <!-- The name that is assigned to the application in the predeployed EAR file
         (reference: application.xml). -->
    <display-name>HelloWorldPortlet</display-name>

    <portlet-app action="update" active="true" uid="com.ibm.faces.portlet.FacesPortlet.f44b90ed53">
        <portlet action="update" active="true" objectid="HelloWorldPortlet" name="HelloWorldPortlet"/>
    </portlet-app>
</web-app>
    </portal>
   </request>

copy this file to <portalserverroot>/bin location
Open command prompt and run xmlaccess command as shown below passing this xml file as input.

now you should be able to see the portlet in Portal Administration pages as shown below. go to web modules and start the portlet if it is stopped.

 

No comments:

Post a Comment

comments