Viewing the Source Code of Wink-based Feed Sample application

The source code of the Feed Sample application is provided within the SampleFeedApp_Wink.war file.

Locating the application WAR file

Locate the Feed Sample application web archive (WAR) file that is provided with this documentation. Depending on how you obtained this sample application, you can find the WAR file in one of the following locations:

Viewing the source code in an Eclipse-based IDE

An Eclipse-based IDE is the simplest approach to examining the source code of the WAR file. Use any Eclipse 3.2.X or 3.3.X with the Web Tools Project 2.5 or higher, or Rational Application Developer, Version 7.0 or higher, and import the WAR file according to the following steps:

  1. From the Eclipse IDE menu, select File >Import.
  2. In the displayed panel, expand the Web option, then select WAR file. Click Next.
  3. In the WAR File entry field, click Browse, and select the file you located earlier. This action populates the other two fields.
  4. Accept defaults for the project name, if they are acceptable, and click Next.
  5. Click Finish.

When the import process completes, a new project, SampleFeedApp_Wink, is created. The application source code can be accessed from this project. You must add the Wink libraries in the build path of the project.

Adding the Wink libraries to build path
  1. Create a folder for the shared library option; for example, "jaxrs-library".
  2. Copy the following JAR files into that folder: ibm-wink-jaxrs*.jar, jsr311-api*.jar, ibm-jaxb*.jar, JSON4J.jar, slf4j*.jar, jcl-over-slf4j*.jar, httpclient*.jar, httpcore*.jar, commons-codec*.jar and commons-lang*.jar. Refer to the Overview section to locate these files.
  3. From Eclipse IDE, right-click the project, and select Properties > Java Build Path > Libraries.
  4. Click Add External JARs
  5. Select all the previously mentioned JAR files, and click OK.
  6. Click OK to complete the process.