Version 0.2 of Daizu CMS is now available from the download page. Details of how to upgrade from 0.1 and the exact changes which have been made are given below.
Loading articles
The big change in this release is in the way the content of articles
gets loaded. Now, the plugins which load an article (which may for
example parse some XHTML or POD
markup) are run as soon as a working copy has received a modified
version of an article. The plugins return the content in a standard
format (an XHTML DOM with a
root element called body, and normal HTML
markup inside it).
This content has XInclude processing done on it, and is then fed through any filter plugins you've got enabled. The finished content is then saved in the database so that it can be retrieved easily when the article is published. Some metadata (for now only the title, short title, and description) can also be returned from plugins, and this is saved as well. An absolute URL for the article is calculated and also saved.
The point of all this is that I no longer have to do all that work just to figure out what the title of an article is. If you want a list of the titles and URLs of some articles, you can just pull it out of the database.
Upgrading
I can't imagine anyone is using this for production use yet, but I had to upgrade my own Daizu installation so I might as well write down the procedure. I wrote a program (upgrade-0.1-0.2.pl) to make the necessary database changes automatically, and also one to reverse the process (downgrade-0.2-0.1.pl). They are included with the Daizu source.
Here's what to do, I think in the right order:
- Install version 0.2.
- Rename any
daizu:statusproperties todaizu:flags. - Make sure there's at least one article loader plugin enabled in your config file, because the XHTML one no longer comes built in.
- If you want a blog homepage or something else which isn't an
article to appear in a navigation menu, add a
daizu:nav-menuproperty with the right content. - Run the upgrade script.
- Update the default stylesheet in your content repository if you're using that, and republish all content (because there have been some small changes to the templates).
Detailed list of changes
Test suite:
- Use a configuration file to find out how to access the
template1and test databases, so that the tests can be run even if your PostgreSQL setup requires a username and password. r532, r539 - the broken tests in t/40template.t which shipped with Daizu 0.1 are now fixed. r529
- Use a configuration file to find out how to access the
The generator class to use for each file is now tracked (not just for the ones which actually have a daizu:generator property). The ‘root file’ is also tracked in a new database column
root_file_id, except that root files themselves (the ones with the property one) have it as null. This makes some publishing code simpler and allows the blog pages to restrict lists of articles to blog articles, which means you can now publish non-blog articles ‘inside’ a blog article, like the documentation for the upgrade and downgrade scripts is for the release notes for this release on the Daizu blog. r544, r545Article loading:
- Articles are loaded (using an article loader plugin) whenever they
are updated in the database working copies, and the results are
stored in the database. This makes publishing much faster, and a
lot of code simpler, because for example the true article title
(which may be supplied by the plugin if the user hasn't supplied
one) is available in the
wc_filetable. r503 - A permalink URL for articles (
article_pages_url) is stored when an article is loaded, so that it can be used by index pages or whatever to link to the article's first page. r518 - The XHTML article loading has been separated out into a plugin. This means you can now provide an alternative plugin for ‘text/html’ files if you don't like my one, but you have to load at least one article loader plugin in the config file. r502
- The content from an article loader now has XInclude processing done,
not just for XHTML content. Other loader plugins could make use of
that if they want to provide a file inclusion feature. XInclude is
now restricted to
daizu:URLs, since there may be security issues with other URL schemes. r505 - Various pieces of code which previously got article metadata and
permalink URLs from a Daizu::File object now get it directly from
the
wc_filetable when that would save a query. r513, r518
- Articles are loaded (using an article loader plugin) whenever they
are updated in the database working copies, and the results are
stored in the database. This makes publishing much faster, and a
lot of code simpler, because for example the true article title
(which may be supplied by the plugin if the user hasn't supplied
one) is available in the
Output files are closed properly to check for last-minute errors. r496
Several things are now done inside a database transaction where they weren't before, using the new transactionally utility function. r508
HTML anchors (
<a>elements withouthrefattributes) are removed from content before it is added to feeds because they can screw up the display in Bloglines. Anynameandidattributes on other elements are also removed to avoid namespace pollution. r509Daizu::File:
- Subversion properties are now consistently treated as text by the
Daizu API. The
wc_propertytable still stores the proper values (modulo the bug in the Subversion Perl API which screws up binary values), but the property retrieving methods in Daizu::File all do whitespace trimming and UTF-8 decoding. r526 - The title and short_title methods no longer inherit values from
parent directories, and the full title isn't used as a fall back for
the short title. This is to be consistent with bits of code which
get these values directly from the
wc_filetable. r526 - The tags method now returns a reference to an array instead of a list, to make it usable from TT. r521, r525
- Subversion properties are now consistently treated as text by the
Daizu API. The
Revision loading doesn't fail when a file is updated on a branch which doesn't also exist on the trunk. r497
Working copy updates don't break the database when a file in a non-live working copy has its content changed. r498
The update_all_file_urls function now deals with the URLs for files which no longer exist in the working copy, marking them as ‘gone’. r550
daizu:flags property:
- The
daizu:statusproperty has been renamed todaizu:flags, and a new flagno-indexcan be used to prevent a file from appearing in Google sitemaps. r527 - Implement the
retiredflag by showing a message warning at the top of the article page warning that it is out of date, and use a new property daizu:reason-retired to allow a different message to be displayed instead of the default one. r524
- The
HeaderAnchor plugin wasn't correctly removing all bad characters from titles before using IDs. It now also allows dots to remain. r523
PodArticle plugin now uses
<h3>instead of<h2>for top-level headings, because the default templates use<h2>for the article title. r541Daizu::Gen:
- Fixed temp file leak for thumbnails from PictureArticle plugin. r500
- Google sitemaps now only contain URLs from the correct working copy, and only ones with MIME types which Google will want. r515
- Navigation menu now shows only articles, which reduces the chance of random things popping up in it. Unfortunately this means blog homepages are no longer included, so I've also added a new property daizu:nav-menu to override the default navigation menu. r518, r528
Daizu::Gen::Blog:
- Fix navigation menu to not include too many months, as was originally intended, and sort the months in ascending order. r499
Previewing no longer tries to do UTF-8 decoding and encoding, so it should work with content in ISO-8859-* and some other encodings. r516
Optimize db_select_col by using selectcol_arrayref rather than looping through all the results from the query myself. r546, r547
Changes in terminology:
wc_file.base_urlis nowwc_file.custom_url, becausebase_urlis used to mean other things in other contexts. r548- Plugins which load articles are now ‘article loader plugins’ rather
than ‘article parser plugins’, because there might not be any actual
parsing involved. The ones supplied now all register a method called
load_articlefor consistency. The Daizu method for registering them has been renamed fromadd_article_parserto add_article_loader. r549
The default stylesheet now has additional styling, and some class names have been changed. r510, r514, r538, r551
Templates:
- The navigation menu's heading is now
<h4>instead of<h2>. r517 - The HTML doctype declaration is in a separate template. r520
- The navigation menu's heading is now