02.05.2013 Views

MKS Integrity 2007 Integrations Builder Guide

MKS Integrity 2007 Integrations Builder Guide

MKS Integrity 2007 Integrations Builder Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 3: Using the <strong>MKS</strong> API<br />

Copying the API<br />

Managing Users<br />

42<br />

“Converting <strong>MKS</strong> Source Scripts to API Programs” on page 48<br />

“Accessing Item Fields” on page 49<br />

If you are using the API, when you run your integration you should use the same version of<br />

the API that you used to compile your integration. It should be copied and bundled with the<br />

integration. If you rely on the API that is installed on the client or server, when the version<br />

number changes (that is, when the client or server is upgraded), the next time you try to run<br />

your integration you may have binary compatibility issues. For more information, see “Java<br />

and C API Compatibility” on page 96.<br />

NOTE You should also keep a copy of the matching <strong>MKS</strong> API documentation from<br />

the <strong>MKS</strong> <strong>Integrity</strong> Server.<br />

As an alternative to keeping a copy of the API, you could make sure that a newly compiled<br />

version of your integration is used with the upgraded API files.<br />

An integration uses sessions differently depending on the number of users it is managing. To<br />

best understand the information in this section, you should be familiar with the information<br />

outlined in “Sessions” on page 16.<br />

Single User<br />

A single user session is the scenario that a lot of scripts are written for: running a sequence of<br />

commands for a single user. A single user session can be used for a client or server<br />

integration point. The following examples show how to create a single user session for both<br />

integration points.<br />

NOTE You specify the user and password in two places. The session is used to<br />

validate that you have authority to create a session on the server integration point.<br />

The command runner defaults identify the user to run the command as. A different<br />

user and password could be used for each of these.<br />

Java Example: Client Integration<br />

IntegrationPointFactory ipf =<br />

IntegrationPointFactory.getInstance();<br />

CmdRunner cmdRunner =<br />

ipf.createLocalIntegrationPoint()<br />

.getCommonSession()<br />

.createCmdRunner();

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!