<directory_uri>/resources[.<format>]
dirResources is to add, delete or remove resources in single directory. To do these operations needs administrative authority.
Supported Methods:
Supported output formats: RJSON, JSON, HTML, XML.
Implement the HTTP request on the following URI, where supermapiportal is the server name, with rjson being the output format.
http://supermapiportal:8090/iportal/web/directories/{id}/resources.rjson
Add resources in single directory.
Following arguments need to be passed in the request sent.
Name | Type | Description |
resourceIds | List<Integer> | The ID collection of the resources. |
The structure of the response resource representation is as follows:
Field | Type | Description |
succeed | boolean | Whether the resources are successfully added into the single directory. |
error | Httperror | Error information. This field will not be displayed if the resource is successfully added into single directory. |
Exectue POST request for dirResources http://localhost:8090/iportal/web/directories/1/resources.rjson, and add resources in the directory with No. 1. Resource ID is 1. The request body is as follows:
{
"resourceIds": [
"1"
]
}
The response result in rjson format returned is as follows:
{
"succeed": true
}
Delete or remove the resources information with specified ID under single directory. The following fields must be included in URL:
Field | Type | Description |
resourceIds | List<Integer> | The resource ID collection in the directory. |
isDeleteResources | boolean | Whether to delete resources from iPortal. Remove resources from the directory if it is fales; delete resources from the directory if it is true. |
The structure of the response resource representation is as follows:
Field | Type | Description |
succeed | boolean | Whether to delete or remove resources successfully. |
error | Httperror | Error information. This field will not be displayed if the resources are not successfully deleted or removed. |
Execute DELETE request for dirResources http://localhost:8090/iportal/web/directories/1/resources.rjson?deleteDirOrResSetting={resourceIds:[2,3],isDeleteResources:false}. Remove resources with ID 2 and 3 from the directory with ID 1. The returned rjson format response result is:
{ "succeed": true}