mapShareSetting


URI

<map_uri>/sharesetting[.<format>]

Supported methods

GET, PUT, HEAD

Parent resource

map

Introduction

Map share settings. By sending PUT request, you could update specified map permission. Map creators and administrators could update the specified map permission.

Supported Methods:

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

Resource hierarchy

HTTP request methods

Execute the HTTP request on the following URI, where supermapiportal is the server name, with rjson being the output format.

http://supermapiportal:8090/iportal/web/maps/{id}/sharesetting.rjson

GET request

Get the share settings of the specified map.

Response structure

The structure of the response resource representation after executing the GET request on the mapShareSetting resource will be as follows:

Field Type Description
entityName String Entity names, including names of USER, ROLE, GROUP, IPORTALGROUP.
entityType EntityType Entity types, including USER, ROLE, GROUP, IPORTALGROUP.
permissionType PermissionType Permisstion types that include READ, READWRITE, DELETE.
entityId Integer Entity ID. It is used to authorize groups.
aliasName String Entity alias name.

Response example

Execute the GET request on the mapShareSetting resource http://supermapiportal:8090/iportal/web/maps/1/sharesetting.rjson. The returned rjson result is as follows:

[

    {

        "aliasName": "GUEST",

        "entityId": null,

        "entityName": "GUEST",

        "entityType": "USER",

        "permissionType": "READ"

    },

    {

        "aliasName": "admin",

        "entityId": null,

        "entityName": "admin",

        "entityType": "USER",

        "permissionType": "DELETE"

    }

]

PUT request

Modify the share settings of the specified map.

Request parameter

Following arguments need to be passed in the request sent.

Field Type Description
entityName String Entity names, including names of USER, ROLE, GROUP, IPORTALGROUP.
entityType EntityType Entity types, including USER, ROLE, GROUP, IPORTALGROUP.
permissionType PermissionType Permisstion types that include READ, READWRITE, DELETE.
entityId Integer Entity ID. It is used to authorize groups.

Response structure

The structure of the response resource representation is as follows:

Field Type Description
succeed boolean Whether to modify the map sharing settings successfully or not.
error Httperror Error information. This field will not be displayed if the map sharing settings is successfully modified.

Response example

There are five types of updating single map share with mapShareSetting resource, i.e., private, public, specified department, specified group and specified user,. Public means all users (anonymous users included) are allowed to view and all users (login users only) are allowed to edit. Meanwhile, this resource can be set as public, specified department, specified group and specified users together, or one of settings only. The following example shows you how to set sharing patterns one by one (make sure that your login status is an map creator or an administrator):

1. Private

Modify the authorized information as private. In other words, only the map creator liyl can edit this map. Execute PUT request on the mapShareSetting resource: http://supermapiportal:8090/iportal/web/maps/1/sharesetting.rjson. The request body is as follows:

[

    {

        "aliasName": "xiaoli",

        "entityId": null,

        "entityName": "liyl",

        "entityType": "USER",

        "permissionType": "DELETE"

    }

]

The rjson format returned is as follows:

{ "succeed": true}

2. Public

Modify the authorized information as public. In other words, all users (anonymous users included) can check, and all users (login users only) can edit. Execute PUT request on mapShareSetting resource: http://supermapiportal:8090/iportal/web/maps/1/sharesetting.rjson. The request body is as follows:

[

    {

            "entityName": "GUEST",

            "entityType": "USER",

            "permissionType": "READWRITE"

    }

]

The rjson format returned is as follows:

{ "succeed": true}

3. Specified department

Modify the authorized information as the specified department of which all the members can edit. Execute PUT request on the mapShareSetting resource: http://supermapiportal:8090/iportal/web/maps/1/sharesetting.rjson. The request body is as follows:

 [

        {

            "entityId": "2",

            "entityType": "DEPARTMENT",

            "permissionType": "READWRITE"

        }

]

The rjson format returned is as follows:

{ "succeed": true}

4. Specified group

Modify the authorized information as the specified group members with ID 2 who has rights to edit this map. Execute PUT request on the mapShareSetting resource: http://supermapiportal:8090/iportal/web/maps/1/sharesetting.rjson. The request body is as follows:

 [

        {

            "entityId": 2,

            "entityType": "IPORTALGROUP",

            "permissionType": "READWRITE"

        }

]

The rjson format returned is as follows:

{ "succeed": true}

5. Specified user

Modify the authorized information as the specified user wanghl who has rights to edit this map. Execute PUT request on the mapShareSetting resource: http://supermapiportal:8090/iportal/web/maps/1/sharesetting.rjson. The request body is as follows:

 [

        {

            "entityName": "wanghl",

            "entityType": "USER",

            "permissionType": "READ"

        }

]

The rjson format returned is as follows:

{ "succeed": true}

 

HEAD request

Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content. The meta-information includes the media-type, content-encoding, transfer-encoding, content-length, etc.

HEAD request can be used to check if the mapShareSetting resource exists, or if the mapShareSetting resource can be accessed by clients. It can also determine if the mapShareSetting resource supports an output format <format> if performed on a URI with .<format> included.

See