{{indexmenu_n>1}}
===== OnLine Collections =====
\\
XOne Platform, by general rule, operates with a local database at the device, so that, although there is no data connection, we can work at any time with the application. \\
\\
This does not entail that always we have to work "OFF-LINE", it is the most comfortable and fast way for working with a device, but technology also allows us to create "ON LINE" collections to recover certain data or even creating "ON LINE" the full application if it was necessary. \\
\\
- The name of the **connection** nodes must be unique for the whole mappings.xml, although they are in different collections. They can be defined at any collection, to have all the connections located, the best is to define them in the app node at the start of the mappings.\\
- All the ONLINE collections load the data with LOADALL, the data CANNOT be browsed with STARTBROWSE.
\\
At XOne Platform, we have several ways to connect to get remote data:\\
\\
|< 80% 20% 25% 25% 30% >|
^ Online Connection Name ^ Connection Server ^ Clients ERP Connection ^ Platforms ^
| **JSONBD** | Intermediate Proxy intermedio that JSON returns | DB Connection | Android, IOS, W8 (Under development) |
| **JSONWS** | Intermediate Proxy that JSON returns | Web Service Connection | Android, IOS, W8 (Under development) |
| **xoneonline** | Intermediate Proxy that XML returns | DB Connection | Android, IOS, Windows Mobile, blackberry |
| **xonedirect** | Direct to Web Services of the client | Web Services of the client | Android, IOS (Under development) |
\\
==== Connection NODE in mappings ====
\\
At the ONLINE collections, we must have a **connection** node with the connection string to the intermediate Proxy, or Web Service from we will get the data.\\
\\
/*
^ Parámetros connection ^ Descripción ^
| **name** | Debe ser único en TODO el mappings. |
| **connstring** | Llamada al Proxy o Web Service al que nos vamos a conectar, pasándole diferentes parámetros, que veremos en la tabla siguiente.|
\\
Parámetros:\\
\\
^ Parámetros ^ Valor ^
| **Provider** | **Xone Remote Provider**. Este valor debe ser siempre así ya que es de sistema. |
| **Data Source** | Nombre del web service al que llamamos. |
| **namespace** | Nombre que se obtiene del WSDL del atributo targetNamespace. |
| **progid** | Nombre del progID utilizado por la maquinaria, los valores son los que aparecen en la tabla siguiente.|
\\
Valores:\\
\\
^ Parámetros ^ Valor ^
| **com.xone.db.soa.SOAConnection** | Utilizada para atacar directamente a los web service desde el frame. |
| **com.xone.db.json.JSONConnection** | Utilizada para conectarse a los web service a traves de proxy JSON. |
| **CGSProxy.CProxy** | Utilizada para conectarse con proxy genérico que devuelve XML, a los web services. |
\\
^ Parámetros connection ^ Descripción ^
| **Timeout** | Tiempo de espera de una respuesta antes de que de error. (En segundos) |
| **Security Level** | Tipo de seguridad (Numérico). Dependiente del proxy utilizado. |
| **method** | El método de obtener los datos del Proxy, GET o POST.|
*/
\\
^ Connection Parameters ^ Description ^
| **name** | It must be unique in the WHOLE mappings. |
| **connstring** | Call to the Proxy or Web Service to which we are going to connect, by passing it several parameters: \\ -**Provider** :**Xone Remote Provider**. This value must be always like that, since it is of system. \\ -**Data Source**:Web service name which we call to. \\ -**namespace**: Name we get from the WSDL of the targetNamespace attribute. \\ -**progid**:progID name used by the machinery, the values are: \\ -**1.com.xone.db.soa.SOAConnection**: Used to attack directly to the web service from the frame. \\ -**2.com.xone.db.json.JSONConnection**:Used to connect to the web service through´ the proxy JSON. \\ -**3.CGSProxy.CProxy** :Used to connect with generic proxy that returns XML, to the web services. |
| **Timeout** | Waiting time of an answer before it fails. (In seconds) |
| **Security Level** | Type of security (Numeric). Depending on the proxu used. |
| **method** | The method to get the data from the Proxy, GET or POST.|
\\
==== JSONDB Proxy ====
\\
Proxy that will attack the client´s database and will return the results in JSON form to the XOne Framework. (Faster than the old method of ONLINE collections that XML did return.). \\
\\
The last version of the Proxy can be obtained by downloading it from the web xonesupport.\\
{{ :b.-programacion:colecciones_online:coll_online_json_bd.png?nolink }}
\\
=== JSONDB Web.Config ===
\\
Within the Web.Config file from the proxy, we find the appSettings node:
\\
\\
|< 100% 20% 80% >|
^ appSettings node Parameters ^ Values ^
| **debug** | **true - false**\\ It leaves log at the events viewer. |
| **Connection String** | Connection string to the DataBase. |
| **Security Level** | **0 - 1 - 2 - 3**\\ 0.- Without security. The call is processed as it is.\\ 1.- Security with http header authentication. The user and password is sent to compare in local.\\ 2.- By session maintenance. A session token is needed that the server sends when it is authenticated.\\ 3.- By certificate. (Under development). |
| **Database Operations Allowed** | **select - insert - delete - update**\\ Oerations allowed at the time to work with the Database. |
\\
=== Example of the JSONDB type ===
\\
\\
|< 100% 20% 80% >|
^ Mappings Parameter ^ Remarks ^
| **sql** | Same than always, as if it were OFFLINE, the difference is that the sql is executed in a remote DB. |
| **filter and sort** | As usual, the WHERE and the ORDER BY of the SQL sentence. |
| **connection** | Value of the "name" attribute of the connection node defined below. |
| **userawsql** | In order the framework do not try to parse the sql and puts it in the form of a subquery, just leave it as it is in the SQL attribute. |
| **loadall** | Putting to "true". All the ONLINE collections load the data with LOADALL, the data cannot be browsed with STARTBROWSE. |
\\
==== JSONWS Proxy ====
\\
Proxy that will attack the client´s Web Services and will return the results in form of JSON to the XOne Framework. (Más rápido que el antiguo método de colecciones ONLINE que devolvía XML).\\
\\
The last version of the Proxy can be obtained by downloading it from the web xonesupport.\\
{{ :b.-programacion:colecciones_online:coll_online_json_web_services.png?nolink }}
\\
=== Example of the type JSONWS ===
\\
\\
=== JSONWS Web.Config ===
\\
Within the Web.Config file of the proxy, we can find the **appSettings** and **client** nodes:\\
\\
.....
.....
.....
\\
|< 100% 20% 80% >|
^ appSettings node Parameters ^ Values ^
| **debug** | **true - false**\\ Log is left in the events viewer. |
| **endpoint** | WSDL address of the Web Service which we have to connect to. E.g: http://www.cgsoft.net/geoipservice.asmx?WSDL\\
\\
If different Web Services are going to be called from the proxy, we have to put endpoint(whatever), being the value in parentheses the value of the attribute "**endpoint=whatever;**" by specifying in the call of the mappings.xml to call to a Web Service or another one.\\
\\
Example of call to web service in mappings.xml: \\
\\
|
| **Class** | It is the WSDL class. It is get at the end of the WSDL, at the section **wsdl:service name="Service"** (Usually, there is 2 in the WSDL, we take the first of them) and we add at the end "Client" , for instance, to the Class would be: "**servicesoapclient**" |
| **Security Level** | **0 - 1**\\ 0.- Without security. The call is processed as it is.\\ 1.- Security with http header authentication. The user and the password is sent to compare in local. The Security by heading must have it implemented the web service that is. |
^ Client node Parameters ^ Values ^
| **address** | The web service address. (WITHOUT the **?wsdl** at the end of the address) |
| **contract** | The WSDL contract that is at the end of itself, within the section **wsdl:service name="Service"** |
| **name** | It is indicated the same one than the contract. |
\\
==== XOneOnline ====
\\
Old way to make the ONLINE connections, that did return the data in XML format.\\
\\
{{ :b.-programacion:colecciones_online:coll_online_xml_bd.png?nolink }}
\\
=== Example of XOneOnline code ===
\\
\\
* The **sql** of the collection: "**SELECT t1.* FROM ##PREF##kk t1**" IT IS USELESS, and both **objname** and **updateobj** are empty, since we are NOT going to deal with a local Database.
* At a level of COLL node, we have a parameter **connection="proyecto_online1"** that is the one which specifies that the collection, is an *ONLINE** collection.
* Later, we have the **** node, which will be where the connection will be really defined with the webservice which the collection is going to work with. MUY IMPORTANTE, **the value of this attribure must be unique for the whole mappings**.
\\
The answer of the webservice must be something like this:\\
\\