apps


URI

<portal_uri>/apps[.<format>]

Supported methods

GET, POST, DELETE, HEAD

Parent resource

portal

Child resources

app

Introduction

apps resource is an application list for users who have right to view. It supports registering a new application, and supports deletes applications in a batch.

Supported Methods:

Supported output formats: rjson, json, html, xml.

Resource hierarchy

HTTP request methods

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

http://supermapiportal:8090/iportal/web/apps.rjson

GET request

Gets the list of all the applications that the current user is allowed to view.

Request parameter

If no query parameters are set, it will return the list of all the application on the first page that the current user can access. To query with the specified conditions, you should set the following parameters according to your needs and include them in URI.

Name Type Description
userNames String[] Query by the app registrant name.
tags String[] Filter by application tag.
type AppType Filter by application type.
currentUser User Filter by current logged in user.
orderBy AppOrderBy Filter by order type.
keywords String[] Query by keyword.
filterFields FilterFields[] Field filtering for keyword queries. Field names need to be capitalized. For example, to filter based on the keyword of the application, you need to set keywords=["231"]&filterFields=["APPNAME"].
createStart Long Query apps created at this time value or after this time value. If the value is null or less than 0, the start time for app queries is not limited.
createEnd Long Query apps created earlier than or at this time value. If the value is null or less than 0, the end time for app queries is not limited.

Response structure

Execute a GET request on the apps resource, the list of all the apps that the current user is allowed to view will be returned. It includes the following fields:

Field Type Description
content List<IportalApp> Contents of the page.
currentPage int Current page number.
pageSize int Page size.
searchParameter SearchParameter Search parameter on current page.
total int Total records.
totalPage int Total pages.

Response example

Exectue a GET request on apps resource http://localhost:8090/iportal/web/apps.rjson, the returned representation in rjson format will be as follows:

{

    "content": [

        {

            "address": "http://192.168.120.40:8091/iserver/",

            "appName": "iServer",

            "authorizeSetting": null,

            "createTime": 1473735076726,

            "description": "",

            "id": 1,

            "nickname": "admin",

            "tags": [

                "JavaScript"

            ],

            "thumbnail": null,

            "type": "WEBAPP",

            "updateTime": 1473735076726,

            "userName": "admin"

        },

        {

            "address": "http://sonar.ispeco.com:9001/",

            "appName": "sonar",

            "authorizeSetting": null,

            "createTime": 1473737277572,

            "description": "",

            "id": 2,

            "nickname": "admin",

            "tags": [

                "JavaScript"

            ],

            "thumbnail": "http://localhost:8090/iportal/services/../resources/thumbnail/app/app2.png",

            "type": null,

            "updateTime": 1473746891079,

            "userName": "admin"

        }

    ],

    "currentPage": 1,

    "pageSize": 9,

    "searchParameter": {

        "currentPage": 1,

        "currentUser": null,

        "filterFields": null,

        "groupIds": [],

        "keywords": null,

        "orderBy": null,

        "orderType": "ASC",

        "pageSize": 9,

        "tags": null,

        "type": null,

        "userNames": null

    },

    "total": 2,

    "totalPage": 1

}

If you want to get the specified app list information, for example, filter according to the app's key cahracters, you need to set keywords=["iServer"]&filterFields=["APPNAME"], that is ,execute GET request on apps resource: http://localhost:8090/iportal/web/maps.rjson?keywords=["iServer"]&filterFields=["APPNAME"], the returned rjson format representation will be as follows:

{

    "content": [

        {

            "address": "http://192.168.120.40:8091/iserver/",

            "appName": "iServer",

            "authorizeSetting": null,

            "createTime": 1473735076726,

            "description": "",

            "id": 1,

            "nickname": "admin",

            "tags": [

                "JavaScript"

            ],

            "thumbnail": null,

            "type": "WEBAPP",

            "updateTime": 1473735076726,

            "userName": "admin"

        }

    ],

    "currentPage": 1,

    "pageSize": 9,

    "searchParameter": {

        "currentPage": 1,

        "currentUser": null,

        "filterFields": [

            "APPNAME"

        ],

        "groupIds": null,

        "keywords": [

            "iServer"

        ],

        "orderBy": null,

        "orderType": "ASC",

        "pageSize": 9,

        "tags": null,

        "type": null,

        "userNames": null

    },

    "total": 1,

    "totalPage": 1

}

POST request

Registers a new application.

Request parameter

To send a POST request, the following parameters need to be included in the request body.

Name Type Description
tags List<String> The tag of registered application.
appName String The name of registered application.
address String The address of registered application.
description String The description of registered application.
type AppType The type of registered application.
authorizeSetting List<IportalAuthorizeEntity> Authorization information. The types of permissions applied include: DELETE (View / Edit / Delete), READ, READWRITE (View / Edit).

Response structure

The structure for the resource representation returned should be:

Field Type Description
newResourceID String ID of new registered application.
newResourceLocation String URI of new registered application.
succeed boolean Whether application is registered successfully or not.

Response example

Execute a POST request on the apps resource: http://localhost:8090/iportal/web/apps.rjson to create register an application with the following request body:

{

    "tags": [

        "JavaScript"

    ],

    "appName": "sonar",

    "address": "http://sonar.ispeco.com:9001/",

    "description": "",

    "type": "WEBAPP",

    "authorizeSetting": [

        {

            "entityType": "USER",

            "entityName": "GUEST",

            "permissionType": "READ"

        }

    ]

}

Then the returned result in rjson format will be:

{

    "succeed": true,

    "newResourceID": "3",

    "newResourceLocation": "http://localhost:8090/iportal/web/apps/3"

}

DELETE request

Deletes applications. The URL should include the id array of the applications to be deleted.

Response structure

The structure for the resource representation returned should be:

Field Type Description
succeed boolean Whether the application is successfully deleted.
error Httperror Error information. This field will not be displayed if the application is successfully deleted.

Response example

The returned rjson format representation after executing the DELETE request on the apps resource http://localhost:8090/iportal/web/apps.rjson?ids=[1,2], to delete the apps with id being "1" and "2" in a batch:

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

See