Unofficial Content
  • This documentation is valid for:

GXquery4 - GXquery EO structure

The GXquery service layer, known as API, includes all the data types that allow the developer to interact with GXquery at runtime through script code. One of these data types is described below.

The GXquery data type is used to work with GXquery from the point of view of the server connection and start a session.

Properties

Connection Based in the GXqueryConnection data type, this property contains the server direction, the communication port, its URL-base.

 

Methods

StartSession   Allows starting a GXquery session, checking the user's credentials and setting the repository.
      RepositoryName   In Is the name of the repository against which will verify user credentials.
      UserName   In Is the user name logged in the session.
      User Password   In Is the user password logged in the session.
      Errors  Out Is the errors list, loaded by the method when error occurs.
StartSessionByToken   Starts a session in GXquery from a GAM token.
     GAMToken   In Is the GAM token. 
     Errors Out Is the errors list, loaded by the method when error occurs.
SetLaguage   Sets the language of GXquery messages
      Language In Is the language in which the messages are displayed
      Errors Out Is the errors list, loaded by the method when error occurs.
CheckLicense   Check if there are available licences
      - Out True if there are available licenses
      Errors Out Is the errors list, loaded by the method when error occurs.

 

Examples

In this example the session is starting.

Event 'StartSession'
    &GXquerySession = &GXquery.StartSession(&RepositoryName, &UserName, &UserPassword, &Errors)
    If &Errors.Count > 0
       &StartSessionStatus = &Errors.Item(1).Message
    Else
       &StartSessionStatus = "Start session successful"
    EndIf
EndEvent

In this example the session is starting with the token value.

Event 'StartSessionByToken'
    &GXquerySession = &GXquery.StartSessionByToken(&GXquerySessionToken, &Errors)
    If &Errors.Count > 0
       &StartSessionByTokenStatus = &Errors.Item(1).Message
    Else
       &StartSessionByTokenStatus = "Start session by token successful"
    EndIf
EndEvent

In this example we set the language.

Event 'SetLanguage'
    &GXquery.SetLanguage(&Language, &Errors) //&language type is GXqueryLanguages
    If &Errors.Count > 0
        &SetLanguageStatus = &Errors.Item(1).Message
    Else
        &SetLanguageStatus = "SetLanguageSuccessful"
    EndIf
EndEvent

In this example we check for available licenceses.

Event 'CheckLicense'
   &AvailableLicense = GXquery.CheckLicense()
   If &AvailableLicense
        //StartSession for example
   else
        //Get Errors
        &Errors = &Errors.Item(1).Message
   endif
EndEvent

See also

Availability

The SetLanguage() method is available as of GXquery 4.0 Upgrade 3.

The CheckLincese() method is available as of GXquery 4.0 Upgrade 4.


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