publishStatus


URI

<myData_uri>/publishstatus[.<format>]

Supported methods

GET, PUT, HEAD

Parent resource

mydata

Introduction

publishStatus reource indicates the publishing status of the service which are got by publishing the uploaded data. The publishing status can be quried by sending GET request. And by sending PUT request, the status can be updated, including publishing service, republishing service, canceling single published service or canceling all the published services.

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://supermapiportal:8090/iportal/web/mycontent/datas/{id}/publishstatus.rjson

GET requests

Queries the publishing status of the service (by publishing the uploaded data).

Request parameter

The request parameters must be included in the URI.

Name Type Description

forPublish

Boolean The published status of the service identified by dataServiceId to be queried, ture or false.
dataServiceId String ID of the service, a unique identifier of the service.

Response structure

The structure of the response resource representation is as follows:

Field Type Description
succeed boolean Whether the query operation is successful.
error Httperror Error message. If the query operation is successful, the result doesn't include this field.

Response example

Perform GET request on publishstatus resource: http://localhost:8090/iportal/web/mycontent/datas/1/publishstatus.rjson?dataServiceId=map_ChengShi0407&forPublish=true, the returned representation with rjson as output format is as follows:

{"succeed":true}

PUT request

Updates the publishing status of the service (by publishing the uploaded data).

Request parameter

When sending a PUT request, the following parameters should be included in the request body:

Name Type Definition

publish

boolean true represents publish; false represents cancel publishing.

and the following parameters should be included in URI:

Name Type Definition

serviceType

DataServiceType The service type to be published, currently supports: RESTDATA, RESTMAP, RESTREALSPACE.

dataServiceId

String The id of the service to be updated.

dataServiceName

String Used to specify the name of the published service. If not passed, the system will generate the name automatically.

Response structure

The structure of the response resource representation is as follows:

Field

Type Description

succeed

boolean Whether the status is updated successfully. True represents success; otherwise, false.

Response example

Updating the publishing status of a service includes: publish service, re-publish service, cancel one published service (ie., delete single service), cancel all the published service (ie., delete all the services by publishing the specified data). Below shows how to update these status.

1. Publish a service

To publish the uploaded data as services, you should pass parameters like following, here we take publishing one uploaded data identified by 1929877332 as map service and data service as the example. After the publishing operation is successful, you can get the service address by sending a GET request on services resource.

Execute the PUT request http://localhost:8090/iportal/web/mycontent/datas/1929877332/publishstatus.json?serviceType=RESTMAP,RESTDATA on publishstatus resource with the following request body:

true

the returned result in rjson format is:

{"succeed":true}

2. Re-publish a service

If one service failed to publish, you can republish it. You need to pass the following parameters. After the republishing operation is successful, you can get the service address by sending a GET request on services resource.

Execute the PUT request http://localhost:8090/iportal/web/mycontent/datas/1929877332/publishstatus.json?serviceType=RESTMAP&dataServiceId=map_city on publishstatus resource with the following request body:

true

the returned result in rjson format is:

{"succeed":true}

3. Cancel a published service (Delete single service)

Execute the PUT request http://localhost:8090/iportal/web/mycontent/datas/1929877332/publishstatus.json?serviceType=RESTMAP&dataServiceId=map_city on publishstatus resource with the following request body to delete a published service:

false

the returned result in rjson format is:

{"succeed":true}

4. Cancel all the published services by publishing the specified data (Delete all the services)

Execute the PUT request http://localhost:8090/iportal/web/mycontent/datas/1929877332/publishstatus.json on publishstatus resource with the following request body:

false

the returned result in rjson format is:

{"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 publishstatus 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 publishstatus resource supports the <format> representation.

 

See