Description

 < Day Day Up > 

To configure WebSphere Studio, proceed as follows :

  1. Log in to WebSphere Portal and open the Administration page.

  2. Select Portlets -> Manage Applications .

    Figure B-1. Select Manage Applications to get the portlet name

    graphics/xbfig01.gif

  3. Select the Web module you want to redeploy and click the Show Info button.

  4. In the portlet info page, mark the Portlet Application Name and copy it to the clipboard.

    Figure B-2. The portlet info portlet

    graphics/xbfig02.gif

  5. In WebSphere Studio, select File -> New -> Other... .

  6. In the New Projects wizard, select Project from the Simple category. Click Next and enter a project name of PortletReConfigurationFiles .

  7. Switch to the XML perspective. In the Navigator view, right-click the PortletReConfigurationFiles project and select New -> XML .

  8. Select Create XML file from Scratch and then click Next . Enter a xml file name of UpdatePortlet.xml and click Finish .

  9. In the Source tab of the XML editor, enter the XML code shown in Example 16-1 on page 537.

    Example 16-1. XML file for updating the portlet using XMLAccess
     <?xml version="1.0" encoding="UTF-8"?> <request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PortalConfig_1.2.xsd" type="update" create-oids="true">    <portal action="locate">       <web-app action="update" active='true' uid="com.ibm.myportlet.MyPortlet.7058b2390e0e001817ab8f2fcd901ef9">          <url>file://localhost/D:/wps5/installableApps/MyPortlet.war</url>       </web-app>    </portal> </request> 
  10. Replace the uid value with the Portlet Application Name you copied in step 4. Replace the url value with the absolute portlet path you want to use. We will use this path to export the portlet application.

  11. Save and close the XML file.

  12. Switch to the Java perspective. Select File -> New -> Project... . Select Java Project from the Java category. Click Next and enter the project name XMLAccess . Click Finish .

  13. Right-click the XMLAccess project and select Properties .

  14. In the Properties window, switch to the Java Build Path category.

  15. Switch to the Libraries tab. Click the Add External JARs... button. Browse to the installation location of WebSphere Portal or WebSphere Portal Test Environment. Select tools.jar from the WPS_INSTALL_DIR/bin directory.

    Figure B-3. Add the tools.jar file to the classpath

    graphics/xbfig03.jpg

  16. Click OK to close the Properties window.

  17. Select Run... from the Run tool menu.

    Figure B-4. Select Run... to create a new Lauch configuration

    graphics/xbfig04.gif

  18. Select Java Application from the Lauch Configuration list and click the New... button.

  19. Enter the name UpdatePortlet and check Include external jars... .

    Figure B-5. Launch configurations

    graphics/xbfig05.jpg

  20. Click the Search... button near the Main class field.

  21. In the Choose Main Type dialog, select the XmlAccess class and click OK .

  22. Switch to the Arguments tab. In the Program arguments field, enter the following text:

     -in UpdatePortlet.xml -user wpsadmin -pwd wpsadmin -url http://localhost:9081/wps/config 
  23. Replace the user, pwd and url arguments with the values of your server.

  24. Uncheck Use default working directory . Select Workspace and browse to the PortletReConfigurationProject.

    Figure B-6. Arguments tab in Launch Configurations dialog

    graphics/xbfig06.jpg

  25. Click Run .

  26. If you did not export the Portlet war file previously, you will see an error message in the Console view. That is fine for now. Otherwise, you should see an output as in Figure B-7 on page 540.

    Figure B-7. Console output after redeploying the portlet

    graphics/xbfig07.jpg

  27. Switch to the portlet perspective.

  28. In the J2EE Navigator view, select your portlet and choose Export... from the context menu.

  29. In the Export wizard, select WAR file and click Next > . Select the portlet you want to export and enter the absolute path you configured in Example 16-1 on page 537.

    Figure B-8. Export your Portlet

    graphics/xbfig08.jpg

  30. Click Finish .

  31. Select Window -> Customize Perspective... .

  32. In the Customize Perspective window, check Launch from Other sub tree .

Figure B-9. Check Launch to get new items in the toolbar

graphics/xbfig09.jpg

To redeploy your portlet, proceed as follows:

  1. Export your portlet war file as described in Step 28 on page 540.

  2. Select UpdatePortlet from the Run tool menu.

Figure B-10. Select UpdatePortlet to redeploy the portlet

graphics/xbfig10.gif

 < Day Day Up > 


IBM WebSphere Portal V5 A Guide for Portlet Application Development
IBM Websphere Portal V5: A Guide for Portlet Application Development
ISBN: 0738498513
EAN: 2147483647
Year: 2004
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net