Blogreen Manual
Table of contents
Preface
What is Blogreen?
Blogreen is a state of the art Meta Data Management Framework (Meta-DMF). It has been designed with scalability and expandability in mind, and it is so a complete solution for building your own Content Management Systems (CMS).
Creating a CMS with Blogreen can be as simple as connecting plug-ins together. But if you want to integrate your own web application in the system, you can write your own XML templates, your own PHP classes, your own XSLT, your own site structure handler and your own cascading stylesheet, just letting Blogreen do what it has been designed for: assemble and process all this to manage your CMS!
What is not Blogreen?
History
The project started on August 26, 2004 at 13:08:45 CEST. It was originally designed as another weblog system, but intended to produce static pages from the user computer send to his web-server for publication. The goal was so to allow people with static page hosting to easily maintain their own weblog.
A few days latter, I was wondering Why damn those wiki systems only
provide
... and I decided to fix
this and started thinking about such a system.
flat
documents hierarchy?
The name Blogreen was found on September 9, 2004 at 00:29:52 CEST. It was found quite late by night and, please, don’t ask how we did get to this name, I will not reply.
More abstraction, layering and meta-isation later, Blogreen became what it is today, something far far away from its first ambitions.
Conventions
In this documents, new or important terms are emphasised, programs input, output and source code are written with a monospaced font. Placeholders are indicated with an emphasised monospaced font indicating that you have to set your own value according to the situation. Differences between two consecutive code snippets are indicated with a bold monospaced font.
Terminal sessions always include a prompt to avoid misinterpretation.
Although, because of the large amount of shells and software packages
that can be use to do the same thing with Blogreen, code snippets may
by only conceptual
and require you to adapt it to your tools.
Tutorial
This tutorial for the inpatient will show you how you can easily create a CMS that is composed of a Wiki
Used plugins
First, we have to tell Blogreen which plugins will be used in the content management system. As a single plugin may be used for different purpose, you have to name each plugin instance with a different name.
The configuration of the plugin instances is done in the same file, using a param argument.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<plugins>
<plugin name="wiki" class="MiniWiki">
<param name="root" value="/" />
<param name="database" value="pg_db" />
<param name="owner" value="root" />
<param name="group" value="wiki" />
<param name="permissions" value="rwxrwxrx" />
</plugin>
<plugin name="pg_db" class="PostgreSQL">
<param name="host" value="localhost" />
<param name="user" value="romain" />
<param name="pass" value="plop" />
<param name="base" value="blogreen_demo" />
</plugin>
<plugin name="auth" class="basic_auth">
<user name="romain" />
<user name="root" admin="1" />
<group name="wiki">
<member name="romain" />
</group>
</plugin>
<plugin name="BloTeX" class="BloTeX" />
</plugins>
</configuration>
Templates
The template of the main page will be as follow (Warning, this is a mess of XML & XSL... just for the idea):
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title><xsl:value-of select="wiki/title" /></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body id="my-wiki">
<xsl:choose>
<xsl:when test="$wiki_state = 'edit'">
<wiki:edit_form />
</xsl:when>
<xsl:otherwise>
<wiki:content />
</xsl:otherwise>
</xsl:choose>
</body>
</html>
Description
General concepts
Layering / Abstraction / Data pull model (Plugin don't push data to another plugin)
Core
Backbone
Plug-ins
Templates
Plug-ins
Plugins Communication
XXX different mechanism are available for Inter Plugin Communications (IPC) : Direct and Indirect connectors.
Hooks
A well designed plugin will provide a set of hookable functions that can be used to slightly change its behaviour. Multiple hooks can be stacked together on top of the hookable function of a signle plug-in if their hook function is hookable.
Signals
Plugins can emit signals to a particular plugin using the kill() primitive. If the plugin has a signal handler, it is run with the arguments passed to kill().
Connectors & Slots
A Blogreen Plugin may provide slots and connectors. A slot is a sort of output for an XML stream. A connector is a sort if input for an XML stream. A connector can be attached to a slot only if that slot will provide information it can handle.
You can consider this as the different connectors that you can find behind your computer central unit: you can’t plug an USB device on a serial port (and in Blogreen, you will not be able to use a hammer to make it fit if it is not designed for).
This is somewhat similar to the concept of named pipes on an operating system.
Case corner: filters.
Shared Memory
In some very rare circumstances, direct connections are not possible. Blogreen so provides another IPC system. As nobody should never use it and if so, needs to be aware that shooting in his own foot hurts, this system is only slightly documented. All I will say is that it does not include any security or control of what you do, and you will have to read the code to use it wisely (poor fool).
I could have wrote don’t use it! It’s a bug! It’s just like using gets() in C
or Only for secret Blogreen ninja gurus
instead of this… You have been warned!
Templates
Appendix
Bibliography
Edit
Up