Module configuration file

The module configuration file is the file without the suffix, used for configuring the encoder, decoder and the resource configuration file. The file is located in Jar:///META-INF/extensions/services/rest.

Content:

encoders=<the absolute path of encoder>

decoders=<the absolute path of decoder>

verifiers=<the absolute path of security implementation class>

resourceFiles=<the absolute path of resource configuration file>

Where

  • encoders/decoders: specifies the absolute path of the implementation class of the encoder and decoder, and different implementation classes are separated by ";".
  • verifiers: the absolute path of security implementation class. It is used when extend the security mechanism.
  • resourceFiles: the resource configuration XML file (The path of Jar package, relative to the root directory of Jar).

When extending the existing resource module, it is required that the configuration file name should be consistent with the name of the pre-extension resource module.

The existing implemented resource modules by using the JAX-RS of the SuperMap iServer is the spatial analysis module.

Table The correspondence of the resource module and the configuration file

Module Configuration file name

Map

mapRest

Data

dataRest

Spatial analysis

spatialAnalystRest

Transportation analysis

networkanalystRest

3D

realspaceRest

Resource configuration file

Resource configuration file is a XML file, which is used to configure the REST resource information. It can configure the resource ID, resource implemention class and so on. It determines REST resource with Module configuration file.

There are two mechanisms Restlet and JAX-RS in SuperMap iServer. So there are differences in the structure of resource configuration file.

Resources based on Restlet mechanism, as shown below:

<?xml version="1.0" encoding="UTF-8"?>

<resources>

        <resource>

            <configID>rectangleArea</configID>

            <urlTemplate>/maps/{mapName}/rectangleArea</urlTemplate>

            <resourceType>ArithmeticResource</resourceType>

            <implementClass>com.supermap.sample.extendREST.RectangleAreaResource</implementClass>

            <extensionEncoderBeanNames></extensionEncoderBeanNames>

            <extensionDecoderBeanNames></extensionDecoderBeanNames>

        </resource>

</resources>

Where:

  • configID: the resource configuration ID;
  • urlTemplate: the URI module of resource, determining the URI of resource accessing;
  • resourceType: the resource type. See com.supermap.services.rest.commontypes.ResourceType;
  • implementClass: the absolute path of security implementation class.
  • extensionEncoderBeanNames: the class name of emcoder.
  • extensionDecoderBeanNames: the class name of decoder.

There can be more<resources/>in the<resource/>label, which corresponds to multiple resources.

The resources implemented based on JAX-RS, as shown below:

<?xml version="1.0" encoding="UTF-8"?>

<resources>

  <resource>

    <configID>mybuffer</configID>

    <implementClass>com.supermap.sample.extend.MyBufferResultsResource</implementClass>

  </resource>

</resources>

Where:

  • configID: The resource configuration ID
  • implementClass: The absolute path of the resource implementation class.

There can be more<resources/>in the<resource/>label, which corresponds to multiple resources.

 

When extending the existing resource module, it is required that the configuration file name should be consistent with the name of the pre-extension resource module.

The existing implemented resource modules by using the JAX-RS of the SuperMap iServer is the spatial analysis module.

Table The correspondence of the resource module and the configuration file

Module Configuration file path(iserver-all-*.jar)

Map

resource/rest/mappingResources.xml

Data

resource/rest/dataResources.xml

Spatial analysis

resource/rest/spatialanalystResources.xml

Transportation analysis

resource/rest/networkanalystResources.xml

3D

resource/rest/realspaceResources.xml