internal package Foswiki::Plugins::PublishPlugin::BackEnd

Abstract base class of back-end modules for PublishPlugin.

This class defines the interface that must be implemented by back end archive generators.

All archives are interfaced to by adding topics, attachments, and (optionally) external resources. The archive is responsible for storing the data at a unique url that can be used in topics to link to that resource.

Errors, warning, and debug info should be logged to the logger.

ClassMethod new(\%params, $logger)

Construct a new back end.
  • $params - optional parameter hash, may contain generator-specific options
  • $logger - ref to an object that supports logDebug, logWarn, logInfo and logError methods (see Publisher.pm)

ObjectMethod getReady()

Generator has been constructed; perform any appropriate cleanup steps before executing.

Default does nothing.

ClassMethod param_schema → \%schema

Get schema of query parameters, in the same format as Publisher.pm

ClassMethod describeParams($template, $sep) → $string

Expand the given template to generate a string description. Expanded tokens are: $pname, $phelp, $pdefault

ObjectMethod alreadyPublished( $web, $topic, $date ) → $bool

Test if the given topic, which has the given date in the store, has already been published. A true return value will cause the topic to be skipped in this publishing step.

ObjectMethod getTopicPath($web, $topic) → $path

Return the relative path to the topic in the archive - even if it isn't there!

ObjectMethod addTopic($web, $topic, $text) → $path

Add the given topic to the archive and return the relative path to the topic in the archive.

ObjectMethod getAttachmentPath($web, $topic, $attachment) → $path

Return the path to the attachment in the archive - even if it isn't there!

ObjectMethod addAttachment($web, $topic, $att, $data) → $path

Add the given attachment to the archive, and return the relative path to the attachment in the archive.

ObjectMethod addResource($data [, $ext]) → $path

Add the given resource to the archive, and return the relative path to the resource in the archive.

$ext is an optional hint as to the mime type e.g. '.gif'

ObjectMethod close() → $path

Close the archive, and return the path to the completed archive relative to {PublishPlugin}{Dir}

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 AustLII Communities? Send feedback
This website is using cookies. More info. That's Fine