Revision: 582
Author: danielpalme82
Date: Sun Nov 21 05:19:17 2010
Log: -Fixed issue 46
-Refactored GeneratorFactory to non static.
-Improved sitemap
-Uncommented 'swiftmailer' in index.php
http://code.google.com/p/piwi/source/detail?r=582
Added:
/framework/trunk/piwi/custom/content/de/features/input_formats.xml
/framework/trunk/piwi/custom/content/en/features/input_formats.xml
Modified:
/framework/trunk/ChangeLog.txt
/framework/trunk/piwi/custom/content/generators.xml
/framework/trunk/piwi/custom/content/site.xml
/framework/trunk/piwi/index.php
/framework/trunk/piwi/lib/piwi/generator/GeneratorFactory.class.php
/framework/trunk/piwi/lib/piwi/inputprovider/xml/XMLPage.class.php
/framework/trunk/piwi/lib/piwi/page-processing/site/SiteElement.class.php
=======================================
--- /dev/null
+++ /framework/trunk/piwi/custom/content/de/features/input_formats.xml Sun
Nov 21 05:19:17 2010
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document xmlns="
http://piwi.googlecode.com/xsd/piwixml"
+ xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="
http://piwi.googlecode.com/xsd/piwixml ../../../../resources/xsd/content.xsd">
+ <head>
+ <title>Eingabeformate</title>
+ <keywords></keywords>
+ </head>
+ <content position="main">
+ <header>Eingabeformate</header>
+ <section>
+ PIWI kann mit verschiedenen Eingabeformaten umgehen, neben XML werden
folgende Formate unterstützt:
+ <br />
+ <generator id="inputFormatsSiteMap" />
+ </section>
+ </content>
+</document>
=======================================
--- /dev/null
+++ /framework/trunk/piwi/custom/content/en/features/input_formats.xml Sun
Nov 21 05:19:17 2010
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document xmlns="
http://piwi.googlecode.com/xsd/piwixml"
+ xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="
http://piwi.googlecode.com/xsd/piwixml ../../../../resources/xsd/content.xsd">
+ <head>
+ <title>Input Formats</title>
+ <keywords></keywords>
+ </head>
+ <content position="main">
+ <header>Input Formats</header>
+ <section>
+ PIWI can handle different input formats, in addition to XML the
following formats are supported:
+ <br />
+ <generator id="inputFormatsSiteMap" />
+ </section>
+ </content>
+</document>
=======================================
--- /framework/trunk/ChangeLog.txt Fri Oct 15 01:28:20 2010
+++ /framework/trunk/ChangeLog.txt Sun Nov 21 05:19:17 2010
@@ -14,6 +14,7 @@
* New: Added docbook inputfile feature
* New: Added rst inputfile feature
* New: Added odt inputfile feature
+ * Fixed issues: 46
0.1.0 - Beanfactory Release
=======================================
--- /framework/trunk/piwi/custom/content/generators.xml Tue Dec 2 01:02:45
2008
+++ /framework/trunk/piwi/custom/content/generators.xml Sun Nov 21 05:19:17
2010
@@ -26,12 +26,17 @@
<!-- SITEMAP -->
<generator id="fullSiteMap" class="SiteMapGenerator">
<header>CONTENTS_OF_THIS_WEBSITE</header>
- </generator>
+ </generator>
<generator id="featuresSiteMap" class="SiteMapGenerator">
<pageId>features</pageId>
<depth>1</depth>
<includeParent>0</includeParent>
</generator>
+ <generator id="inputFormatsSiteMap" class="SiteMapGenerator">
+ <pageId>input_formats</pageId>
+ <depth>1</depth>
+ <includeParent>0</includeParent>
+ </generator>
<generator id="generatorsSiteMap" class="SiteMapGenerator">
<pageId>generators</pageId>
<depth>1</depth>
=======================================
--- /framework/trunk/piwi/custom/content/site.xml Fri Oct 15 01:28:20 2010
+++ /framework/trunk/piwi/custom/content/site.xml Sun Nov 21 05:19:17 2010
@@ -10,6 +10,13 @@
<page id="gallery" label="Gallery"
href="en/features/generators/gallery.xml" />
<page id="datagrid" label="DataGrid"
href="en/features/generators/datagrid.xml" />
</page>
+ <page id="input_formats" label="Input Formats"
href="en/features/input_formats.xml">
+ <page id="cwiki" label="Creole Wiki"
href="en/features/input/input.cwiki" />
+ <page id="dwiki" label="Doku Wiki"
href="en/features/input/input.dwiki" />
+ <page id="rst" label="RST Input Format"
href="en/features/input/input.rst" />
+ <page id="docbook" label="Docbook Input Format"
href="en/features/input/input.docbook" />
+ <page id="fodt" label="FODTInput Format"
href="en/features/input/input.fodt" />
+ </page>
<page id="output_formats" label="Output Formats"
href="en/features/output_formats.xml" />
<page id="authentication" label="Authentication"
href="en/features/authentication.xml">
<page id="authentication_protected" label="Protected page"
@@ -26,11 +33,6 @@
<page id="streamimage1" label="Stream Image 1" href="image1.stream" />
<page id="streamimage2" label="Stream Image 2 (Login required)"
href="image2.stream" roles="admin" />
</page>
- <page id="cwiki" label="Creole Wiki"
href="en/features/input/input.cwiki" />
- <page id="dwiki" label="Doku Wiki" href="en/features/input/input.dwiki"
/>
- <page id="rst" label="RST Input Format"
href="en/features/input/input.rst" />
- <page id="docbook" label="Docbook Input Format"
href="en/features/input/input.docbook" />
- <page id="fodt" label="FODTInput Format"
href="en/features/input/input.fodt" />
</page>
<page id="help" label="Help" href="en/help.xml">
<page id="documentation" label="Documentation"
href="
http://code.google.com/p/piwi/wiki/PIWIDocumentation?tm=6" />
@@ -51,6 +53,13 @@
<page id="gallery" label="Galerie"
href="de/features/generators/gallery.xml" />
<page id="datagrid" label="DataGrid"
href="de/features/generators/datagrid.xml" />
</page>
+ <page id="input_formats" label="Eingabeformate"
href="de/features/input_formats.xml">
+ <page id="cwiki" label="Creole Wiki"
href="de/features/input/input.cwiki" />
+ <page id="dwiki" label="Doku Wiki"
href="de/features/input/input.dwiki" />
+ <page id="rst" label="RST Input Format"
href="de/features/input/input.rst" />
+ <page id="docbook" label="Docbook Format"
href="de/features/input/input.docbook" />
+ <page id="fodt" label="FODTInput Format"
href="de/features/input/input.fodt" />
+ </page>
<page id="output_formats" label="Ausgabeformate"
href="de/features/output_formats.xml" />
<page id="authentication" label="Authentifizierung"
href="de/features/authentication.xml">
<page id="authentication_protected" label="Geschützte Seite"
@@ -67,11 +76,6 @@
<page id="streamimage1" label="Stream Image 1" href="image1.stream" />
<page id="streamimage2" label="Stream Image 2 (Login benötigt)"
href="image2.stream" roles="admin" />
</page>
- <page id="cwiki" label="Creole Wiki"
href="de/features/input/input.cwiki" />
- <page id="dwiki" label="Doku Wiki" href="de/features/input/input.dwiki"
/>
- <page id="rst" label="RST Input Format"
href="de/features/input/input.rst" />
- <page id="docbook" label="Docbook Input Format"
href="de/features/input/input.docbook" />
- <page id="fodt" label="FODTInput Format"
href="de/features/input/input.fodt" />
</page>
<page id="help" label="Hilfe" href="de/help.xml">
<page id="documentation" label="Dokumentation"
href="
http://code.google.com/p/piwi/wiki/PIWIDocumentation?tm=6" />
=======================================
--- /framework/trunk/piwi/index.php Fri Nov 19 05:32:23 2010
+++ /framework/trunk/piwi/index.php Sun Nov 21 05:19:17 2010
@@ -29,9 +29,9 @@
*
-------------------------------------------------------------------------
*/
-//error_reporting(0); // hide all errors
+error_reporting(0); // hide all errors
//error_reporting(E_ERROR); // show only errors
-error_reporting(E_ALL); // show all errors
+//error_reporting(E_ALL); // show all errors
/**
*
-------------------------------------------------------------------------
@@ -67,9 +67,10 @@
spl_autoload_register( array( 'ClassLoader', 'autoload' ) );
spl_autoload_register( array('SwiftWrapper', 'autoload') );
+// TODO: Review if needed
//Create the message
-$message = Swift_Message::newInstance();
-$message->setSubject('My subject');
+//$message = Swift_Message::newInstance();
+//$message->setSubject('My subject');
/* Enable logging */
$logger = Logger :: getLogger('index.php');
@@ -144,7 +145,7 @@
try {
$logger->debug('Generate full pipeline');
$pipeline->generate();
- $logger->debug("Input -> Output succeded");
+ $logger->debug("Input -> Output succeeded");
} catch (Exception $exception) {
// Show a page displaying the error
$expage = new ExceptionPageGenerator($exception);
=======================================
--- /framework/trunk/piwi/lib/piwi/generator/GeneratorFactory.class.php Sun
Apr 26 03:40:20 2009
+++ /framework/trunk/piwi/lib/piwi/generator/GeneratorFactory.class.php Sun
Nov 21 05:19:17 2010
@@ -3,14 +3,11 @@
* Used to initiate and retrieve Generators.
*/
class GeneratorFactory {
- /** Singleton instance of the GeneratorFactory. */
- private static $instance = null;
-
/** Map of the generators that have already been initialized. */
private $generators = array();
/** Path of the file containing the xml-definition of the generators that
can be used. */
- private static $generatorsXMLPath = null;
+ public $generatorsXMLPath = null;
/** The generators definition as xml. */
private $xml = null;
@@ -19,17 +16,22 @@
* Constructor.
*/
public function __construct() {
- self :: $instance = null;
- }
-
+ }
+
/**
- * Set the path of the file containing the xml-definition
- * @param string $generatorsXMLPath Path of the file containing the
xml-definition
+ * Used within the XSLT-Stylesheets to interpret the <generator /> tag.
+ * @param string $generatorId The id of the Generator.
+ * @return DOMDocument The generated XML.
*/
- public function setGeneratorsXMLPath($generatorsXMLPath) {
- self :: $generatorsXMLPath = $generatorsXMLPath;
- }
-
+ public static function callGenerator($generatorId) {
+ $instance = BeanFactory :: getBeanById('generatorFactory');
+
+ $xml = $instance->_getGeneratorById($generatorId)->generate();
+ $doc = new DOMDocument();
+ $doc->loadXml('<section
xmlns="
http://piwi.googlecode.com/xsd/piwixml">' . $xml . '</section>');
+ return $doc;
+ }
+
/**
* Returns the Generator with the given id.
* If the Generator is already instanciated, the instance will be
returned.
@@ -52,12 +54,12 @@
return;
}
if ($this->xml == null) {
- if (!file_exists(self :: $generatorsXMLPath)) {
+ if (!file_exists($this->generatorsXMLPath)) {
throw new PiwiException("Could not find the generators definition file
(Path: '" .
- self :: $generatorsXMLPath . "').",
+ $this->generatorsXMLPath . "').",
PiwiException :: ERR_NO_XML_DEFINITION);
}
- $this->xml = simplexml_load_file(self :: $generatorsXMLPath);
+ $this->xml = simplexml_load_file($this->generatorsXMLPath);
$this->xml->registerXPathNamespace('generators', '
http://piwi.googlecode.com/xsd/generators');
}
@@ -82,21 +84,5 @@
PiwiException :: ERR_NO_XML_DEFINITION);
}
}
-
- /**
- * Used within the XSLT-Stylesheets to interpret the <generator /> tag.
- * @param string $generatorId The id of the Generator.
- * @return Generator The Generator with the given id.
- */
- public static function callGenerator($generatorId) {
- if (self :: $instance == null) {
- self :: $instance = BeanFactory :: getBeanById('generatorFactory');
- }
-
- $xml = self :: $instance->_getGeneratorById($generatorId)->generate();
- $doc = new DOMDocument();
- $doc->loadXml('<section
xmlns="
http://piwi.googlecode.com/xsd/piwixml">' . $xml . '</section>');
- return $doc;
- }
}
?>
=======================================
--- /framework/trunk/piwi/lib/piwi/inputprovider/xml/XMLPage.class.php Tue
Oct 12 08:18:18 2010
+++ /framework/trunk/piwi/lib/piwi/inputprovider/xml/XMLPage.class.php Sun
Nov 21 05:19:17 2010
@@ -44,7 +44,7 @@
}
// Configure the transformer
- $processor = new XSLTProcessor;
+ $processor = new XSLTProcessor();
$processor->registerPHPFunctions();
$processor->importStyleSheet(DOMDocument :: load($GLOBALS['PIWI_ROOT'] .
"resources/xslt/GeneratorTransformation.xsl"));
=======================================
---
/framework/trunk/piwi/lib/piwi/page-processing/site/SiteElement.class.php
Thu Sep 30 02:48:09 2010
+++
/framework/trunk/piwi/lib/piwi/page-processing/site/SiteElement.class.php
Sun Nov 21 05:19:17 2010
@@ -88,7 +88,7 @@
if (is_array($roles)) {
$this->roles = $roles;
} else {
- $this->roles = explode(',',$roles);
+ $this->roles = explode(',', str_replace(', ', ',', $roles));
}
}