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
SMELL / FIX / TODO count: 16
internal package Foswiki::Search::InfoCache is a Foswiki::ListIterator
Support package; cache of topic info. When information about search hits is
compiled for output, this cache is used to avoid recovering the same info
about the same topic more than once.
TODO: this is going to transform from an ugly duckling into the
ClassMethod new($session, $defaultWeb, \@topicList)
Initialise a new list of topics, allowing their data to be lazy loaded
if and when needed.
$defaultWeb is used to qualify topics that do not have a web
specifier - should expect it to be the same as BASEWEB in most cases.
Because this Iterator can be created and filled dynamically, once the Iterator hasNext() and next() methods are called, it is immutable.
TODO: duplicates??, what about topicExists?
TODO: remove the iterator code from this container and make a $this->getIterator() which can then be used.
TODO: replace the Iterator->reset() function with a lightweight Iterator->copyConstructor?
TODO: or..... make reset() make the object mutable again, so we can change the elements in the list, but re-use the meta cache??
TODO: what if it isa Meta obj
TODO: or an infoCache obj..
ObjectMethod sortResults($params)
the implementation of %SORT{"" limit="" order="" reverse="" date=""}%
it should be possible for the search engine to pre-sort, making this a nop, or to
delay evaluated, partially evaluated, or even delegated to the DB/SQL
can call repeatedly, the list will only be re-sorted if new elements are added.
TODO: for now assume we do not change the sort order later
SMELL: duplicated code - removeme
TODO: this is really an ugly hack to get around the rather
SMELL: Cairo had efficient two stage handling of modified sort.
SMELL: In Dakar this seems to be pointless since latest rev
filterByDate( $date )
Filter the list by date interval; see
TimeSpecifications.
This function adds a filter evaluator to the infocache that is evaluated
as you iterate through the collection
$infoCache->filterByDate( $date );
TODO: need to remove the web portion
SMELL: SD duplicated from above - I'd rather do it only here,
SMELL: CDot isn't clear why this is needed, but it is otherwise
StaticMethod getOptionFilter(\%options) → $code
Analyse the options given in \%options and return a function that
filters based on those options. \%options may include:
-
includeTopics - a comma-separated wildcard list of topic names
-
excludeTopics - do
-
casesensitive - boolean
TODO: this is now a default utility method that can be used by