workspaces


URI

<managerRoot_uri>/workspaces[.<format>]

Supported methods

GET, POST, PUT, HEAD

Parent resource

managerRoot

Introduction

The workspaces resource lists all current workspaces. You can quickly publish a workspace as GIS services through the POST requests. Currently, only UGC workspace is supported to be published. For related samples, please refer to Quickly Publishing GIS Services (Through REST API). To delete a service instance corresponding to one specific workspace, use PUT operation.

Supported Methods:

Supported output formats: RJSON, JSON, HTML, XML.

Resource hierarchy

HTTP request methods

Execute HTTP request on the following URI, here we take rjosn as the output format as an example. Where, supermapiserver is the server name.

http://localhost:8090/iserver/manager/workspaces.rjson

GET request

Gets all current workspaces.

Response structure

After executing a GET request on the resource, the response entity is a list of workspaces, and the response fields of single workspace are as follows:

Field Type Description
address String Workspace file path.
enabled boolean Marks whether the service is available.
message String If enabled is false, ie., the service is unavailable, message will show the reason.
name String Workspace name, such as: China400.smwu.
serviceName String Service name, such as: map-china400/rest.
serviceType String Service type, which can be Map, Data, 3D, TransportationAnalyst, SpatialAnalyst and TrafficTransferAnalyst, etc.

Response example

By executing a GET request on workspaces resource with URI: http://localhost:8090/iserver/manager/workspaces.rjson, the returned response result in rjosn format is as follows:

POST request

Quickly publishes the workspace as GIS services.

Request parameter

The following parameters are needed in the request body

Name Type Description
workspaceConnectionInfo String

[Required]
Workspace file path or database connection info.

Such as, for a database workspace, use the following connection:
"workspaceConnectionInfo": "server=orcl203;username=test;password=test;type=ORACLE;database=;name=testWorkSpace;driver=null"

servicesTypes

ServiceType[]

[Required]
Service types to be published. While publishing multiple services, use "," to separate each type.
isDataEditable boolean Required if servicesTypes is RESTDATA, WFS100, WCS111 or WCS112, which indicates whether the data of the service is editable. False denotes "Uneditable".
datasourceInfos FilteredDatasourceInfo

[Optional. Only used when publishing data services.]

Used to filter the datasets to be published when publishing data services.

transferLineSetting

TransferLineSetting

Bus line environment settings for publishing traffic transfer services.
transferNetName String Traffic network name for publishing traffic transfer services.
transferRelationSetting

TransferRelationSetting

Bus stop and line relationship settings for publishing traffic transfer services.
transferStopSetting

TransferStopSetting

Bus stop environment settings for publishing traffic transfer services.
unit

Unit

Unit of the stop caputuring tolorance, tolerance for merging stops with the same name, and walking tolerance for transferring. Default value is meter.
walkingTolerance double Walking tolerance for transferring used when publishing traffic transfer services. Defaults to 1000.
mergeTolerance double Tolerance for merging stops with the same name used when publishing traffic transfer services.
snapTolerance double Stop caputuring tolorance for publishing traffic transfer services.
transportationAnalystSetting TransportationAnalystSetting Provider Environment setting class for publishing transportation analysis service.
facilityAnalyst3DSetting UGCNetworkAnalyst3DSetting Provider Environment setting class for publishing 3D facility network analysis service.

addressMatchProviderSetting

UGCAddressMatchProviderSetting Provider Environment setting class for publishing address matching service.

Response structure

The response result is the array composed by the published GIS services. Each info includes:

Field Type Description
serviceAddress String The published available service address.
serviceType

ServiceType

Service type.

Response example 1

Perform a POST request on the workspaces resource with URI: http://localhost:8090/iserver/manager/workspaces.rjson to quickly publish the workspace World.sxwu as RESTMAP srevice:

{

    "servicesTypes": ["RESTMAP", "RESTDATA", "WMS111"],

    "workspaceConnectionInfo": "../samples/data/World/World.sxwu"

}

the returned created service would be as follows:

[{

    "serviceAddress": "http://localhost:8090/iserver/services/map-world2/rest",

    "serviceType": "RESTMAP"

},

{

    "serviceAddress": "http://localhost:8090/iserver/services/data-world2/rest",

    "serviceType": "RESTDATA"

},

{

    "serviceAddress": "http://localhost:8090/iserver/services/map-world2/wms111",

    "serviceType": "WMS111"

}]

Response example 2

This example we'll filter the datasets to be published to publish a data service by performing a POST request on workspaces resource with URI: http://localhost:8090/iserver/manager/workspaces.rjson, and the request body is as follows:

{

    "workspaceConnectionInfo": "F:/4.datastore/Data/data/DynamicData/DynamicData.smwu",

    "servicesTypes": [

        "RESTDATA"

    ],

    "datasourceInfos": [

        {

            "connInfo": {

                "alias": "DynamicData",

                "server": "F:/4.datastore/Data/data/DynamicData/DynamicData.udb",

                "engineType": "UDB"

            },

            "includedDatasetNames": [

                "Point"

            ]

        }

    ]

}

the returned created service is as follows:

{

    "serviceAddress": "http://localhost:8090/iserver/services/data-DynamicData5/rest",

    "serviceType": "RESTDATA"

}

PUT request

Simulates DELETE to delete the service instance corresponding to the specified workspace.

Request parameter

Needed parameters in the request body:

Name Type Description
workspaceConnectionInfo String [Required]

Workspace file path or database connection info.

Such as, for a database workspace, use the following connection:
"server=orcl203;username=test;password=test;type=ORACLE;database=;name=testWorkSpace;driver=null"

 

Response structure

The returned resource representation structure of the response entity is as follows:

Field Type Description
succeed boolean Whether the workspace has been deleted successfully.

Example

Perform a PUT request on workspaces resource with URI: http://localhost:8090/iserver/manager/workspaces.rjson to delete the workspace China400.smwu and the following request body:

{

   "workspaceConnectionInfo":"../../samples/data/China400/China400.smwu"

}

the returned response result in rjson format is as follows:

{"succeed": true}

HEAD request

Returns the same HTTP response header as the GET request, but no response entity, which can be used to retrieve the meta data contained in response message header without having to transmit the entire response content. Meta data information includes media type, character coding, compression coding, entity content length, etc.

HEAD request is used to determine whether the workspaces resource exists, or if the user has the authority to access it. By executing an HEAD request with a .<format> URI, you can quickly determine whether the workspaces resource supports the <format> representation.

See