[p4] Java interface to Perforce / P4API for Java

Dan Harmer dharmer at xtendsoft.com
Tue Oct 30 10:14:22 PST 2001

Greetings from a Perforce newbie on a tight deadline,

I've been looking at the Perforce API and Python examples; however, I'm not
experienced in C/C++ and have had difficulty figuring out how to utilize it
via business rules (java classes) in our system.  A perforce contact
mentioned that a guy named Michael Bishop has written a partial Java API for
perforce--does anyone on this list have any experience with this?

I checked out the source under the guest area of the depot and got
everything to compile, but don't really know where to start to try and
implement some of the methods.  Does anyone have any sample implementations
or snippets of code that could serve as an example for me?  I'm also new to
JNI, which appears to be heavily utilized in the C/C++ classes accompanying
the API.  Could you please tell me what I need to do with those classes in
order to make everything work?  What are the files in the macos folder for?
(jclientapi.exp, p4.macos.prefix.h, etc)

I am currently looking for the easiest way allow our system to utilize
Perforce's vaulting/SCM capabilities.  For example, at the simplest level,
say we've got a JSP page with buttons that allow a user to checkin and
checkout files (such as source code, word docs, images, etc).  What would be
the easiest way to trigger these actions in Perforce?  Eventually, I also
want the capability to monitor changes within Perforce and trigger
additional business rules--such as sending an email to someone when a
document revision occurs by another user in the system.

For me, it seemed the easiest way to accomplish this might be using this
Java API; however, I know there are some plugins, command-line interfaces,
etc that might be just as easy or easier.  Any guidance or suggestions would
be greatly appreciated as this is all new to me.  Thanks,

Dan Harmer
dharmer at xtendsoft.com

More information about the perforce-user mailing list