Portlet Factory, Version 6.1.2


 

Using existing JAR files with IBM WebSphere Portlet Factory projects

You can using existing JAR files in the Web application that you are developing. You can have APIs that need to be accessed at design time (for example, by a custom builder). Or you can have a JAR (for example, from third-party software) that you need to reference from a builder generation or builder coordinator class. The WebSphere Portlet Factory Designer, which is implemented as a set of Eclipse plugins, may need to know about these APIs and load the classes from the JAR files associated with those APIs. The API JAR files available to the WebSphere Portlet Factory Designer and builders typically reside in the lib directory. For example:

C:\Program Files\IBM\WebSphere Portlet Factory\WPFDesigner\eclipse\plugins\com.bowstreet.designer.core_6.1.2\lib
The JAR files are described and exported for use by other plugins, including the builder UI support plugin, in the following file:
C:\Program Files\IBM\WebSphere Portlet Factory\WPFDesigner\eclipse\plugins\com.bowstreet.designer.core_6.1.2\plugin.xml

The path to the JAR also needs to be in the WebSphere Portlet Factory Designer classpath.

  1. Add a copy of the JAR to one of the following WebSphere Portlet Factory project directories.

    • WEB-INF/lib or WEB-INF/work/lib

      The WEB-INF/lib and WEB-INF/work/lib directories are used at runtime on the application, portal server, or mashup. The JARs in these directories are dynamically loaded by WebSphere Portlet Factory. This is convenient during development.

    • WEB-INF/clientLibs

      If you need a JAR in your project just for compilation or design time access and the JAR is already available on your application, portal server, or mashup, put that JAR in WEB-INF/clientLibs. This directory is primarily used for compilation against APIs that already are available on the application server. No classes from WEB-INF/clientLibs are loaded and used at runtime on the server. The directory is a safe place to put application server JARs that you need to compile against.

  2. If the WebSphere Portlet Factory Designer or builders need to refer to the API in the JAR at design time, add a copy of the JAR to the following location:
    .../WebSphere Portlet Factory/WPFDesigner/eclipse/plugins/com.bowstreet.designer.core/lib

  3. Open the plug-in plugin.xml file in the following location:
    .../WebSphere Portlet Factory/WPFDesigner/eclipse/plugins/com.bowstreet.designer.core/

  4. Add a <library /> element to the <runtime /> node similar to the following:
    <library name="lib/my_classes.jar"><export name="*"/></library>

  5. Close the file.

  6. In Eclipse Project Explorer, right-click the WebSphere Portlet Factory project and click Properties > Java Build Path.

  7. In the Properties for your project dialog, click Libraries.

    A display shows a list of JAR files currently in the project Java Build Path.

  8. Click one of the following buttons:

    • Add JARs if the JAR is within your project structure

    • Add External JARs if the JAR is located outside your project structure

  9. In the JAR Selection dialog, navigate to the appropriate directory and select the JAR to add to the project.

  10. Click OK in the JAR Selection dialog.

  11. Click OK in the Properties dialog.

Parent topic: IBM WebSphere Portlet Factory Designer components Parent topic: Configuration of a development environment Parent topic: Eclipse-based IDEs


Library | Support |