Jan Moxter edited this page Apr 17, 2015 · 10 revisions

#EQL - eFaps Query Language

The eFaps Query Language is designed to enable a user to query and manipulate data managed by the eFaps Framework respecting its Triggers, Access etc. It is mainly used by the Command Line Interface eFaps-CLI, the Console Application eFapsApp-Console and the Jasper Integration for eFaps including the JaspserSoftStudio plugin.

##Commands and Selects

EQL is seperated in two main parts Commands and Selects. Up to date only the Command part are parsed by eFaps-EQL, the pure Selects are evaluated by the main framework

COMMAND

##Grammer and domain specific languages.

EQL uses the Eclipse XText Framework to generate the eFaps Query Language. The grammer file is EQL.xtext

##Select Statements Four different kind of statements exists to define a select.

##Attributes For the select statements of attributes only the attribute name must be defined. This works only directly on objects.

##Pure Selects

.oid
.id
.file.label
.file.length
.attribute[AttributeName]
.attributeset[AttributeSetName]
.attribute[AttributeName].value
.attribute[ValueUOM].value
.attribute[ValueUOM].uom
.attribute[ValueUOM].base
.attribute[ValueUOM].label
.attribute[Betrag].format[0.00]
.attribute[Rate].value
.attribute[Rate].label
TYPE := TYPE_NAME | TYPE_UUID
SELECT_STATEMENT := SELECT_LINKFROM
      | SELECT_LINKTO
      | SELECT_STATUS
      | SELECT_TYPE
      | SELECT_CLASS

Links

With the link statements a select of information from related object could be fetched.

SELECT_LINKFROM := 'linkfrom' '[' TYPE '#' ATTRIBUTE_NAME ']'

  • TYPE defines the target type where to search,
  • ATTRIBUTE_NAME defines the name where the id of current object is defined.

SELECT_LINKTO := 'linkto' '[' ATTRIBUTE_NAME ']'

  • With ATTRIBUTE_NAME the name of the attribute is defined where the id of the target object is defined.

###Status {{{ SELECT_STATUS := '.status' [ '.id' | '.oid' | '.key' | '.label' | '.description' | SELECT_TYPE ] }}}

  • {{{'.status'}}} returns the instance object from the cache
  • {{{'.id'}}} returns the id of the status
  • {{{'.oid'}}} returns the object id of the status
  • {{{'.key}}} returns the key of the status
  • {{{'.label'}}} returns the label of the status (translated depending on the context)
  • {{{'.description}}} returns the description of the status
  • {{{SELECT_TYPE}}} is used to select the type of the status

###Type {{{ SELECT_TYPE := '.type' [ '.id' | '.oid' | '.uuid' | '.label' | '.description' ] }}}

  • {{{'.type'}}} returns the type instance from the cache
  • {{{'.id'}}} returns the id of the type
  • {{{'.oid'}}} returns the object id of the type
  • {{{'.uuid'}}} returns the unique identifier of the type
  • {{{'.label'}}} returns the label of the type (translated depending on the context)
  • {{{'.description}}} returns the description of the type

###Classification {{{ SELECT_CLASS := '.class' SELECT_TYPE | '.class' '[' CLASS ']' SELECT_STATEMENT }}}

  • {{{'.class' SELECT_TYPE}}} returns an array of the classification instances that classifies this instance from the cache. It will only return the last leafs and not the whole tree, due to the reason that the tree can be walked up very easily once the child is given.
  • {{{'.class' '[' CLASS ']' SELECT_STATEMENT}}} returns for specific class {{{CLASS}}} the instance information. {{{CLASS}}} is the name of the type representing the class.

###Phrases Phrases are a combination of multiple select statements in a text string. Each select statement is surrounded with {{{$<}}} and {{{>}}}.

###Example {{{ $<attribute[LastName]> - $<attribute[FirstName]> }}} The result will be e.g. {{{ Doe - John }}}


#Using the Select Statements

##User Interface Forms and Tables

##Within Java and [ESJP ESJP's] {{{ PrintQuery query = new PrintQuery("567.123"); query.addSelect("attribute[Name]"); query.execute(); }}}

== Statements Related to One Object == {{{ OBJECT := OID | TYPE ID | TYPE ATTRIBUTE_VALUE ATTRIBUTE_VALUE ... SELECT := 'attribute' '(' ATTRIBUTE_NAME, ... ')' | 'expression' '(' EXPRESSION, ... ')' | 'select' '(' SELECT_STATEMENT, ... ')' | 'phrase' '(' PHRASE, ... ')' }}}

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.