URI
<portal_uri>/groups[.<format>]
Supported methods
Parent resource
Child resources
groupsApply, groupsInvite, groupsNameVerify, groupsStatus, group
Introduction
groups resource is the group resource manager. It includes the group resource set that the current users have the right to view, supports to create the group; supports to batch delete the group. The group creator can delete the created groups. The system administrator can delete all groups.
Supported Methods:
- GET: Get the group list info according to the query parameters.
- POST: Create the new group.
- DELETE: Delete the group, supporting batch delete the groups. Only the group creator has the right to delete the self-built group.
- HEAD: Check whether the groups resources exist, or whether the current user has the permission to access the groups resource.
Supported output formats: rjson, json, html, 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/groups.rjson
GET request
Get the group list info that the current users have the right to view.
Request parameter
If the parameters are not set,the group list info in the first page will be returned. After setting the parameters, the specified group list info will be returned. The request parameters should be included in the URI.
| Name | Type | Description |
| tags | String[] | Queries according to the group labels. |
| userNames | String[] | Queries according to the group creator names. |
| isPublic | Boolean | Query according to the status whether the group is public. |
| orderBy | GroupOrderBy | Query according to the group sort type. |
| joinTypes | JoinType[] | Query according to the group type: including CREATE, JOINED and CANJOIN |
| keywords | String[] | Queries according to the keyword. |
| filterFields | FilterFields[] | Fields filtering for keyword queries. Field names need to be capitalized. For example, keywords=["FA"]&filterFields=["GROUPNAME"] need to be set to filter according to the keyword characters of the group name. |
Response structure
Execute the GET request on the groups resource, return the group list that have the right to view. It consists of the following fields:
| Field | Type | Description |
| content | List<GroupBasicInfo> | The page content. |
| currentPage | int | Current page. |
| pageSize | int | The page size. |
| searchParameter | SearchParameter | The search parameter of the current page. |
| total | int | Total records. |
| totalPage | int | Total pages. |
Response example
The returned rjson format representation after executing the GET request on the groups resource http://localhost:8090/iportal/web/groups.rjson is as follows:
{
"content": [
{
"createTime": 1461721285156,
"creator": "admin",
"description": "",
"groupName": "FA",
"icon": null,
"id": 1,
"isEnabled": true,
"isNeedCheck": true,
"isPublic": true,
"nickname": "admin",
"resourceSharer": "MEMBER",
"tags": [
"iPortal"
],
"updateTime": 1461721285156
},
{
"createTime": 1461721383744,
"creator": "user1",
"description": "",
"groupName": "FB",
"icon": null,
"id": 2,
"isEnabled": true,
"isNeedCheck": true,
"isPublic": true,
"nickname": "user1",
"resourceSharer": "MEMBER",
"tags": [
"iserver"
],
"updateTime": 1461721383744
}
],
"currentPage": 1,
"pageSize": 9,
"searchParameter": {
"currentPage": 1,
"currentUser": null,
"filterFields": null,
"isEnabled": true,
"isPublic": null,
"joinTypes": null,
"keywords": null,
"orderBy": null,
"orderType": "ASC",
"pageSize": 9,
"returnCanJoin": false,
"returnCreate": false,
"returnJoined": false,
"tags": null,
"userNames": null
},
"total": 2,
"totalPage": 1
}
If you want to get the information of the specified group list, such as filtering according to the keyword characters of the group name, you need to set keywords=["FA"]&filterFields=["GROUPNAME"], that is, executing GET request on http://localhost:8090/iportal/web/groups.rjson? keywords=["FA"]&filterFields=["GROUPNAME"] resource, the returned rjson format representation is as follows:
{
"content": [
{
"createTime": 1461721285156,
"creator": "admin",
"description": "",
"groupName": "FA",
"icon": null,
"id": 1,
"isEnabled": true,
"isNeedCheck": true,
"isPublic": true,
"nickname": "admin",
"resourceSharer": "MEMBER",
"tags": [
"iPortal"
],
"updateTime": 1461721285156
}
],
"currentPage": 1,
"pageSize": 9,
"searchParameter": {
"currentPage": 1,
"currentUser": null,
"filterFields": [
"GROUPNAME"
],
"isEnabled": true,
"isPublic": null,
"joinTypes": null,
"keywords": [
"FA"
],
"orderBy": null,
"orderType": "ASC",
"pageSize": 9,
"returnCanJoin": false,
"returnCreate": false,
"returnJoined": false,
"tags": null,
"userNames": null
},
"total": 1,
"totalPage": 1
}
POST request
Create New Group
Request parameter
Following arguments need to be transmitted in the request sent:
| Name | Type | Description |
| icon | String | The group icon. It can be null. When it is null, it means to don't upload the group icon, and use the default icon. |
| tags | List<String> | The group label. |
| groupName | String | Geoup name. |
| isPublic | Boolean | Group type. The value is true: public. The value is false: private. |
| description | String | The descriptive information about the group. |
| resourceSharer | GroupRole | The resource sharer of the group. |
| isNeedCheck | Boolean | Whether to need to audit when apply to join the group. The default value is true. |
Response structure
The returned resource representation structure is as follows:
| Field | Type | Description |
| newResourceID | String | Create the id of new group. |
| newResourceLocation | String | Create the URI of new group. |
| succeed | boolean | Whether to create the new group. |
Response example
Perform the POST request on the groups resource: http://localhost:8090/iportal/web/groups.rjson. Create the new group. The request is as follows:
{
"icon": "resources/groupicons/iLogoa729262d4924e91b34e251c99d24dde.png",
"tags": [
"map"
],
"groupName": "iPortal",
"isPublic": false,
"description": "",
"resourceSharer": "CREATOR",
"isNeedCheck": false
}
The response result in rjson format returned is as follows:
{
"succeed": true,
"newResourceID": "20",
"newResourceLocation": "http://localhost:8090/iportal/web/groups/20"
}
DELETE request
Delete the group, supporting to batch deletion. url transmit needs to delete the group id array. The group creator can delete the created groups. The system administrator can delete all groups.
Response structure
The returned resource representation structure is as follows:
| Field | Type | Description |
| succeed | boolean | Whether to delete the group successfully. |
| error | Httperror | Error. If the delete the group successfully, it would not have this field. |
Response example
Execute the DELETE request on the groups resource: http://localhost:8090/iportal/web/groups.rjson?ids=[1,2]. Batch delete the groups that the id is 1 and 2. The returned rjson format 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 groups resource exists, or if the groups resource can be accessed by clients. It can also determine if the groups resource supports an output format <format> if performed on a URI with .<format> included.