The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

AxKit::XSP::Blog - XSP taglib to include Blogs (weblogs)

DESCRIPTION

Blogs (weblogs)

  http://whatis.techtarget.com/definition/0,,sid9_gci213547,00.html

can carry diary-like information. The idea of this package is to access these diary entries via an DBI database and expand them into an XSP page.

How these entries find their way into the database is outside the scope of this package. (See the README in the distribution.)

XSP Tags

The package's namespace is

    http://ns.it.bond.edu.au/xsp/blog/v1

(Note: what is the official?)

which implies that you have to use an appropriate namespace declaration in your XSP files:

    <xsp:page xmlns:xsp="http://www.apache.org/1999/XSP/Core"
              ....
              xmlns:b="http://ns.it.bond.edu.au/xsp/blog/v1"
              >

Inside such an XSP page you can then use the blog tag to embed weblog data:

        <b:blog src = "dbi:mysql:database=topicmaps;user=nobody;table=blogs" />

The taglib will open a database connection, will create the blog XML representation and will return that to the AxKit processor.

The following attributes can be used:

src:

This will contain the DBI specification (DBI). Note that the string may contain table=where_are_the_blogs to change the table in which the blog entries expected. If that is missing blogs is assumed.

youngest:

This attribute allows to specify a date/time in the format YYYY-MM-DD HH:MM to control which the youngest entry (inclusive) should be.

oldest:

This attribute allows to specify a date/time in the format YYYY-MM-DD HH:MM to control which the oldest entry (inclusive) should be.

limit:

Controls how many entries should be returned.

url, title, description:

Control the URL, the title or the description which will appear in the outgoing blog structure (see the distribution for the Blog DTD used). If one of them is missing, then '', WebLog, No description are the default values, respectively.

Example:

    <b:blog youngest = "2002-09-25 00:00"
            oldest   = "2002-09-22 00:00"
            src      = "dbi:mysql:database=topicmaps;user=nobody;table=blogs"
            limit    = "5"
            url      = "http://www.example.com/"
            title    = "My Blog"
    />

Database Schema

The following SQL schema is used (find a .mysql file in the distribution):

    CREATE TABLE blogs (
      id int(11) NOT NULL auto_increment,
      author varchar(128) default NULL,
      author_email varchar(128) default NULL,
      url varchar(255) default NULL,
      title varchar(128) default NULL,
      body text,
      published datetime default NULL,
      fetched timestamp(14) NOT NULL,
      remote_id varchar(128) default NULL,
      KEY id (id)
    );  

Blog XML DTD

The following structure is currently used:

    <!ELEMENT xblog (head blog)>

    <!ELEMENT head  (title? url? description?)>

    <!ELEMENT blog  (day*)>

    <!ELEMENT day   (entry*)>
    <!ATTLIST day   date>

    <!ELEMENT entry (title? status? postDate? lastModified? content author_name? author_email? url?>
    <!ATTLIST entry date?
                    id>

TODO

include directly blog.xml files (how to do that with SimpleTagLib?)

SEE ALSO

AxKit, Apache::AxKit::Language::XSP::SimpleTaglib, DBI

AUTHOR INFORMATION

Copyright 200[2], Robert Barta <rho@bond.edu.au>, All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. http://www.perl.com/perl/misc/Artistic.html