-
Notifications
You must be signed in to change notification settings - Fork 0
Framesoc query API
This page describes how to use the Framesoc query API. The tutorial has been developed using Eclipse Luna and Framesoc v1.0.6. The corresponding source code is available in the fr.inria.soctrace.framesoc.tutorials.query
plugin of this repository.
- Configure a working Framesoc development environment, as described here.
- Learn to create a Framesoc tool, as described here. Only the creation of the plugin is necessary for this tutorial.
TODO: provide a summary of the principles of the query objects and the different types of conditions
TODO: introduce the search interface
More details about the query API and the high level search interface are available in the Technical Report RT-427 (subsections 4.1.3 and 4.1.4). Note that the package names used in this report may not be up to date with the current ones, but the concepts are unchanged.
We will create here an empty Framesoc tool plugin. We will use its launch()
method to execute some code using the query API.
-
Create a Framesoc tool plugin (read this for more details), using the following names for the extension points details:
- id:
fr.inria.soctrace.framesoc.tutorials.query
- class:
fr.inria.soctrace.framesoc.tutorials.Query.QueryTool
- type:
ANALYSIS
- name:
Framesoc Query Tool
- doc:
Launch the tool and enjoy.
- id:
-
You should be able to launch the tool from the Framesoc menu, but nothing should happen then, as the
launch()
method of theQueryTool
is still empty. -
In the rest of the tutorial we will make the assumption that all the presented code is executed directly in the
launch()
method or in another method called by thelaunch()
method.
To illustrate the basic usage of the query API we will use the EVENT
entity of the data model. As described in the Technical Report RT-427 , this entity is physically stored using 4 database tables (cfr. Self Defining Pattern). All these details are hidden by the query API. TODO
Using the Framesoc query API requires the following steps:
- Open a connection to the database. For example:
traceDB = TraceDBObject.openNewIstance(trace.getDbName());
- Create the query object corresponding to the required entity. For example:
EventQuery etq = new EventQuery(traceDB);
- Get the result of the query, as a list of object of the required entity. For example:
List<Event> epl = epq.getList();
- Close the connection to the database. A good practice is to do this in the
finally
block of atry/catch
. For example:
finally {
DBObject.finalClose(traceDB);
}
TODO
TODO
TODO
TODO
TODO
TODO
TODO