The Query Builder
Robert E. Coyle
robertecoyle@hotmail.com
Fri, 23 Nov 2001 01:57:01 -0000
Hi,
The query builder is the code I've spent most time on. It's an interface
to define a complex search for tickets - the closest analagy would be
the Bugzilla boolean charts. You have a tree structure where nodes
represent combinations (and, or, not) and leaves represent the actual
criteria.
Queries are stored in the session while they are being built, but may be
saved and restored by the user if they wish. This is done by simply
serialising the object and putting it in the database.
Because certain criteria depend on the ticket type (eg. ticket state),
the query builder has a current type (the first form on the page) and
the criteria forms below use the current ticket type as necessary. I
expect that in the common case a query will only look at one type (because
mixing, for example, bug tickets and book requests will probably not be
that useful).
The available criteria are currently divided into four groups: ticket
properties (id, state, priority etc), user criteria (requester, assignee,
has added comment etc), dates (created, completed, last modified etc) and
text (search summary or comments). The date criteria are not yet
implemented.
Edit actions on the tree may be performed using the dropdown edit list at
the top. Delete, edit, move, insert and, insert or, insert not are
straigtforward (although edit and move are not yet implemented). Hoist
may only be applied to branches, and moves the children of that branch to
the level of that branch. Insert Query (will) let you select a previously
saved query and insert it into the current query.
The query may be executed by the action link at the bottom of that page.
This won't replace the simple search interface as it will probably be hard
for less technical people to use, but I do want them to work together (eg.
at the moment, they have separate backend methods, and the 'My Searches'
links on the front page are separate from the 'My Queries' in the query
builder page).
Rob
--
Klein bottle for sale ... inquire within.