homeConfig


URI

<uiConfig_uri>/pages/home[.<format>]

支持的方法

GETPUTHEAD

父资源

uiConfig

介绍

iPortal 的首页配置资源。首页配置包括 iPortal 首页中的各种 UI 组件的布局及其属性。

支持的方法:

支持的表述格式:JSON。

资源层次

HTTP 请求方法

对如下 URI 执行 HTTP 请求,以 json 输出格式为例加以说明,其中,supermapiportal 是服务器名。

http://supermapiportal:8190/iportal/web/uiconfig/pages/home.json

GET 请求

获取 iPortal 的首页配置,返回 iPortal 首页中所有 UI 组件及其布局和属性的集合。

响应结构

对 homeConfig 资源:http://localhost:8190/iportal/web/uiconfig/pages/home.json 执行 GET 请求,返回的 json 格式的资源表述如下:

字段 类型 说明
widgetList String[] iPortal 首页中 UI 组件的集合。

响应示例

对 homeConfig 资源:http://localhost:8190/iportal/web/uiconfig/pages/home.json 执行 GET 请求,返回的 json 格式的资源表述如下:

{

    "widgetList": [

        {

            "type": "row",

            "grid": "auto",

            "widgets": [

                {

                    "type": "Banner",

                    "id": "Banner001",

                    "param": {

                        "imgUrl": "{webUiRoot}homePageImg/banner2.png",

                        "title": "SuperMap iPortal 10i",

                        "titleColor": "#FFFFFF",

                        "subTitle": "$t(subTitle)",

                        "subTitleColor": "#FFFFFF",

                        "button": "$t(buttonTitle)",

                        "buttonColor": "#FFFFFF",

                        "buttonHref": "{portalRoot}/web-ui/home/edit"

                    }

                }

            ]

        },

        {

            "type": "row",

            "grid": "auto",

            "widgets": [

                {

                    "type": "ShortCutLinks",

                    "id": "ShortCutLinks001",

                    "param": {

                        "icon": "{webUiRoot}homePageImg/shortCut/map.png",

                        "title": "$t(shortCutLinks.map)",

                        "text": "$t(shortCutLinks.mapDescription)",

                        "href": "{portalRoot}/web-ui/resource-center/map"

                    }

                },

                {

                    "type": "ShortCutLinks",

                    "id": "ShortCutLinks002",

                    "param": {

                        "icon": "{webUiRoot}homePageImg/shortCut/service.png",

                        "title": "$t(shortCutLinks.service)",

                        "text": "$t(shortCutLinks.serviceDescription)",

                        "href": "{portalRoot}/web-ui/resource-center/service"

                    }

                },

                {

                    "type": "ShortCutLinks",

                    "id": "ShortCutLinks003",

                    "param": {

                        "icon": "{webUiRoot}homePageImg/shortCut/scene.png",

                        "title": "$t(shortCutLinks.scene)",

                        "text": "$t(shortCutLinks.sceneDescription)",

                        "href": "{portalRoot}/web-ui/resource-center/scene"

                    }

                },

                {

                    "type": "ShortCutLinks",

                    "id": "ShortCutLinks004",

                    "param": {

                        "icon": "{webUiRoot}homePageImg/shortCut/data.png",

                        "title": "$t(shortCutLinks.data)",

                        "text": "$t(shortCutLinks.dataDescription)",

                        "href": "{portalRoot}/web-ui/resource-center/data"

                    }

                },

                {

                    "type": "ShortCutLinks",

                    "id": "ShortCutLinks005",

                    "param": {

                        "icon": "{webUiRoot}homePageImg/shortCut/custom.png",

                        "title": "$t(shortCutLinks.customModule)",

                        "text": "$t(shortCutLinks.customModuleDescription)",

                        "href": "{portalRoot}/web-ui/resource-center/map"

                    }

                }

            ]

        },

        {

            "type": "row",

            "grid": "auto",

            "widgets": [

                {

                    "type": "ResourceCard",

                    "id": "RresourceCard001",

                    "param": {

                        "title": "$t(hotResouces)",

                        "resourceType": "hot"

                    }

                }

            ]

        }

    ]

}

PUT 请求

定制 iPortal 的首页。

请求参数

发送请求时,需要在请求体中传递如下参数:

名称 类型 含义
widgetList String[] 用户定制的 iPortal 首页中 UI 组件的集合。

响应结构

返回的资源表述结构如下:

字段 类型 说明
succeed boolean 保存定制的 iPortal 首页配置是否成功。
error Httperror 出错信息,如果保存成功,则没有本字段。

响应示例

对 iPortal 首页进行定制,对 homeConfig 资源:http://localhost:8190/iportal/web/uiconfig/pages/home.json 执行 PUT 请求,发送请求体如下:

{

    "widgetList": [

        {

            "type": "row",

            "grid": "auto",

            "widgets": [

                {

                    "type": "ShortCutLinks",

                    "id": "ShortCutLinks1565656815059",

                    "param": {

                        "icon": "{webUiRoot}homePageImg/shortCut/map.png",

                        "title": "地图",

                        "text": "发现更多感兴趣地图,快速创建精美地图。",

                        "href": "{portalRoot}/web-ui/resource-center/map"

                    }

                },

                {

                    "type": "ShortCutLinks",

                    "id": "ShortCutLinks1565659901115",

                    "param": {

                        "icon": "{webUiRoot}homePageImg/shortCut/map.png",

                        "title": "Map",

                        "text": "Discover more interesting maps and quickly create beautiful maps.",

                        "href": "{portalRoot}/web-ui/resource-center/map"

                    }

                }

            ]

        },

        {

            "type": "row",

            "grid": "auto",

            "widgets": [

                {

                    "type": "ResourceCard",

                    "id": "ResourceCard1565659906706",

                    "param": {

                        "title": "Hot Resouces",

                        "resourceType": "hot"

                    }

                }

            ]

        },

        {

            "type": "row",

            "grid": "auto",

            "widgets": [

                {

                    "type": "Banner",

                    "id": "Banner001",

                    "param": {

                        "imgUrl": "{webUiRoot}homePageImg/banner2.png",

                        "title": "SuperMap iPortal 10i",

                        "titleColor": "#FFFFFF",

                        "subTitle": "超图云GIS门户服务器",

                        "subTitleColor": "#FFFFFF",

                        "button": "快速定制首页 →",

                        "buttonColor": "#FFFFFF",

                        "buttonHref": "{portalRoot}/web-ui/home/edit"

                    }

                }

            ]

        },

        {

            "type": "row",

            "grid": "auto",

            "widgets": [

                {

                    "type": "ShortCutLinks",

                    "id": "ShortCutLinks001",

                    "param": {

                        "icon": "{webUiRoot}homePageImg/shortCut/map.png",

                        "title": "地图",

                        "text": "发现更多感兴趣地图,快速创建精美地图。",

                        "href": "{portalRoot}/web-ui/resource-center/map"

                    }

                },

                {

                    "type": "ShortCutLinks",

                    "id": "ShortCutLinks002",

                    "param": {

                        "icon": "{webUiRoot}homePageImg/shortCut/service.png",

                        "title": "服务",

                        "text": "聚合多种类型GIS服务,快速注册GIS服务。",

                        "href": "{portalRoot}/web-ui/resource-center/service"

                    }

                },

                {

                    "type": "ShortCutLinks",

                    "id": "ShortCutLinks003",

                    "param": {

                        "icon": "{webUiRoot}homePageImg/shortCut/scene.png",

                        "title": "场景",

                        "text": "在线浏览三维场景,快速创建三维场景。",

                        "href": "{portalRoot}/web-ui/resource-center/scene"

                    }

                },

                {

                    "type": "ShortCutLinks",

                    "id": "ShortCutLinks004",

                    "param": {

                        "icon": "{webUiRoot}homePageImg/shortCut/data.png",

                        "title": "数据",

                        "text": "发现更多精彩数据,上传并分享你的数据。",

                        "href": "{portalRoot}/web-ui/resource-center/data"

                    }

                },

                {

                    "type": "ShortCutLinks",

                    "id": "ShortCutLinks005",

                    "param": {

                        "icon": "{webUiRoot}homePageImg/shortCut/custom.png",

                        "title": "自定义模块",

                        "text": "添加图片和url,定制专属快捷链接。",

                        "href": "{portalRoot}/web-ui/resource-center/map"

                    }

                }

            ]

        },

        {

            "type": "row",

            "grid": "auto",

            "widgets": [

                {

                    "type": "ResourceCard",

                    "id": "RresourceCard001",

                    "param": {

                        "title": "热门资源",

                        "resourceType": "hot"

                    }

                }

            ]

        }

    ]

}

则返回的 json 格式响应结果如下:

{"succeed": true}

HEAD 请求

返回跟 GET 请求一样的 HTTP 响应头,但是没有响应实体。可以在不必传输整个响应内容的情况下,获取包含在响应消息头中的元数据信息。元数据信息包括媒体类型,字符编码,压缩编码,实体内容长度等。

HEAD 请求可以用来判断 homeConfig 资源是否存在,或者客户端是否有权限访问 homeConfig 资源。通过对加.<format>的 URI 执行 HEAD 请求,还可以快速判断 homeConfig 资源是否支持<format>格式的表述。

请参见