Using SAPALink SDK

You may find information about the first steps necessary to your own storage connection with the help of KGS SAPALink SDKs.

General Description

The KGS SAPALink SDK was developed for customers which already use their own DMS archive/storage and wish to extend it with SAP connection abilities. Two options exist in order to create that kind of connection:

  • Compiling SAPALink.dll by using a C++ compiler and calling it directly
  • Using JAVA and KGS Generic Storage Provider in order to connect the DMS archive.

You have to implement the provided method bodies.

This includes methods like LinkOpen to open a connection to your own archive or all required functions for CREATE.

KGS ContentServer4Storage plays a central role within this process.

SAP System ↔ KGS ContentServer4Storage ↔ (Generic Storage Provider) ↔ SAPALINK-Implementation ↔ Store/DMS of the customer

Downloading SAPALink SDK

You may download the KGS SAPALink SDK from our download area https://download.kgs-software.com/ → KGS SAPALink Framework API

Description of the ZIP-Container

The ZIP file contains the following:

  • Docu
    • SAPALink Add-On 2_10A.pdf
    • SAPALink Query.pdf
    • SAPALink SDK ImpRevGuide 210H.pdf
  • Runtime
    • SAPALink.DAT
    • SAPALINKTEST.exe
    • Storage-profile.txt
  • SAPALINK
    • C++ sources for SAPALink.dll
  • SAPALINK.JAVA
    • DMSException.java
    • SAPALink.java
  • SAPALINKTEST
    • Sources (C++) for SAPALINKTEST.exe
  • Test documents
    • Some test documents (tif,pdf)


Description:


  1. Docu:
  • It contains the SAPALink SDK manual as well as two KGS specific manuals.
  • SAPALink Add-On 2_10A.pdf refers to extended functionalities componentCreateCOLD as well as DocumentKeysSet.

componentCreateCOLD is deprecated and will not be supported by the OSGi-ContentServer4Storage-Version!

2. Runtime:

  • The runtime directory contains the compiled SAPALINKTEST.exe, which you may use in order to test your implementations. It's still recommended to use the KGS API Tester application in order to test your implementations.
  • SAPALink.DAT is being used as a Settings-file by SAPALINKTEST.exe.
  • Storage-profile.txt has to point to a valid KGS Storage-Configuration.

3. SAPALINK

  • This folder contains the uncompiled C++ sources of SAPALink.dll-implementation.  It is required to use your own SAPALink-Implementation without using the OSGI-Generic-Store bundles (for SAPALINK.JAVA) all methods of this source have to be implemented.

4. SAPALINK.JAVA

  • If you are implementing your classes in JAVA you will have to implement DMSException (for error handling) as well as SAPALink.java for each required method and compile it.

5. SAPALINKTEST

  • In order to understand how SAPALINKTEST (c++) works and which methods are being provided KGS decided to provide you with the source code.

6. TestDocuments

  • It contains some test files. You may also use any other file.

Java-Implementation with the help of OSGi as well as KGS ContentServer

KGS recommends you to implement SAPALink in Java and using the recent OSGi container. In order to implement it, you'll have to implement SAPALink.java as well as DMSException.java.
In this manual, we'll provide you with some very basic example of how to implement the methods infoGetVendorName() as well as infoGetProductName()

Within the classes, you may find the method bodies as well as some comments about the functions, the results, and parameters.

infoGetVendorName
// --------------------------------------------------------------------
	// Function: infoGetVendorName
	//
	// Returns the vendor’s name as a String.
	// Parameters: none
	// Returncode: vendor’s name -->  String
	// --------------------------------------------------------------------
	public String infoGetVendorName() throws DMSException
	{
		String csRet = null;
		return csRet;
	}

As you might have noticed, this method is trying to get the vendor name. You may return any name (e.g.: "Max Mustermann AG").

Example Implementation
public String infoGetVendorName() throws DMSException
	{
		return "Max Mustermann AG";
	}


Vorsicht

It's strongly recommended to refrain from using special characters (including UTF-8).

infoGetProductName
// --------------------------------------------------------------------
	// Function: infoGetProductName
	// Returns the name of the product (DMS) as a String.
	// Parameters: none
	// Returncode: product name -->  String
	// --------------------------------------------------------------------
	public String infoGetProductName() throws DMSException
	{
		String csRet = null;
		return csRet;
	}

You will have to define a product name (e.g.: "Magic Archive").

	public String infoGetProductName() throws DMSException
	{
		return "Magic Archive";
	}

In order to test it, you may also implement the methods infoGetProductVersion as well as infoGetLinkVersion.


b) Compilation

The JAVA class SapaLink.java may now be compiled by using any Java SDK. You may either compile it by using the features of your IDE or via the command line.

Due to the variety of IDEs, we provide you with the command line option (please note that there is no difference between the commands used in Microsoft Windows or Linux/Unix).

It is being assumed that you already installed a Java SDK. You may compile the class/-es by using the following command:

Once the command finished the compilation process, two additional files should exist within the directory.

  • SAPALink.class
  • DMSException.class

Configuration of KGS Generic Store Providers and usage of SAPALink.class

A standard installation of KGS ContentServer4Storage (based on OSGi) is being assumed.

Info

Please note, that all provided configurations (via WebGUI) may also be done by using the config files.

First, you may navigate to the OSGi container via WebGUI. From there you may navigate to the configuration of the Generic Store Service (the bundles of KGS Generic SAPALink Provider).

Within the configuration of the Generic Store Service you may change the Implementation Folder (the path of the SAPALink-implementation) as well the flag Use internal Implementation (which may allow you to accept external SAPALink implementations).


The parameter Implementation Folder has to point to a directory that contains the compiled classes (SAPALink.class and DMSException.class).

Use internal Implementation has to be set to false. (If you set it to true it would always use the KGS Store implementation including the configuration via Storage.cfg).

Important! You should change the value of ILM internal Implementation also to false when your CS has a ILMLicenseKey.

Please restart the webserver.

After restarting your webserver you may see some changes within the KGS ContentServer4Storage user interface:

Please note also the changes in the SAPALink Info (Within MainSAPALink Info):


The ArchiveLink command serverInfo should also return the assumed results:

http://localhost:8080/KGSAdmin-CS/contentserver?serverInfo&pVersion=0046&resultAs=ascii