Bug #327
XPath filtered logger
Status: | Resolved | Start date: | 05/26/2011 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | J. Moringen | % Done: | 100% | |
Category: | Common Lisp Tools | |||
Target version: | rsb-0.16 |
Description
A logger should be able to filter by XPath.
Associated revisions
Initial builder-based filter implementation in src/filter/xpath-filter.lisp
refs #327
This change allows this system to work with the new XPath filter
implementation. XPath expression can descend from the event, into the
data relation and from there into the XML document object or the XOP
package.
This is achieved using the following technique:
1. An :around method on `xpath-protocol:child-pipe-using-navigator' for
the navigator of the architecture.builder-protocol.xpath system
checks whether the current node is the result of descending into a
node representing an `stp:document' via
the :data relation of an `rsb:event'
or the :document relation of an `rsb.xop:package1'
For these cases, the child pipe is replaced with a pipe containing
only the document element of the document.
2. Methods on all xpath-protocol generic functions dispatch to the
:default-navigator if the node is an `stp:node'.
- src/filter/xpath.lisp: removed; no longer needed
- src/filter/xpath-filter.lisp: new file; contains builder-based
filter implementation - src/filter/package.lisp (header): updated copyright
(package rsb-xml.filter): added used package let-plus; added
import-from architecture.builder-protocol.xpath symbols navigator,
node-proxy-value, relation-proxy{,-parent,-relation,-target} and
instead{,-value} - test/filter/xpath-filter.lisp (header): updated copyright
(define-filter-match-test xpath-filter): changed payloads from
strings to document objects; adapted XPath expressions to match the
whole event instead of just the payload - rsb-xml.asd (system rsb-xml): removed file src/filter/xpath.lisp;
added file src/filter/xpath-filter.lisp
Initial conversion of xpath filter in src/filter/xpath-filter.lisp
fixes #327
The filter now uses the architecture.builder-protocol.xpath system and
is thus applicable to events as well as generic payloads.
- src/filter/xpath-filter.lisp (xpath-filter): removed superclasses
payload-matching-mixin and fallback-policy-mixin
(xpath-filter::navigator): new slot; stores the navigator used for
evaluating XPath queries
(shared-initialize :after xpath-filter t): accept builder initarg;
pass to navigator
(compute-filter-function xpath-filter): return a function that
evaluates the compiled XPath using the navigator and translates the
result
(xpath-navigator): new function; return a navigator with suitable
peek function and printers
(xpath-result->filter-result): check node-sets for non-emptiness,
otherwise call `unwrap' - test/filter/xpath-filter.lisp
(define-basic-filter-tests xpath-filter): removed cases for fallback
behavior; added a case specifying the builder
(define-filter-match-test xpath-filter): added lots of cases for
various nodes and attributes in event and payload - rsb-filter-xpath.asd (header): updated copyright
(system rsb-filter-xpath): added system dependencies on
architecture.builder-protocol.xpath and rsb-builder
Mention improved XPath filter in news.rst
refs #327
- news.rst (RSB 0.16): mention improved XPath filter in CL
implementation and logger command
Adapted example to changed XPath filter in src/common/help.lisp
refs #327
- src/common/help.lisp (make-filter-help-string): adapted XPath filter
example to changes in the filter
Mention improved XPath filter in news.rst
refs #327
- news.rst (RSB 0.16): mention improved XPath filter in CL
implementation and logger command
History
#1 Updated by J. Moringen over 12 years ago
- Category set to Common Lisp Tools
- Status changed from New to In Progress
- Assignee set to J. Moringen
- % Done changed from 0 to 70
- XML Payloads ✓
- XOP Payloads
- Protocol Buffer Payloads (merge pending)
#2 Updated by J. Moringen over 10 years ago
- Target version changed from rsb-0.10 to rsb-0.11
#3 Updated by J. Moringen about 10 years ago
- Target version changed from rsb-0.11 to rsb-0.12
#4 Updated by J. Moringen almost 9 years ago
- Target version changed from rsb-0.12 to rsb-0.13
#5 Updated by J. Moringen about 8 years ago
- Target version changed from rsb-0.13 to rsb-0.14
#6 Updated by J. Moringen almost 8 years ago
- Target version changed from rsb-0.14 to rsb-0.15
#7 Updated by J. Moringen over 7 years ago
- Target version changed from rsb-0.15 to rsb-0.16
#8 Updated by J. Moringen almost 7 years ago
- Status changed from In Progress to Resolved
- % Done changed from 70 to 100
Applied in changeset rsb-cl|a89b6770c53cdbb55fc920ada02c10813e27bcd5.