APIs

Sophora's client API provides an interface for partners and customers who want to develop their own client application(s).

Table of Contents

Client API

Sophora's client API provides an interface for partners and customers who want to develop their own client application(s). For the development process it is recommended to include subshell's external Maven repository for server tools.

JavaDoc

Initialising an ISophoraClient

The factory com.subshell.sophora.client.factories.SophoraClientFactory eases the initialisation of an ISophoraClient. Therefore, the subsequent parameters are available (bracketed parameters are optional whereas some of them may only occure in combination with others; e.g. proxy information):

Parameter:

  • host – http or rmi connection to the Sophora server
  • username
  • password
  • (proxyHost)
  • (proxyPort)
  • (proxyUsername)
  • (proxyPassword)
  • (documentCacheElementsInMemory) – The number of documents which are cached in main memory at most. The value 0 means, that there is no limit.
  • (documentCacheElementsOnDisk) – The number of documents which are cached on disk at most. Is only effective if the cacheDir is set. The value 0 means, that there is no limit.
  • (cacheDir) – (Absolute path) The document cache may use this folder to persists the cached documents.
  • (thumbnailCacheSize – Size of the thumbnail cache of this client)
  • (updateInterval – Defines the interval to retrieve client events from the server)

Initialising an ISophoraClient and adding an IContentListener (here the ContentAdapter implements this interface)

SophoraClientFactory scf = new SophoraClientFactory(host, username, password);
ISophoraClient client = scf.createSophoraClient();
 
client.login();
 
client.addListener(new ContentAdapter() {
    @Override
    public void documentChanged(String uuid, String primaryType,
        StateChange stateChange, NodeChanges nodeChanges) {
        System.out.println("Handling documentChanged(): uuid:" + uuid + " primaryType: " + primaryType + " stateChange: " + stateChange);
    }
});

Restrictions of Sophora's Client API

The current version of the client API cannot handle multiple sessions concurrently. This requires that for each user logged in to Sophora an individual instance of the client JAR has to be run.

Server API

The Sophora server API encapsulates the communication with and the access to the Sophora server. The library is employed by the client API.

The Document Lifecycle

Document States and Transitions

The following diagram shows the basic document lifecycle.

Depending on the configuration of your Sophora installation, additional states may be available for some document types. The following diagram shows all possible transitions between document states, except for the "deleted" state.

External Maven Repository

To access our external Maven repository use the following address: "http://software.subshell.com/artifactory/repo-maven2". There, you'll find JARs and tools which partners and customers need for their own client developments. The libraries listed below are currently available:

  • Sophora API
  • Sophora Client
  • Sophora Delivery
  • Sophora Delivery-Content
  • Sophora Commons

Within your project pom.xml insert the following exemplary snippet:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br/> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"><br/>
		<modelVersion>4.0.0</modelVersion>
		<br/>
		<groupId>Insert your groupID here</groupId>
		<br/>
		<artifactId>Insert your artifactId here</artifactId>
		<br/>
		<version>Insert the according version here</version>
		<br/>
		<br/>
		<repositories>
			<br/>
			<repository>
				<br/>
				<id>subshell</id>
				<br/>
				<url>http://software.subshell.com/artifactory/repo-maven2</url>
				<br/>
			</repository>
			<br/>
		</repositories>
		<br/>
		<br/>
		<dependencies>
			<br/>
			<dependency>
				<br/>
				<groupId>com.subshell.sophora</groupId>
				<br/>
				<artifactId>com.subshell.sophora.client</artifactId>
				<br/>
				<version>1.26.5</version>
				<br/>
			</dependency>
			<br/>
		</dependencies>
		<br/>
		<br/>
	</project>