Difference between revisions of "GOCDB/Selecting Fields Shown in a Web Portal Table"
m |
|||
Line 13: | Line 13: | ||
When a table page is requested, the query name is specified in the URL as the &query= parameter. The parameter is the query name. For example in the URL: | When a table page is requested, the query name is specified in the URL as the &query= parameter. The parameter is the query name. For example in the URL: | ||
http://localhost/web%20portal/index.php?Page_Type=Table&query=Get_Site_Production¶meters[]=SHORT_NAME&start_row=0&end_row=20&form_name=Update_site&Title=Sites | <nowiki>http://localhost/web%20portal/index.php?Page_Type=Table&query=Get_Site_Production¶meters[]=SHORT_NAME&start_row=0&end_row=20&form_name=Update_site&Title=Sites</nowiki> | ||
The query name is "Get_Site_Production". | The query name is "Get_Site_Production". |
Revision as of 17:42, 19 November 2010
Back to GOCDB-4_Customisation
Modifying Fields Shown in a Table View
To add or remove a field from a table shown in the web portal, follow these three steps:
- Find out the name of the query used to get the table's data
- Find the individual query XML file corresponding to this query
- Add or remove fields from this XML file
Getting the Table's Query Name
When a table page is requested, the query name is specified in the URL as the &query= parameter. The parameter is the query name. For example in the URL:
http://localhost/web%20portal/index.php?Page_Type=Table&query=Get_Site_Production¶meters[]=SHORT_NAME&start_row=0&end_row=20&form_name=Update_site&Title=Sites
The query name is "Get_Site_Production".
Finding the Individual XML Query File
The individual XML query file contains a list of fields that are returned by a query. These are the fields to modify. Firstly, this file needs to be located.
To find out which individual query file corresponds to a query name, the "XML Output" queries XML file (containing data for all available queries) is used. In this release of GOCDB-4, the XML Output queries file is in the following location:
/opt/GOC4/config/xml_output/Queries-4.0d1.xml
Each available query is uniquely named in this file. Searching for a query name (in this case, "Get_Site_Production" in the 4.0d1 release) leads to the following XML:
<Get_Site_Production> <sql> select a.* from GOCDB_SITES inner join tobjects objects on objects.cobjectid=a.cobjectid where ( objects.cdateoff > sysdate or objects.cdateoff is null ) and objects.ctypeid=101 order by $0 </sql> <description>Get a list of Site objects</description> <output_file_format>../../config/xml_output/output_formats/Get_Site_Production.xml</output_file_format> </Get_Site_Production>
The final leaf node of this XML tree "output_file_format" specifies the individual query file location and name.
Modifying the Individual Query File
The individual file for the Get_Sites_Production query is as follows:
<?xml version="1.0" encoding="UTF-8"?> <data_definition> <site> <SHORT_NAME>SHORT_NAME</SHORT_NAME> <OFFICIAL_NAME>OFFICIAL_NAME</OFFICIAL_NAME> <LOCATION>LOCATION</LOCATION> <DESCRIPTION>DESCRIPTION</DESCRIPTION> <COBJECTID>COBJECTID</COBJECTID> <CGRIDID>CGRIDID</CGRIDID> </site> </data_definition>
Each field specified here is drawn in the table shown in the web portal. To remove a field, simply remove one of the leaf nodes. For example, deleting the line
<LOCATION>LOCATION</LOCATION>
will stop the location field from being drawn in the web portal.
The format of these fields is as follows:
<Web_Portal_Title>Database_Field_Name</Web_Portal_Title>
The database field name is the field name returned by the query specified in the "XML Output" queries XML file.
Special Cases
Some configuration files are used internally within the system to provide functionalities like the "Search" page and the individual tables shown when a "Site" object is viewed.
A list of these functions and their associated XML query name and individual query file name are included here:
Web Portal Table | Query Name | Individual Query File Name |
---|---|---|
Search results: users table | Get_User_Search | Get_User_Search.xml |
Search results: site table | Get_Site_Search | Get_Site_Search.xml |
Search results: service endpoints table | Get_Site_Search | Get_Site_Search.xml |
Viewing an individual site: downtimes table | Downtimes_For_Specified_Site | Get_Downtime_Production.xml |
Viewing an individual site: service endpoints table | Get_Endpoints_By_Site | Get_Service_Endpoint_By_Site.xml |