Unofficial Content
  • This documentation is valid for:

Spanish Version

Personalized Output in GXplorer/GXquery Web

Scope

Product: GXplorer, GXquery

Introduction

This new version introduces the possibility to include one or several user-developed outputs for the queries created with GXplorer and GXquery Web interfaces. With this new feature, users have the chance to develop and integrate inside the product any funcionality they need to process and display the information retrieved by the GXplorer and GXquery queries.

Description

Until now, those queries made in GXplorer and GXquery Web interfaces have had two possibilities to show the data to the user:

  • The Pivot Table component of the Microsoft Office Web Components.
  • One or several charts, of different type, of the queried data.

The new version, in addition to Cross-browser Pivot Table and Chart controls and Web Reports, allows adding new personalized outputs for the query data. These outputs must be implemented by the developer by adding two Web Services with predefined format that will be used by GXplorer and GXquery.

Architecture

CustomWebArch

General operation

Basically, what you do is adding new tabs to the ones already existing in the page to edit and view queries in GXplorer and GXquery Web. These tabs will then be added to the already existing Edition and Data tabs and to the tabs that the user could have been defined with the charts.

Each one of these new tabs are called viewers and they are implemented using two Web Services, which will be created by the developer following a predefined format that they will have to respect so that they are correctly used by GXplorer and GXquery Web interfaces.

When the user specifies a query and proceeds to execute it, GXplorer\GXquery will call one of these services that will name as Check. This service will verify if showing the query using the corresponding viewer makes sense. That is to say, it defines if the query is "visualizable" according to each personalized output. If it is visualizable, the tab corresponding to the viewer will be available to show the query.

The second service used to implement this feature, which we will name as Get, will be in charge of returning the query personalized output to the selected viewer. The latter is called on the associated tab.

Viewer Settings

The information of the viewers to be used must be set in a file called viewers.xml that must be in the Program directory of the installation folder.

This file has the following format:

<Viewers>
<Viewer>
<Name>Viewer1</Name>
<Description>Personalized Viewer 1</Description>
<Connection Host= "localhost" BaseUrl="/WS2/" Port ="80"
Secure="0" TimeOut="0"></Connection>
</Viewer>
<Viewer>
<Name>Viewer2</Name>
...
...
</Viewer>
...
</Viewers>


Where (the labels in bold are mandatory):

<Viewer> indicates each one of the new personalized viewers (new tabs on the query page)

<Name> is an internal identifier for the viewer
<Description> is the text to be shown in the corresponding tab
<Connection> services location information

  • Host: server where services are located. The predefined value is "localhost"
  • Port: server port where the services are located. The predefined value is 80.
  • BaseURL: server virtual directory where the service is located. The default value is "/".
  • Secure: Indicates whether HTTPS secure protocol (value 1) or HTTP insecure (value 0, default) will be used.
  • Timeout: Details the timeout in seconds to be used when calling the services. The default value is 0.

The URL to call the services will be generated as follows:

<http/https>://<host>:<port>/<baseurl>/...

Services to be used

The services to be implemented must adhere to the following specifications for them to be correctly used by GXplorer and GXquery Web. They must belong to the GXBI namespace and the name of the services and the name and type of each parameter must be respected.

Check Service
This service must be called GXBICheckQuery and must have the following format:

GXBICheckQuery (in: Character xmlQuerySpec, out: Boolean check)

Where:

  • xmlQuerySpec is a text in XML format with the query specification. An example of the format of this parameter values is available in the section XML parameters format.
  • check details whether the query corresponding to the given specification is suitable to be used with the viewer or not. It returns 1 if it is suitable and 0 if it is not.

Get Service
This service must be called GXBIGetResult and must have the following format:

GXBIGetResult (in: Character xmlQueryResult, in: Character xmlAbstractFormat, out: Character urlResult)

Where:

  • xmlAbstractFormat is the abstract format of the recently executed query. It is a text in XML format that contains information of the types, name, descriptions, etc. of the fields making up the query. An example of the format of this parameter values is available in the section XML parameters format.
  • xmlQueryResult is a text, also with XML format, that details the data obtained as a result of the query execution. An example of the format of this parameter values is available in the section XML parameters format XML.
  • urlResult is an URL that makes reference to a site or file where the query output with the look given by the corresponding viewer is located.

XML parameters format

To show the XML texts formats used by the services as parameters in a clear way, we will take the following query as an example:

Purchases in $ and Purchases Average in Units by country, analyzed by Year and Month.

Query Specification

The first XML text to be used by the services will be the one that will inform the query specification. It will have the following format:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<Metadata Id="10" Name="CarDealer (OLAP Simple)" CreatedOn="2006-05-10" ModifiedOn="2006-05-10" Version="0500"

Paradigm="Dimensions/Measures" Path="C:\Catalog\GXplorerCatalog\SampleOLAP\GXplData.gpm">

<WorkQuery Title="Purchases" Destination="Pivot Table" AllowPivoting="Yes" ShowSubTotals="Automatic">

<SubQuery Title="Purchases $" Measure=" Purchases $" Axis="Data" Position="1">
<QueryElement Name="Purchases $" Description=" Purchases in $">
</QueryElement>
<Aggregation Type="Sum">
</Aggregation>
</SubQuery>
<SubQuery Title="Purchases Un." Measure="Purchase Un." Axis="Data" Position="2">
<QueryElement Name=" Purchase Un." Description="Purchase in Units">
</QueryElement>
<Aggregation Type="Average">
<Dimension Name="Country">
<QueryElement Name="Country? Description="Country ">
</QueryElement>
</Dimension>
</Aggregation>
</SubQuery>

<Dimension Title="Year" Type="Axis" Axis="Rows" Position="1"
OrderBy="Description" Direction="Ascending">
<QueryElement Name="Year" Description="Year">
</QueryElement>
<Selection Type="All">
</Selection>
</Dimension>
<Dimension Title="Month" Type="Axis" Axis="Rows" Position="4"
OrderBy="Description" Direction="Ascending">
<QueryElement Name="Month" Description="Month">
</QueryElement>
<Selection Type="All">
</Selection>
</Dimension>

</WorkQuery>

</Metadata>

The most important elements (labels) to be taken into account are the following:

  • <Metadata>: metadata general information.

  • <Workquery>: query output information, such as title, table type and other properties.

  • <SubQuery>: query measures or data.

  • <Dimension>: query dimensions or axis.

Query abstract format

Once the query specification has been processed, when you call the service that obtains the output corresponding to the viewer, you must transfer two other XML texts corresponding to the query. One of them indicates the query abstract format and will have the following format:

<?xml version="1.0" encoding="ISO-8859-1"?>
<FormatSpec>

<Output Type="DinamicTable">
<Title>
<Caption>Purchases</Caption>
</Title>
</Output>

<QueryElements>
<QueryElement Id="D15" Name="Year" CanTotalize="false">
<Title>
<Caption>Year</Caption>
</Title>
<Cell>
<Picture>General</Picture>
</Cell>
<AxisInfo>
<Type>Row</Type>
<Position>1</Position>
</AxisInfo>
<OrderInfo Type="Alphabetic">
<AlphabeticOrder>
<Order>Descendent</Order>
</AlphabeticOrder>
</OrderInfo>
</QueryElement>
<QueryElement Id="D18" Name="Months" CanTotalize="false">
<Title>
<Caption>Months</Caption>
</Title>
<Cell>
<Picture>General</Picture>
</Cell>
<AxisInfo>
<Type>Row</Type>
<Position>4</Position>
</AxisInfo>
<OrderInfo Type="Alphabetic">
<AlphabeticOrder>
<Order>Descendent</Order>
</AlphabeticOrder>
</OrderInfo>
</QueryElement>
<QueryElement Id="S1" Name="Purchase in $" CanTotalize="false">
<Title>
<Caption>Purchase in ___FCKpd___2lt;/Caption>
</Title>
<Cell>
<Picture/>
</Cell>
<AxisInfo>
<Type>Data</Type>
<Position>1</Position>
</AxisInfo>
<OrderInfo Type="None">
</OrderInfo>
</QueryElement>
<QueryElement Id="S2" Name="Purchase in Units" CanTotalize="false">
<Title>
<Caption>Purchase in Units</Caption>
</Title>
<Cell>
<Picture/>
</Cell>
<AxisInfo>
<Type>Data</Type>
<Position>2</Position>
</AxisInfo>
<OrderInfo Type="None">
</OrderInfo>
</QueryElement>
</QueryElements>

</FormatSpec>

This text indicates query general information, such as the title and the fields making up the query output. The following is indicated for each field: an identifier, a title, format (Picture) to be used, order type and field type (axis or data), in addition to the other properties.

Query data

The other XML text to be transferred to the Get service will contain the data resulting from the query execution, in the following format:

<xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
xmlns:rs='urn:schemas-microsoft-com:rowset'
xmlns:z='#RowsetSchema'>

<s:Schema id='RowsetSchema'>
<s:ElementType name='row' content='eltOnly'>
<s:AttributeType name='D15' rs:number='1' rs:nullable='true'
rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='255'/>
</s:AttributeType>
<s:AttributeType name='D16' rs:number='2' rs:nullable='true'
rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='255'/>
</s:AttributeType>
<s:AttributeType name='S1' rs:number='5' rs:nullable='true'
rs:writeunknown='true'>
<s:datatype dt:type='number' rs:dbtype='currency' dt:maxLength='8'
rs:precision='19' rs:fixedlength='true'/>
</s:AttributeType>
<s:AttributeType name='S2' rs:number='6' rs:nullable='true'
rs:writeunknown='true'>
<s:datatype dt:type='number' rs:dbtype='currency' dt:maxLength='8'
rs:precision='19' rs:fixedlength='true'/>
</s:AttributeType>
<s:extends type='rs:rowbase'/>
</s:ElementType>
</s:Schema>

<rs:data>
<z:row D15='2000' D18='January' S1='84600' S2='9'/>
<z:row D15='2000' D18='June' S1='55700' S2='6'/>
<z:row D15='2000' D18='August' S1='83300' S2='9'/>
<z:row D15='2001' D18='January' S1='63430' S2='6'/>
<z:row D15='2001' D18='October' S1='37860' S2='3'/>
<z:row D15='2001' D18='November' S1='108800' S2='11'/>
<z:row D15='2001' D18='March' S1='53200' S2='3'/>
<z:row D15='2001' D18='May' S1='20560' S2='2'/>
<z:row D15='2001' D18='June' S1='26420' S2='2'/>
<z:row D15='2001' D18='July' S1='193870' S2='16'/>
<z:row D15='2001' D18='August' S1='68090' S2='5'/>
<z:row D15='2001' D18='September' S1='20740' S2='2'/>
<z:row D15='2002' D18='December' S1='46245' S2='3'/>
<z:row D15='2002' D18='February' S1='50500' S2='3'/>
<z:row D15='2002' D18='May' S1='145210' S2='10'/>
<z:row D15='2002' D18='June' S1='194380' S2='15'/>
<z:row D15='2002' D18='July' S1='10120' S2='1'/>
<z:row D15='2003' D18='October' S1='100350' S2='8'/>
<z:row D15='2003' D18='November' S1='64260' S2='4'/>
<z:row D15='2003' D18='February' S1='107800' S2='9'/>
<z:row D15='2003' D18='March' S1='217745' S2='13'/>
<z:row D15='2003' D18='May' S1='30220' S2='2'/>
<z:row D15='2003' D18='June' S1='121580' S2='10'/>
<z:row D15='2003' D18='July' S1='28500' S2='2'/>
<z:row D15='2004' D18='January' S1='62070' S2='5'/>
<z:row D15='2004' D18='October' S1='74360' S2='4'/>
<z:row D15='2004' D18='December' S1='96735' S2='6'/>
<z:row D15='2004' D18='April' S1='92020' S2='7'/>
<z:row D15='2004' D18='June' S1='54160' S2='3'/>
<z:row D15='2004' D18='July' S1='56590' S2='4'/>
<z:row D15='2004' D18='August' S1='142555' S2='11'/>
<z:row D15='2004' D18='September' S1='64860' S2='5'/>
<z:row D15='2005' D18='November' S1='243735' S2='15'/>
<z:row D15='2005' D18='March' S1='28290' S2='2'/>
<z:row D15='2005' D18='April' S1='27840' S2='2'/>
<z:row D15='2005' D18='May' S1='193980' S2='13'/>
</rs:data>
</xml>

The most important information is the one appearing under the <rs:data> label, where the data resulting from the query execution is detailed. The corresponding value is indicated for each query file, using the identifier specified in the query abstract format.

Considerations

  • Services must be developed in .Net Framework 1.14 or higher version. If you do not develop with GeneXus, you must add the prefix generated by GeneXus for Main procedures to the services names, A + service name.

Troubleshooting

If you detect problems while using the services we recommend taking into account the following points to detect the possible causes.

  • viewers.xml File

Check that the viewers.xml file is in the Program directory of the product installation and that the information on the viewers and their location is correct and is entered in the correct format. See section viewer settings.

  • Web Services Nomenclature

VVerify that the names of the services and the names and types of the parameters data expected by GXplorer/GXquery Web have been respected. If the services were not implemented in GeneXus, remember to add the ?A? prefix to the services names. See section services to be used.

  • Obtaining the Web services definition

Verify that the Web Services WSDL is correctly obtained:
http://<server>/<VirtualDirectory>/agxbicheckquery.asmx?wsdl
http://<server>/<VirtualDirectory>/agxbigetresult.asmx?wsdl

E.g.: execute the following in the local installation:
http://localhost/userServices/agxbicheckquery.asmx?wsdl
http://localhost/userServices/agxbigetresult.asmx?wsdl

  • Debug of a SOAP call

Follow the recommendations of the following link.

  • Windows Events Viewer

Check out the Windows Events viewer (application section) searching for error messages or Warnings.


Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant