Home page XML

From ISPWiki

Jump to: navigation, search

Contents

Introduction

In order to describe a "Home page" you need to use the billmgr_dashboard_5.xml file that is located in the /usr/local/ispmgr/etc directory. A digit in the file name defines a login level of the user who is going to use this file. For example, "5" is a billing customer.

When a user accesses the home page for the first time, the file content is copied into the /usr/local/ispmgr/var/userconf/billmgr.USERNAME.dashboard.xml file, where USERNAME is a login. All other changes made to the home page are kept in this file not affecting the main file and those of other users.

XML root element (doc)

 <xs:element name="doc"/>

The root element contains block elements that describe blocks of the home page.

Block (block)

 <xs:element name="block">
   <xs:complexType>
     <xs:attribute name="name" use="required" type="xs:NCName"/>
     <xs:attribute name="position" use="required" type="xs:NCName"/>
     <xs:attribute name="type" use="required" type="xs:NCName"/>  
     <xs:attribute name="func" type="xs:NCName"/>  
     <xs:attribute name="rows" type="xs:integer"/>  
   </xs:complexType>
 </xs:element>

Each block of the Home page is described by a separate block element:

the name attribute
block unique name.
the position attribute
location of the block on the Home page: top (the block is located on the top of the page), left (the block is located in the left column) or right (the block is located in the right column).
the type attribute
block type. It may have two values: toolbar (the block contains buttons) or list (the block contains table data).
the func attribute
it is present only if type="list". A name of the function, from which table data are taken.
the rows attribute
it is present only if type="list". The number of table lines to be listed.
the toolbtn element
describes a button, if type="toolbar". In case of type="list", it points to the toolbtn element of the main XML-file; the listed buttons will be used for performing operations over table elements.
the col element
points to the col element of the main XML-file. The listed columns will be displayed in the described block.

Button (toolbtn)

 <xs:element name="toolbtn">
   <xs:complexType>
     <xs:attribute name="name" use="required" type="xs:NCName"/>
     <xs:attribute name="img" use="required" type="xs:NCName"/>
     <xs:attribute name="func" use="required" type="xs:NCName"/>  
     <xs:attribute name="list" type="xs:NCName"/>  
     <xs:attribute name="action" type="xs:NCName"/>  
   </xs:complexType>
 </xs:element>

Describes a button, if type="toolbar". In case of type="list", it points to the toolbtn element of the main XML-file; the listed buttons will be used for performing operations over table elements.

the name attribute
button unique name. If it is used in the block with the type="list" attribute, it should have the same name as that of the main XML-file.
the img attribute
name of the image displayed on the button. You do not need to specify its extension.
the func attribute
contains a name of the function that will be displayed in a form when clicking this button. It can be used along with the list attribute.
the list attribute
contains a name of the function that will be displayed on the list when clicking this button. It can be used along with the func attribute.
the action attribute
contains the Javascript code that will be executed when clicking the button.

Table column (col)

 <xs:element name="col">
   <xs:complexType>
     <xs:attribute name="name" use="required" type="xs:NCName"/>
     <xs:attribute name="sort" use="required" type="xs:NCName"/>
     <xs:attribute name="sorted" use="required" type="xs:NCName"/>  
   </xs:complexType>
 </xs:element>

Points to the col element of the main XML-file. The listed columns will be displayed in the described block.

the name attribute
column name that should match that of the main XML-file column.
the sort attribute
specifies how to sort data in a column: alpha (alphabetical assortment; used by default), digit (numerical sorting in increasing order), file (alphabetical assortment, directories followed by files), indicator (sorting by "used value" of an indicator; only for columns with indicators), ip (IP-address sorting), prop (sorting by properties; only for columns that display property icons).
the sorted attribute
in case of sorted="asc", the table will be sorted by this column as default. In case of sorted="desc", it will be sorted in descending order.
Was this helpful? Yes | No
Personal tools