Alert.png The wiki is deprecated and due to be decommissioned by the end of September 2022.
The content is being migrated to other supports, new updates will be ignored and lost.
If needed you can get in touch with EGI SDIS team using operations @ egi.eu.

GOCDB/Selecting Fields Shown in a Web Portal Table

From EGIWiki
< GOCDB
Revision as of 17:31, 19 November 2010 by Aesch (talk | contribs) (Created page with ' Back to GOCDB-4.0d1 Customisation == Modifying Fields Shown in a Table View == To add or remove a field from a table shown in the web portal, f…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Back to GOCDB-4.0d1 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&parameters[]=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&#13;
  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>