URI

<directory_uri>/resources[.<format>]

Supported methods

POST,DELETE

Parent resource

directory

Introduction

The dirResources resource is used to add, delete, or remove resources under a single directory. Administrator permissions are required.

Supported methods:

  • POST:Adds resources under a single directory.
  • DELETE:Batch deletes or removes resources under a single directory.

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

Resource hierarchy

HTTP request methods

Perform an HTTP request on the following URI, using rjson output format as an example, where supermapiportal is the server name.

http://supermapiportal:8190/iportal/web/directories/{id}/resources.rjson

POST request

Adds resources under a single directory.

Request parameters

When sending a request, the following parameters must be passed in the request body:

Name Type Description
resourceIds List<Integer> The collection of resource IDs.

Response structure

The returned resource representation structure is as follows:

Field Type Description
succeed boolean Whether adding resources to a single directory was successful.
error HttpError Error information. This field is not returned if adding resources to a single directory is successful.

Response example

Performing a POST request on the dirResources resource: http://localhost:8190/iportal/web/directories/1/resources.rjson to add a resource with ID 1 under the subdirectory with directory ID 1. The request body is as follows:

{

    "resourceIds": [

        "1"

    ]

}

The rjson format response is as follows:

{ "succeed": true}

DELETE request

Deletes or removes resource information with specified IDs under a single directory. The following parameters must be passed in the URL:

Field Type Description
resourceIds List<Integer> The collection of resource IDs in the directory.
isDeleteResources boolean Whether to delete resources from the portal. False means removing resources from the directory, true means deleting the resources from the portal.

Response structure

The returned resource representation structure is as follows:

Field Type Description
succeed boolean Whether deleting or removing resources was successful.
error HttpError Error information. This field is not returned if deleting or removing resources is successful.

Response example

Performing a DELETE request on the dirResources resource: http://localhost:8190/iportal/web/directories/1/resources.rjson?deleteDirOrResSetting={resourceIds:[2,3],isDeleteResources:false} to remove resources with IDs 2 and 3 from the subdirectory with directory ID 1. The rjson format response is as follows:

{ "succeed": true}

See