internal package Foswiki::Contrib::MailerContrib::Subscription

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

internal package Foswiki::Contrib::MailerContrib::Subscription

Object that represents a subscription to notification on a set of pages. A subscription is expressed as a set of page specs (each of which may contain wildcards) and a depth of children of matching pages that the user is subscribed to.

ClassMethod new($pages, $childDepth, $options)

Create a new subscription.

stringify() → string

Return a string representation of this object, in WebNotify format.

ObjectMethod matches($topic, $db, $depth) → boolean

  • $topic - Topic names we are checking (may be an array ref)
  • $db - Foswiki::Contrib::MailerContrib::UpData database of parent names
  • $depth - If non-zero, check if the parent of the given topic matches as well. undef = 0.
Check if we match this topic. Recurses up the parenthood tree seeing if this is a child of a parent that matches within the depth range.

TODO: '*' should match alot of things..

ObjectMethod covers($other, $db) → $boolean

Return true if this subscription already covers all the topics specified by another subscription. Thus:
  • AA;B covers AB, AxB
  • AA; covers AA;B
  • A;B does not cover AA;

ObjectMethod filterExact( \@pages ) → $boolean

If this subscription has an exact (string) match to any of the page expressions passed, remove it and return true. * \@pages - list of page expressions to filter

ObjectMethod getMode() → $mode

Get the newsletter mode of this subscription ('', '?' or '!') as specified in WebNotify.

ObjectMethod equals($other) → $boolean

Compare two subscriptions.

Topic revision: r1 - 21 Nov 2014, ProjectContributor
This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding Irish Doughnut Economics Network? Send feedback