GXquery provides an API which allows developers to handle data types and methods to integrate queries made through GXquery within a GeneXus application.
SessionToken |
Security token for GXquery sessions. |
SessionContext |
Context information for GXquery sessions. |
Connection |
Connection information to GXquery. |
IsValid |
|
Verifies if the GXquery session is valid. |
Errors |
Out |
Error list, loaded by the method when error occurs. |
GetMetadatas |
|
Retrieves the list of metadata associated with the current session repository. |
Errors |
Out |
Error list, loaded by the method when error occurs. |
SetMetadata |
|
Sets the metadata to be used in the current session |
MetadataName |
In |
Name of the Metadata. |
Errors |
Out |
Error list, loaded by the method when error occurs. |
GetQueryByName |
|
Gets a query given its name. |
QueryName |
In |
Name of the Query. |
Errors |
Out |
Error list, loaded by the method when error occurs. |
GetQueries |
|
Gets the list of queries authorized for the current user. |
Option |
In |
Sets the way in which queries are retrieved, and has four possible values:
- AllQueries. Retrieves all queries, those owned by the current user and those shared with him by other users.
- OnlySharedQueries. Retrieves those queries shared with the current user.
- OnlyMyQueries. Retrieves only the current user's queries.
- OnlyMyRecentQueries. Retrieves the last twenty queries used by the current user.
|
GetQueriesTree |
|
Gets one level of the tree of queries authorized for the current user. |
ParentNodeType |
In |
Parent node type; its possible values are:
- Root. Indicates that it is the tree root and is invisible in the web interface.
Folder. Indicates the node is a folder.
Query. Indicates that it is a query.
SharedQueries. Indicates the node containing the queries shared with the user.
MyQueries. Indicates the node containing the queries owned by the user.
User. Indicates a user sharing queries with the current user. These nodes are nested in the SharedQueries node.
|
ParentNodeName |
|
Parent node name. |
Errors |
Out |
Error list, loaded by the method when error occurs. |
End |
|
End the current session. |
Errors |
Out |
Error list, loaded by the method when error occurs. |
In this example, the first sentence shows the StartSession method starting the session and loading the information in the GXquery Session data type.
In the second sentence, the &IsValid variable is loaded through the IsValid method.
In the third sentence, the GetMetadatas method retrieves the metadata list loading it into the &GXqueryMetadatas collection.
Event Start
&GXquerySession = &GXquery.StartSession(&RepositoryName, &UserName, &UserPassword, &Errors)
&IsValidSession = &GXquerySession.IsValid(&Errors)
&GXqueryMetadatas = &GXquerySession.GetMetadatas(&Errors)
EndEvent
In this other example, the metadata name is set directly.
&GXquerySession.SetMetadata(&MetadataName, &Errors)
And so on.