Getting Started

The first thing you need to be do if you are going to work with the Objective API is to get it! It is not free - it is a chargeable extra. We use the Java API as we have Java skills, I believe that the other options are C++ and VB.

Now you need to install it. If you use JDeveloper then you can simply copy the ObjApi.jar file to the /jdev/lib/ext/ directory.

Finally, you need to include it in your project dependencies. If you open up the project properties in JDeveloper and choose the Libraries option, you can click on a button called "Add Jar/Directory...". Click on this and navigate to the ObjApi.jar file and click Ok. Now you can safely include all the necessary Objective classes in your applications.

Connecting

You now need to know how to connect to the Objective server from your code base. We created a dedicated Objective user on our system for this. It's the best way as it minimises any security issues.

You need to remember to import the objective packages:

<%@ page import="com.objective.oji.*"%>

You can now connect to Objective. You start off by created a new Objective application object. From this you can create a session by logging in. Don't forget to log out at the end. Here's how it can come together in a snippet from a jsp page:

<%
String result;

// application object
OjiApplication objective = new OjiApplication();

try
{
  // login to the server - you'll need to use your own values here!
  OjiSession apiSession = objective.loginUser("username", 
                          "password", "server", portNumber);
  
  result = "Success!";

  apiSession.logout();
}
catch (OjiException e)
{
  result = "Error: " + e.getMessage();
}
%>

That's all there is to it. The next stage is to get something useful out (or in).

Patrick Haston
12 November 2007