Export Plugins

From MSpace

(Difference between revisions)
Jump to: navigation, search
(plugin.php)
(Core Plugins)
Line 46: Line 46:
<pre>/export/plugins</pre>
<pre>/export/plugins</pre>
-
When an export is performed all plugins are loaded. If no match for the requested plugin is found then the export is unsuccesful.
 
== Site Specific Plugins ==
== Site Specific Plugins ==
Site specific plugins can be found at:
Site specific plugins can be found at:
<pre>/sites/{$current_site}/export/plugins</pre>
<pre>/sites/{$current_site}/export/plugins</pre>

Revision as of 15:09, 24 November 2008

Contents

Plugin Architecture

Each plugin is a self contained folder which must contain two files:

  1. plugin.php
  2. plugin.xslt

plugin.php

This is the configuration file for the export plugin

Example config file (for plain text export):

<?php
	$plugin = array();
	$plugin['id']				= 'TXT';
	$plugin['header'] 	= "text/plain";
	$plugin['stripXML']	= true;
?>
 
*<b>id</b> - the 3 character unique ID for this plugin (used as the file extension in the export script)
*<b>header</b> - the HTTP header that the exported data should be sent with
*<b>stripXML</b> - should the XML declaration added by the XSLT transformation be removed before output

plugin.xslt

This is the XSLT template that is used to transform the output from the mSpace Server into the desired output format. The server output will be a slicegetitems request and as such the export plugin's have access to MetaDataConnections aswell as DirectConnections metadata.

Example template file (for plain text export):

<?xml version="1.0" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" />
	<xsl:template match="/">
		<xsl:for-each select="//MetadataConnections/ColumnMetadata/RowItem">
			<xsl:value-of select="../@label" />
			<xsl:text>: </xsl:text>
			<xsl:value-of select="@label" />
			<xsl:text>&#10;</xsl:text>
		</xsl:for-each>
	</xsl:template>
</xsl:stylesheet>

Core Plugins

The core mSpace export plugins can be found at:

/export/plugins

Site Specific Plugins

Site specific plugins can be found at:

/sites/{$current_site}/export/plugins
Personal tools