1.10 Configuring Homepage |
Viewpoint Homepage can be manually configured. The Homepage GUI is generally composed of three columns of gadgets (gadgets are simple HTML and JavaScript applications that can be embedded in Web pages and other applications). Each gadget sizes horizontally according to the width of the browser while the height can be manually configured. There are several configuration options. You can configure the height, position, title, and permission of each gadget. After making the changes in the XML, a refresh of the Homepage displays the new configuration.
The gadget pages are loaded dynamically into Homepage in the order they are configured in the core.xml file. The configuration for Homepage gadgets follows generally, but not perfectly, the Google Gadgets API. Gadgets that are configured for Homepage can be altered to work in any Gadget API-compatible dashboard (such as the WSO2 Gadget Server). A simple module definition in the Google Gadgets API has this format:
<Module> <ModulePrefs title="Resource Utilization" height="400"/> <Content type="url" href="../charts/resource_utilization_chart.jsp" /> <UserPref name="loc" display_name="Location" required="true" /> </Module>
The gadget syntax for Homepage has been changed to adhere to the current syntax of the Viewpoint core.xml file (<Module
> has changed to <module
>, and <ModulePrefs
> has changed to <module-prefs
>). Additionally, information is added to the module for static configuration in the GUI (in Google Gadgets API compatible gadgets, the configuration is done through the GUI). A sample Viewpoint Homepage configuration looks like this:
<config> ... <home-page> <module> <module-prefs title="Resource Utilization" height="350"/> <content type="url" href="../charts/resource_utilization_chart.jsp"/> <positioning column="1" priority="3"/> <user-pref name="refresh" default_value="30" datatype="hidden" required="true"/> <permission>root</permission> </module> <module> <module-prefs title="Troubled Resources" height="400"/> <content type="url" href="../tables/troubled_resources_table.jsp"/> <positioning column="2" priority="1"/> <permission>root</permission> </module> <module> <module-prefs title="My Workload" height="350" /> <content type="url" href="jsp/dashboard/tables/workload_table.jsp" /> <positioning column="1" priority="4" /> <user-pref name="myWorkload" default_value="false" datatype="hidden" required="true" /> <permission name="nav.homepage" /> </module> <module> <module-prefs title="Jobs Needing Attention" height="350" /> <content type="url" href="jsp/dashboard/tables/jobs_needing_attention.jsp" /> <positioning column="2" priority="4" /> <user-pref name="needingAttention" default_value="true" datatype="hidden" required="true" /> <permission name="nav.homepage" /> </module> </home-page> ... </config>
The following is an explanation of the elements and their attributes:
module
> - This term comes from the Google Gadgets API. Each module contains or loads a gadget.
module-prefs
> - The preferences for the module. There are two attributes for <module-prefs
>:
title
- The title of the gadget which is displayed in the heading above the gadget.
height
- The height of the frame that display the gadget (in pixels).
content
> - Gadget loading information. There are two attributes for <content
>:
type
- In the Google Gadgets API there are 'url' and 'html' types. Currently, only 'url' is implemented in Homepage.
href
- The URL to the HTML page that should be included as the gadget.
positioning
> - The location where the gadget should be positioned in Homepage. This is not part of the Google Gadgets API. There are two attributes for <positioning
>:
column
- The column the gadget should be placed in (1 based). Not part of the Google Gadgets API.
priority
- The priority for positioning of the gadget toward the top. A higher priority is closer to the top.
Not part of the Google Gadgets API. user-pref
> - The Google Gadgets API does not permit <user-pref
> on 'url' type gadgets, but Homepage has one defined for refresh
. There are four attributes for <user-pref
>:
name
- The name of the preference.default_value
- For refresh, this value must be an int describing how many seconds to wait before the gadget is refreshed. datatype
- This must be set to hidden
for refresh. See Google Gadgets API for details. required
- This must be set to true
for refresh. See Google Gadgets API for details. permission
> - The permission for viewing the gadget.
Not part of the Google Gadgets API. There is one attribute for <permission
>:
name
- The name for the permission.