The EKM Client API library is installed along with the EKM server product. Under the EKM installation directory, the following directories are provided for the library:
EKM_ROOT182/ekm-client - the home directory for the
library |
EKM_ROOT182/ekm-client/bin - scripts for running Jython
and for building and running the included Java samples |
EKM_ROOT182/ekm-client/lib - Java and C#
libraries |
EKM_ROOT182/ekm-client/programs - additional programs
needed to build and run the Java samples |
EKM_ROOT182/ekm-client/samples/CSSamples - example
application written in C# |
EKM_ROOT182/ekm-client/samples/ironpython - example
applications written in Python for execution using IronPython |
EKM_ROOT182/ekm-client/samples/java - example
applications written in Java |
EKM_ROOT182/ekm-client/samples/jython - example
applications written in Python for execution using Jython |
EKM_ROOT182/ekm-client/schema - schema files |
After the installation is complete, do the following to build and run the Java and Jython examples:
Edit the EKM_ROOT182/ekm-client/bin/ekm_env
script.
Set the EKM_BASE environment variable to the value of
EKM_ROOT182, where
EKM_ROOT182 is the directory in which the
ekm-client directory resides.
Set the JAVA_HOME environment variable to the location of the
JDK.
Add the EKM_ROOT182/ekm-client/bin directory to the
path.
On Unix machines, use the chmod command to make all of the
.sh files in
EKM_ROOT182/ekm-client/bin
executable.
On Unix machines, use the chmod command to make the
ant script in
EKM_ROOT182/ekm-client/programs/apache-ant-1.9.1/bin
executable.
Once this has been done, the samples can be built and run in place on the server where the library was installed.
Follow the steps below to install the library on a client machine.
Copy the ekm-client directory from the server install to a location
on the client machine. The only prerequisite for the client machine is that it
has the Java Development Kit (JDK) version 1.8.0_121 or later installed on
it.
Open EKM_ROOT182/ekm-client/bin/ekm_env script in an
editor.
Change the EKM_BASE environment
variable to the directory in which you placed the ekm-client directory.
Change the JAVA_HOME environment
variable to point to the JDK installation on the client machine.
Add EKM_ROOT182/ekm-client/bin to your PATH.
Save your changes.
On Unix machines, use the chmod command to make all of the
.sh files in
EKM_ROOT182/ekm-client/bin
executable.
On Unix machines, use the chmod command to make the
ant script in
EKM_ROOT182/ekm-client/programs/apache-ant-1.9.1/bin
executable.
To test the installation, follow the steps below.
Execute the jython script in EKM_ROOT182/ekm-client/bin.
This should open a jython console. For example:
>>>Jython 2.7.0 (default:9987c746f838, Apr 29 2015, 02:25:11) [Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.8.0_121 Type "help", "copyright", "credits" or "license" for more information. >>>
At the prompt, enter the following commands:
>>> from com.ansys.ingress.client.api import ConnectionFactory
>>> conn = ConnectionFactory.open("http://host:port", "user", "password")The first command imports the ConnectionFactory class into the
interpreter. The second command opens a connection to the EKM server. In
the second command, replace host:port with the hostname
and port number of the EKM server (for example,
http://localhostmyekmserver.mycompany.com:8080), user
with the EKM username, and password with the
EKM user’s password.
If you do not see any errors, you are connected to the EKM server.
Close the connection before exiting the interpreter.
>>> conn.close() 14:26:58,454 DEBUG EventManager:57 - Posting connection event: CONNECTION_CLOSED