PerlDoc

26 August 2025 - 17:41 | Version 1 |
See PublishedAPI for packages intended to be used by Plugin and Contrib authors, or browse all packages.
See also Developing plugins, Developer's Bible, Technical Overview


Parent package: Foswiki::Store::Interfaces
Child packages:

    internal package Foswiki::Store::Interfaces::QueryAlgorithm

    Interface to query algorithms. Implementations of this interface are found in Foswiki/Store/*Algorithms.

    The contract with query algorithms is specified by this interface description, plus the 'query' unit tests in Fn_SEARCH. The interface provides a default implementation of the 'getField' method, but all other methods are pure virtual and must be provided by subclasses. Note that if a subclass re-implements getField, then there is no direct need to inherit from this class (as long as all the methods are implemented).

    ClassMethod new( $class, ) → $cereal

    ObjectMethod query( $query, $webs, $inputTopicSet, $session, $options ) → $infoCache

    This is the top-level interface to a query algorithm. A store module can call this method to start the 'hard work' query process. That process will call back to the getField method in this module to evaluate leaf data in the store.

    To monitor the hoisting and evaluation processes, use the MONITOR_EVAL setting in Foswiki::Query::Node

    this is a default implementation of the query() sub that uses the specific algorithms' _webQuery member function.

    StaticMethod getField($class, $node, $data, $field ) → $result

    getField is used by the query evaluation code in Foswiki::Query::Node to get information about a leaf node, or 'field'. A field can be a name, or a literal, and the information it refers to can be a scalar, a reference to a hash, or a reference to an array. The exact interpretation of fields is context-dependant, according to reasonably complex rules best documented by the Fn_SEARCH unit test and QuerySearch.

    The function must map the query schema to whatever the underlying store uses to store a topic. See QuerySearch for more information on the query schema.

    StaticMethod getForm($class, $node, $data, $field ) → $result

    StaticMethod getRefTopic($class, $relativeTo, $web, $topic, $rev) → $topic

    This method supports the Foswiki::Query::OP_ref and Foswiki::Query::OP_at operators by abstracting the loading of a topic referred to in a string.

    StaticMethod getRev1Info($meta) → %info

    Return revision info for the first revision in %info with at least:

    getListOfWebs($webnames, $recurse, $serachAllFlag) → @webs

    Convert a comma separated list of webs into the list we'll process Meta - it rather uses the store.