Using the IBM Workload Plug-in Development Kit

Four basic tasks to get you started with virtual application patterns

Learn to set up the samples environment in Eclipse, create new projects from the command line, build a single plug-in and pattern type with command-line tools, and develop a plug-in with the Eclipse framework. This article provides some basic toolkit operations. The companion article, Create and customize virtual application patterns, describes how to get started with the IBM Workload Plug-in Development Kit (PDK).

Share:

Ted Kirby, Sr. Software Engineer, IBM

Author photoTed Kirby develops plug-in support for IBM Workload Deployer Pattern for Web Applications at IBM in the Research Triangle Park, North Carolina. He is an Apache Geronimo committer and was a WebSphere Application Server Community Edition developer. Previously, he was a WebSphere Technical Evangelist for Extreme Transaction Processing and has enhanced and maintained eCommerce websites and developed distributed operating systems, including the system used by the Deep Blue machine.



Lin Sun (linsun@us.ibm.com), Advisory Software Engineer, IBM

Lin SunLin Sun is an advisory software engineer working on the Workload Deployer Development team in Research Triangle Park, North Carolina. She received a master's degree in information science from the University of North Carolina at Chapel Hill.



11 April 2012

Also available in Chinese Russian Japanese

These four basic tasks provide familiarity with the IBM Workload Plug-in Development Kit and virtual application patterns:

  • Setting up the samples environment in Eclipse.
  • Creating a new plug-in project from the command line.
  • Building a single plug-in and pattern type with the command line tools.
  • Developing a plug-in with the Eclipse Framework.

Setting up the samples environment in Eclipse

Follow these steps to set up an Eclipse development environment for which you will use the samples.

Before you begin: Make sure you are using the following versions:

  • Eclipse V3.6.2, 32-bit. The Java Enterprise Edition (JEE) version is recommended.
  • JDK 1.6, 32-bit.
  1. Import the PDK plugin.depends project and the hello sample source projects.
    1. Create a new workspace and start Eclipse.
    2. Select File > Import > General > Existing Projects into Workspace.
    3. Select Select root directory:. Use the Browse button to find and select the iwd-pdk-workspace directory where you downloaded and expanded the pdk-<version>.zip file.
    4. Select plugin.depends and the four sample projects.
    After the import is done, the following projects are located in your workspace:
    • patterntype.hello
    • plugin.com.ibm.sample.hclink
    • plugin.com.ibm.sample.hello
    • plugin.com.ibm.sample.hellocenter
    • plugin.depends
  2. Build all the plug-ins in the workspace. Navigate to the plugin.depends project and run the build.xml Ant script. To run Ant, right-click the file and choose Run As > Ant Build.
  3. Build the hello pattern type. Navigate to the patterntype.hello project and run the build.patterntype.xml script.
  4. Refresh the patterntype.hello project. A new folder named export is displayed. Navigate to the export folder. The hello-2.0.0.2.tgz pattern type file is located here.

Creating a new plug-in project from the command line

Before you begin:

  1. Change directory (cd) to the plugin.depends project directory in your workspace.
  2. Set the ANT_HOME environment variable. You can use Ant in your Eclipse installation at eclipse/plugins/org.apache.ant_1.7*. You can also invoke this Ant script from Eclipse.
  3. Right-click create.plugin.project.xml in the plugin.depends project and choose Run As > Ant Build.
  4. Click the Main tab; in the argument section and enter the various -Dproject.name=jp1 values as shown in the following steps.

To create a new plug-in project:

  1. Create a new template plug-in project. The project.name property is optional and if it is not specified, it will default to the value of the plugin.name.
    ant -Dproject.name=tp1 -Dplugin.name=a.b.c.template -f 	create.plugin.project.xml
  2. Create a new Java plug-in project as follows:
    1. Containing no package name: (.java assumed on Java classname)
      ant -Dproject.name=jp1 -Dplugin.name=a.b.c.java -
      Djava.classname=MyPlugin -f create.plugin.project.xml
    2. Containing a package name:
      ant -Dproject.name=jp2 -Dplugin.name=a.b.c.java -
      Djava.classname=a.b.c.MyPlugin -f create.plugin.project.xml
  3. Verify that the command was successful. Import the newly created projects into your workspace. To build the plug-in projects, for example jp1, find build.plugin.xml in project jp1, right-click it and issue Run As > Ant Build... with the goal clean, publish selected. The equivalent Ant command is to issue the following command in the project jp1 directory:
    ant -f build.plugin.xml clean publish

You should see the a.b.c.java-<version>.tgz plug-in created in the export directory.


Building a single plug-in and pattern type with the command-line tools

Before you begin: This article assumes that you have the following installed:

  • The Ant build environment version 1.7.1 or higher.
  • A command-line environment like Linux console or Windows CLI.
  • A message format tool such as msgfmt (Linux) or msgfmt.exe (Windows). Add the tool folder into the system path to make sure you can start the tool without the full path.

To build a single plug-in and pattern type:

  1. Go to the workspace that you created in the Setting up the samples environment section.
  2. Navigate to the root folder of target plug-in project.
  3. Build a single plug-in using this command:
    ant -f build.plugin.xml

    The building information displays in the console.
  4. Go to the export folder of the plug-in project. This folder is generated by Step 3. Locate the plug-in package, which is a TGZ file.
  5. Navigate to the root of the plugin.depends project.
  6. Build all plug-ins in this workspace using the following command:
    ant -f build.xml

    This command builds the plug-ins in this workspace one at a time. After the script starts, go to the image/plugins folder of the plugin.depends project to check all of the built plug-in packages.
  7. Navigate to the root of the pattern type project, patterntype.hello, and type the following command:
    ant -f build.patterntype.xml

    After the script starts, go to the root of the export folder of the pattterntype.hello project to check the built pattern type package, which is a TGZ file.

Developing a plug-in with the Eclipse framework

To develop a plug-in with Eclipse:

  1. Go to the workspace that you created in the Setting up the samples environment section.
  2. Build a single plug-in.
    1. Select the build.plugin.xml file in the root of this project.
    2. Right-click and select Run As > Ant Build. The plug-in starts to build.
    3. After the build process, refresh the project and a new folder named export displays. All of the build artifacts are listed in the export folder. The plug-in package is in the root of export folder.
  3. Build all plug-ins in the workspace.
    1. Select the build.xml file in the root of the plugin.depends project.
    2. Right-click and select Run As > Ant Build. The plug-in builds.
    3. After the build process, refresh the project. A new folder named image displays in the sub-folder plugins, which contains all of the built plug-in packages.
  4. Build a single pattern type. Before this step, you must successfully complete Step 2.
    1. Select the build.patterntype.xml file in the root of the patterntype.hello project.
    2. Right-click and select Run As > Ant Build. The pattern type builds.
    3. After the build process, refresh the project. A new folder named export displays where all the build artifacts are listed.
    4. The pattern type package is in the root of export folder.

In conclusion

These tasks should get you warmed up using the PDK. If you want a tour of the toolkit, the companion article explains how to create and customize virtual application patterns using the toolkit.

Resources

Learn

Get products and technologies

Discuss

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Cloud computing on developerWorks


  • Bluemix Developers Community

    Get samples, articles, product docs, and community resources to help build, deploy, and manage your cloud apps.

  • developerWorks Labs

    Experiment with new directions in software development.

  • DevOps Services

    Software development in the cloud. Register today to create a project.

  • Try SoftLayer Cloud

    Deploy public cloud instances in as few as 5 minutes. Try the SoftLayer public cloud instance for one month.

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Cloud computing, WebSphere, Information Management
ArticleID=809039
ArticleTitle=Using the IBM Workload Plug-in Development Kit
publish-date=04112012