Class CapabilitySWI

The class implements a capability that reads its model description properties from a SWI-Prolog content package slip which is a Prolog text. Additionally the capability can read platform description properties from a Jekejeke Prolog icon package slip which is also a Prolog text. The package has one parameter for initialization, namely the main root of the package. The main root is then used to determine the location of the package slips.

Example pack.pl:
name(hello).
title('Hello World').
version('1.0.0').
home('http://www.jekejeke.ch/').
author('(c) 2019, XLOG Technologies GmbH, Switzerland', 'info@xlog.ch').

The content package slip follows the format from SWI-Prolog. It has to be a Prolog text named "pack.pl". An example content package slip might read as follows, whereas the name attribute is not yet used by Jekejeke Prolog. The name and the version attributes are mandatory to be interoperable with the SWI-Prolog system. The author attribute can have multiple entries, our example shows only one entry:

Example icon.pl:
date('2019-05-23').
icon('images/hello.png').

The icon package slip follows a proprietary format of Jekejeke Prolog. It has to be a Prolog text named "icon.pl". The SWI-Prolog system will simply ignore this package slip. The Jekejeke Prolog system on the other hand will use the icon package slip to associate an icon with the package. For icons in a folder <directory>, high resolution icons can be placed in a sibling folder by the name <directory>_hi.

Example prolog/hello.pl:
:- module(hello, [hello/0]).
hello :-
write('Hello World!'), nl.

The Prolog text itself of such a package can be placed in a directory named "prolog". When a package is initialized, this directory is automatically added to the file extension prefixes. It will impact the lookup of Prolog texts without requiring a module or a package declaration inside each Prolog text. For interoperability with the SWI-Prolog system, it is recommended to not use the predicate indicator main/0 inside a Prolog text.

package jekpro.tools.bundle;

import jekpro.tools.call.Capability;

public final class CapabilitySWI extends Capability {
public CapabilitySWI(String root);
}

Kommentare