The best way to understand how to create a custom named query is by
example.
Let's say we want to create a new
query called
Logic
Settings that will
retrieve all:
- Open XoomCustom.xml in a text editor such as Notepad++.
- Add to it a new <xpi:query> element,
with the attribute name="Logic Settings".
<xpi:query name="Logic Settings">
</xpi:query>
This element corresponds with the root element of the
XoomXML.
- Add a filter that will extract all Objectives.
Here is an extract of
XoomXML containing just a single
Objective:
the
_Pre-SOT - Enhanced Priority Objective.
There
are four levels to the structure of XoomXML, namely: root,
type, item and parameter.
In this example:
- Root is <Configuration>.
- Type is <Objective>
(highlighted in yellow).
- Item is also <Objective> (highlighted in orange). Everything
below that is a parameter.
Here,
type and
item elements are the same, so a single
<Objective/> element in the
query will tell
Xoom to
retrieve everything beneath the
type element (the yellow
<Objective>), and will therefore extract all
Objectives. We can add this to our new
query.
<xpi:query name="Logic Settings">
<Objective/>
</xpi:query>
Note: we recommend that you order the terms of your
query
alphabetically.
- Add a filter that will extract all Rules.
If we look at
Rules in
XoomXML, we can see that the structure is
similar to
Objectives, as above.
Type and
item elements
are the same and thus a single
<Rule/> in the
query will extract all
Rules.
Adding this to the
query gives us:
<xpi:query name="Logic Settings">
<Objective/>
<Rule/>
</xpi:query>
- Add a filter that will extract all Background Optimizations.
Background Optimization is a little more complicated because it is one
of many
Settings. If we simply added a
<Setting/> element to our
query, we would extract all
Settings, not just
Background Optimizations. A
<Setting/> element in the
query
would, for example,
retrieve, the following
Workflow Agent
(amongst others).
<Setting>
<Setting xoom:id="Setting[[Application]|Agent|Workflow Agent|Alert Jeopardy Task is not scheduled and the Appointment Finish is approaching]">
<Owner>[Application]</Owner>
<Category>Agent</Category>
<SubCategory>Workflow Agent</SubCategory>
<Name>Alert Jeopardy Task is not scheduled and the Appointment Finish is approaching</Name>
<Body>
<WorkflowAgent>
<Steps>
…
We need to find a determining node that will locate only
Background Optimizations and no other settings. If we look at the relevant
part of the
XoomXML, we can see that the defining node for
Background Optimizations is the subnode
<Category/> (highlighted in orange).
We need,
therefore, to match this structure –
Setting/Setting/Category – in the
query as follows:
<xpi:query name="Logic Settings">
<Objective/>
<Rule/>
<Setting>
<Setting>
<Category>Background Optimization</Category>
</Setting>
</Setting>
</xpi:query>
This will retrieve every Background Optimization but no
other Settings.
- The same is true of Decompositions and Logic Domains: their
defining nodes are to be found below the item level, by a similarly
nested <Category/> element. Adding
these in gives us:
<xpi:query name="Logic Settings">
<Objective/>
<Rule/>
<Setting>
<Setting>
<Category>Background Optimization</Category>
</Setting>
<Setting>
<Category>Decomposition</Category>
</Setting>
<Setting>
<Category>Logic Domains</Category>
</Setting>
</Setting>
</xpi:query>
Now we have all the necessary terms in our
query.
- Save this new version of the file as XoomCustom.xml in the Xoom
folder, replacing the old.
The Xoom folder can be found here:
C:\Program Files (x86)\Zany Ants\Xoom
- Open Xoom Explorer and create a new connection to the Xoom server.
The new
query can be found in the
Queries
menu.