1 – Setup and customization > 1.3 Viewpoint customization > Dataview and Details customization

Dataview and Details customization

Viewpoint displays content based on dataviews and detailsproperties. Dataviews are used on pages (such as most "Management" pages) that display grids listing possible objects of a certain type, and usually—though not always—allow filtering and sorting. From these dataview pages, users can click a record that will open a Details view of the selected object that displays detailed information for the individual object.

Contained in the Viewpoint home directory under a sub-directory for the suite (for example, opt/viewpoint/cloud/) is a file named DataviewConfig.groovy. This file contains the layout and structure of the data grid and details pages within Viewpoint. The contents are each laid out per Viewpoint page.

dataview

"dataview" explanation

The following are (and must be) valid JSON constructs.

sort

page

filter

postFilter

Specifies a predefined filter that should be applied on page load to the records on the page. Note that users cannot remove this filter in the interface. Valid JSON is required. For example:

"postFilter":{"phase":"Rejected"}

actions

data

"dataview" example

nodes = """{
    "sort": {
        "${DV_SORT_SORT}": [
            {
                "name": "ASC"
            }
        ]
    },
    "page": {
        "${DV_PAGE_NUMBER}": 0,
        "${DV_PAGE_COUNT}": 20
    },
    "filter": "{}",
    "actions": {
        "buttons": [],
        "actionsBar": {
            "id": "vmActions",
            "visible": true
        }
    },
    "data": {
        "viewProperties": {
            "itemsPerPage": [
                20,
                30,
                50,
                100
            ],
            "multiSelect": true
        },
        "view": [
            {
                "${DV_PRIMARY_KEY}": "name",
                "${DV_VISIBLE_KEY}": 1,
                "${DV_SORTABLE_KEY}": 1,
                "${DV_FILTERABLE_KEY}": 1,
                "${DV_TYPE_KEY}": "${DV_STRING_TYPE}",
                "${DV_WIDTH_KEY}": 20
            },
            {
                "${DV_ID_KEY}": "datacenter",
                "${DV_DBKEY_KEY}": "attributes.MOAB_DATACENTER.displayValue",
                "${DV_VISIBLE_KEY}": 1,
                "${DV_SORTABLE_KEY}": 1,
                "${DV_FILTERABLE_KEY}": 1,
                "${DV_TYPE_KEY}": "${DV_STRING_TYPE}",
                "${DV_WIDTH_KEY}": 20
            },
            {
                "${DV_ID_KEY}": "state",
                "${DV_DBKEY_KEY}": "states.state",
                "${DV_VISIBLE_KEY}": 1,
                "${DV_SORTABLE_KEY}": 0,
                "${DV_FILTERABLE_KEY}": 0,
                "${DV_TYPE_KEY}": "${DV_STRING_TYPE}",
                "${DV_WIDTH_KEY}": 10
            },
            {
                "${DV_ID_KEY}": "totalMemory",
                "${DV_DBKEY_KEY}": "resources.memory.configured",
                "${DV_VISIBLE_KEY}": 1,
                "${DV_SORTABLE_KEY}": 1,
                "${DV_FILTERABLE_KEY}": 0,
                "${DV_TYPE_KEY}": "${DV_LONG_TYPE}",
                "${DV_WIDTH_KEY}": 20
            },
            {
                "${DV_ID_KEY}": "totalProcessors",
                "${DV_DBKEY_KEY}": "resources.processors.configured",
                "${DV_TITLE_KEY}": "dataview.nodes.title.totalProcessors",
                "${DV_NUM_FORMAT_KEY}": "###,###,##0.##",
                "${DV_VISIBLE_KEY}": 1,
                "${DV_SORTABLE_KEY}": 1,
                "${DV_FILTERABLE_KEY}": 0,
                "${DV_TYPE_KEY}": "${DV_NUMBER_TYPE}",
                "${DV_WIDTH_KEY}": 10
            },
            {
                "${DV_ID_KEY}": "reservations",
                "${DV_VISIBLE_KEY}": 1,
                "${DV_SORTABLE_KEY}": 1,
                "${DV_FILTERABLE_KEY}": 0,
                "${DV_TYPE_KEY}": "${DV_STRING_TYPE}",
                "${DV_WIDTH_KEY}": 25,
                "${DV_CHILDREN_KEY}": [
                    {
                        "${DV_ID_KEY}": "reservationName",
                        "${DV_DBKEY_KEY}": "name",
                        "${DV_TITLE_KEY}": "dataview.nodes.title.reservations",
                        "${DV_VISIBLE_KEY}": 1,
                        "${DV_SORTABLE_KEY}": 1,
                        "${DV_FILTERABLE_KEY}": 0,
                        "${DV_TYPE_KEY}": "${DV_STRING_TYPE}",
                        "${DV_WIDTH_KEY}": 25,
                        "${DV_JOIN_KEY}": ", " 
                    }
                ]
            },
            {
                "${DV_ID_KEY}": "featuresReported",
                "${DV_VISIBLE_KEY}": 1,
                "${DV_SORTABLE_KEY}": 1,
                "${DV_FILTERABLE_KEY}": 0,
                "${DV_TYPE_KEY}": "${DV_STRING_TYPE}",
                "${DV_WIDTH_KEY}": 50,
                "${DV_JOIN_KEY}": ", " 
            }
        ]
    }
}"""

detailsproperties

"detailsproperties" explanation

The following are (and must be) valid JSON constructs.

section

Indicates an array of sections available for details. See line 2 in the example code below.

"detailsproperties" example

node = """{
    "section": [
        {
            "title": "Node Details",
            "properties": [
                {
                    "id": "name",
                    "displayName": "Name",
                    "component": {
                        "type": "string"
                    },
                    "hidden": false
                },
                {
                    "id": "states.state",
                    "displayName": "State",
                    "component": {
                        "type": "string"
                    },
                    "hidden": false
                },
                {
                    "id": "states.powerState",
                    "displayName": "Power",
                    "component": {
                        "type": "string",
                        "optional": {
                            "className": "node-power-state"
                        }
                    },
                    "hidden": false
                },
                {
                    "id": "attributes.MOAB_TENANT.displayValue",
                    "displayName": "Tenant",
                    "component": {
                        "type": "string"
                    },
                    "hidden": false
                },
                {
                    "id": "attributes.MOAB_DATACENTER.displayValue",
                    "displayName": "Datacenter",
                    "component": {
                        "type": "string"
                    },
                    "hidden": false
                },
                {
                    "id": "ipAddress",
                    "displayName": "IP Address",
                    "component": {
                        "type": "string"
                    },
                    "hidden": false
                },
                {
                    "id": "operatingSystem.image",
                    "displayName": "Image",
                    "component": {
                        "type": "string"
                    },
                    "hidden": false
                },
                {
                    "id": "operatingSystem.hypervisorType",
                    "displayName": "Hypervisor type",
                    "component": {
                        "type": "string"
                    },
                    "hidden": false
                },
                {
                    "id": "resourceManagers",
                    "displayName": "Resource Managers",
                    "component": {
                        "type": "list",
                        "optional": {
                            "type": "object",
                            "list": [
                                {
                                    "property": "name",
                                    "showLabel": false
                                }
                            ]
                        }
                    },
                    "hidden": false
                },
                {
                    "id": "virtualMachines",
                    "displayName": "Virtual machines",
                    "component": {
                        "type": "list.none",
                        "optional": {
                            "type": "object",
                            "list": [
                                {
                                    "type": "link",
                                    "property": "name",
                                    "href": "/moab/vms/details"
                                }
                            ]
                        }
                    },
                    "hidden": false
                },
                {
                    "id": "jobs",
                    "displayName": "Jobs",
                    "component": {
                        "type": "list.none",
                        "optional": {
                            "type": "object",
                            "list": [
                                {
                                    "type": "link",
                                    "property": "name",
                                    "href": "/moab/job/details",
                                    "parameter": "nodelist=true"
                                }
                            ]
                        }
                    },
                    "hidden": false
                },
                {
                    "id": "reservations",
                    "displayName": "Reservations",
                    "component": {
                        "type": "list.none",
                        "optional": {
                            "type": "object",
                            "list": [
                                {
                                    "type": "link",
                                    "property": "name",
                                    "filterName": "type",
                                    "filterValue": "user",
                                    "href": "/moab/viewReservations/details"
                                }
                            ]
                        }
                    },
                    "hidden": false
                }
            ]
        },
        {
            "title": "Resources",
            "properties": [
                {
                    "id": "resources.processors.real",
                    "displayName": "Real processors",
                    "component": {
                        "type": "string"
                    },
                    "hidden": false
                },
                {
                    "id": "resources.processors.configured",
                    "displayName": "Processor overcommit limit",
                    "component": {
                        "type": "string"
                    },
                    "hidden": false
                },
                {
                    "id": "resources.processors.available",
                    "displayName": "Available processors",
                    "component": {
                        "type": "string"
                    },
                    "hidden": false
                },
                {
                    "id": "resources.memory.real",
                    "displayName": "Real memory (MB)",
                    "component": {
                        "type": "string"
                    },
                    "hidden": false
                },
                {
                    "id": "resources.memory.configured",
                    "displayName": "Memory (MB) overcommit limit",
                    "component": {
                        "type": "string"
                    },
                    "hidden": false
                },
                {
                    "id": "resources.memory.available",
                    "displayName": "Available memory (MB)",
                    "component": {
                        "type": "string"
                    },
                    "hidden": false
                },
                {
                    "id": "metrics.cpuUtilization",
                    "displayName": "CPU utilization",
                    "component": {
                        "type": "percentage"
                    },
                    "hidden": false
                },
                {
                    "id": "name",
                    "displayName": "Generic Resources",
                    "component": {
                        "type": "gResources",
                        "optional": {
                            "join": ", "
                        }
                    },
                    "hidden": false
                }
            ]
        }
    ]
}"""

Related topics