File: plugins.html

package info (click to toggle)
pubtal 3.5-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch, wheezy
  • size: 1,296 kB
  • ctags: 910
  • sloc: python: 8,027; xml: 150; makefile: 49
file content (45 lines) | stat: -rw-r--r-- 2,910 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>Plugin API</title>
	<link href="../style/site.css" type="text/css" rel="stylesheet">
</head>
<body>
<h1>Plugin API</h1>
  <p id="subject"></p>
  <div><p>PubTal plugins allow the functionality of PubTal to be expanded and customised.&nbsp; Currently support for new content types and new upload methods can be added using plugins.</p>
<h2>Plugin Interface</h2>
<p>Plugins are implemented as Python modules which are placed in either the site-packages/pubtal/plugins directory, or in a directory specified using the <i>additional-plugins-dir</i> configuration option.&nbsp; All plugins must implement a module level function called <i>getPluginInfo()</i> which returns a list of the functionality provided by this plugin.&nbsp; The list is comprised of dictionaries that describe the functionality provided by this plugin and provide additional information to PubTal about that functionality.</p>
<p>Each dictionary in the list returned from getPluginInfo() must have a key "functionality".&nbsp; Legal values of for this key are currently :</p>
<ul>
	<li>"content" - This plugin provides a new content type.</li>
	<li>"upload-method" - This plugin provides a new upload method.</li>
</ul>
<h2>Additional Content Types</h2>
<p>In addition to the key "functionality" having a value of "content", the dictionary must also contain the following keys:</p>
<ul>
	<li>"content-type" (Mandatory) - A name for the type of content support provided.</li>
	<li>"class" (Mandatory) - The class which provides this support must be derived from SitePublisher.ContentPublisher.</li>
	<li>"file-type" (Optional) - The file type extension which this content type should be associated with by default.&nbsp; This can be a list of file extensions if more than one type should be associated.</li>
</ul>
<p>The two methods defined by SitePublisher.ContentPublisher (other than the constructor) which must be implemented are: <i>publish()</i> and <i>getPageContext()</i></p>
<h2>Additional Upload Methods</h2>
<p>In addition to the key "functionality" having a value of "upload-method", the dictionary must also contain the following keys:</p>
<ul>
	<li>"method-type" (Mandatory) - The name of the upload method (used in the configuration file).</li>
	<li>"class" (Mandatory) - The class which provides support for this method must be derived from SiteUploader.UploadMethod.</li>
</ul>
</div>
	  
	
  <div class="navbar">
  <a href="index.html" title="Contents">Contents</a>
  </div>
  <p id="version">PubTal Version 3.5</p>
  <div id="footer">
  <p>File: plugins.txt</p>
  <p>Last modified: Fri, 27 Jul 2007 18:34:31 BST</p>
  <p>Copyright 2011 Colin Stewart</p>
  <p title="PubTal is a template driven web site publisher.">Made with <a href="http://www.owlfish.com/software/PubTal/">PubTal</a> 3.5</p>
  </div>
</body>