Motorcycle Adventures and Free Software

Weblog: Archive

2005-01-01 - 2005-01-31

New layout for OpenPSA

Posted on 2005-01-03 16:41:52 UTC to . 0 comments.

As Eero has rolled out OpenPSA 1.10, I thought it would be time to update the visual outlook of the project.

Before:
oldsite.jpg

After:
newsite2.jpg

What do you think?

Next we will need a logo for OpenPSA. I will announce a logo contest soon.

Updated 18:06: The new layout is now live. We've also posted 1.10 release announcement.

Sponsored links

Microsoft Certification Exams save money using, phone card

Comparing Midgard and WordPress

Posted on 2005-01-05 21:50:39 UTC to . 0 comments.

There has been some discussion on the Midgard IRC channel comparing Midgard CMS to the WordPress blogging system. Adam Douglas commented:

Don't get me wrong I love Midgard and I'm sure I will even more once I learn more how to do stuff but if we could just get some of it to be similar as WordPress man we would be rocking. It's so damn easy to use and install.

After replying I realized we should probably explain the difference between Midgard and standalone PHP applications better.

WordPress is a great tool when it comes to blogging. It is indeed very easy to set up, and its user interface strives to be simple and user-friendly. While technically Midgard's blogging component, de.linkm.newsticker includes most of the same features like RSS output or desktop blogging tool support, it still doesn't provide as good user experience. Installation is much more involved, and more steps are needed for setting up the website. The user interface is also more complex, with site management functionalities handled by Aegir and content creation by the on-site "edit this page" functionality.

Similarly to WordPress, several other PHP applications like Gallery and phpBB are considered to be the best tools in their categories. Again Midgard has components like net.siriux.photos and net.nemein.discussion providing similar functionalities. And again they are slightly lacking in setup, functionality or user interface sense when compared to their pure-PHP counterparts.

But that is all beside the point of Midgard.

While individual Midgard applications could be inferior to their pure-PHP brethen, their strength lies in sharing the common framework of Midgard CMF and MidCOM. And in many cases, the advantages of the framework vastly outdo the possible shortcomings of the applications themselves. Consider the following:

  • Templating. All Midgard applications run within the Midgard templating engine, allowing developers to easily provide common look-and-feel across different parts of their site. Midgard's templating engine was noted as the best in Ideal CMS of 2002 chosen by CMS Watch
  • Permissions. With Midgard all applications can share the same group-based permission definitions. For authentication there are several options like PAM and NTLM single sign-on
  • Hosting capability. A single Midgard installation can be shared between an unlimited number of organizations using the Sitegroups virtual database system
  • Performance. The Midgard core libraries have been written in C, and provide much more efficient Framework for CMS functionalities than interpreted PHP code or the typical htaccess hacks. In addition, Midgard's replication tools make clustering very easy
  • Configurability. With MidCOM's configuration engine all components provide an uniform way for changing their settings on either per-organization or per-directory basis
  • Multiple instances. MidCOM components are bound to site directories instead of installations, and so the same application can be utilized in different parts of a website
  • Security. Most Midgard applications use little or no filesystem access, and as far as I know none access the database directly. This means possible exploits can be prevented already at the Framework level

These benefits should make it easy to choose between Midgard or the different PHP applications depending on what is needed. If only a single functionality, say blogging, is required, a tool like WordPress wins the choice easily. It is simple to install, works on regular web hosting services, and has a very convenient user interface.

However, if more than one set of functionality is needed, or there are plans for growth, then Midgard is a better choice. With the slight initial cost of setting up a heavier system there is suddenly a much more robust framework and all its different integrated functionalities available.

Another point to consider is that in addition to regular web publishing functionalities, the Midgard Framework also provides a set of business tools. With Midgard it is possible to manage projects, sales contacts, help desk requests and product order fulfillment.

Room for improvement

Even though current Midgard and its Framework provide many benefits for organizations using them, this doesn't mean there isn't room (or need) for improvement. There has been talk of approaching the issues from several angles:

These focus areas and the MgdSchema object abstraction system being worked on by Piotr Pokora together promise to make 2005 a very interesting Midgard year.

Issue with communication

Currently the Midgard Project website makes a rather poor job of explaining the differences between regular LAMP CMSs and Midgard. I hope this posting clarifies some of the ideas of using a robust framework in addition to the regular common LAMP tools.

To support this I coined the designation LAMP+M to describe the Midgard Framework when writing the OpenPSA 1.10 release announcement.

Daniel Reichenbach suggested using the phrase Midgard: the glue in LAMP.

Creating custom navigation with MidCOM

Posted on 2005-01-07 20:51:48 UTC to . 0 comments.

One frequent question I see on #midgard is how to customize the default navigation options shipping with the MidCOM template site. In my opinion, there are two options: Either stick with the existing navigation styles and customize via CSS, or roll your own in PHP.

MidCOM provides a wonderful tool called Navigation Access Point (NAP) for site designers want to create their own custom navigation systems. It provides a PHP programming interface for listing the site structure. First, a bit of NAP terminology:

Node
Directory, or subtopic in the MidCOM site structure
Leaf
Page, or article under a node
Children
Both nodes and leaves under a given node
Root node
The first level node, or front page of MidCOM site

Constructing the navigation happens in two steps:

  1. Figure out where you are:
    $current_node = $GLOBALS["midcom_site"]['nap']->get_current_node();
  2. List the children of the node:
    $children = $GLOBALS["midcom_site"]['nap']->list_child_elements($current_node);

The $children array contains both nodes and leaves under the $current_node in NAP array format which you can then traverse:

foreach ($children as $child) {

As we're listing all child elements from the node instead of only nodes with list_nodes() or leaves with list_leaves() we next need to instantiate correct child type for display:

if ($child[MIDCOM_NAV_TYPE] == "node") {
    // This is a subtopic, instantiate it as node
    $node = $GLOBALS["midcom_site"]['nap']->get_node($child[MIDCOM_NAV_ID]);

    // Display the link in whatever way you want
    echo "<div><a href=\"".$node[MIDCOM_NAV_URL]."\">".$node[MIDCOM_NAV_NAME]);</a></div>\n";
   // This is where you would place a call for listing children of the node

} elseif ($child[MIDCOM_NAV_TYPE] == "leaf") {
    // This is an article (or event or some other document type)
    $leaf = $GLOBALS["midcom_site"]['nap']->get_leaf($child[MIDCOM_NAV_ID]);

    // Display the link
    echo "<div><a href=\"".$leaf[MIDCOM_NAV_URL]."\">".$leaf[MIDCOM_NAV_NAME]);</a></div>\n";
}

And there you have a very simple navigation listing of children under your current directory. You can easily modify this to list children of your root node by switching from get_current_node() method to get_root_node() method.

This example also doesn't check for possible content visibility settings. You can check for these using the MIDCOM_NAV_VISIBLE boolean in the node and leaf arrays.

In the other news, if you get error "Apache2(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80" when restarting Apache after addition of a new VirtualHost with datagard, the problem is that you have multiple "Listen 80" directives in your Apache configuration. Comment out the one in /etc/midgard/apache/httpd.conf.

Figured this one when troubleshooting with Robert Guerra from Canada.

Gotchas for new Midgardians

Posted on 2005-01-08 19:48:12 UTC to . 0 comments.

Based on some chats today and yesterday with Privaterra and others, here are couple typical new Midgardian gotchas:

Fatal error: Allowed memory size of 8388608 bytes exhausted when trying to create a subtopic

Currently MidCOM's component listing used in the "Create subtopic" dialog needs quite a bit of memory. While solution is being planned, the easier way is to edit your php.ini and set memory_limit to something like 32M

MidCOM's content authoring interface doesn't look right

If your MidCOM AIS doesn't look like in the screenshots, the most likely reason is that the AIS CSS or images are not getting loaded. To fix this, ensure that your style includes the <(head-extra)> call somewhere within the HTML <head /> section.

In addition, if you're using MidCOM 2.x you need to ensure that the static directory where MidCOM's CSS and image files are stored is symlinked under your DocumentRoot. To do this, run:

ln -s /usr/share/pear/midcom/static /var/lib/midgard/vhosts/www.example.net/80/midcom-static

The MidCOM site template on my site doesn't update when I update the midcom-template package

The Midgard website creation instructions instruct using MidCOM Site Template through Aegir's Template functionality. With this functionality the a site-specific version of the midcom-template gets created. And this obviously will not be updated when you upgrade MidCOM.

You can easily switch the site to using MidCOM Site template in shared mode. To do this log into Aegir as System Administrator, go to Websites, and open your site for editing (you have to click it twice to get the details to the right-hand frame). Then simply change the value of Root page to MidCOM Site Template/template_midcom.

How do I blog with Midgard CMS?

Once you have a MidCOM-powered site set up, creating a weblog is very easy. Just Log in to your site, click Create page and then Create subtopic. You will be presented with the MidCOM topic creation form. Fill in the URL name and Title, and select type as News listing (de.linkm.newsticker).

The MidCOM newsticker is a powerful news posting system with easily customizable templates, and support for features like RSS and remote weblog editors.

If you want to enable user comments, there is a short HOWTO available.

And finally, if you're blogging about Midgard, please let me know. We'll be more than happy to add you to Planet Midgard. Making a hackergotchi of yourself would be a nice bonus :-)

Browser says my site is latin-1. I thought Midgard used UTF-8 as default?

Midgard 1.6+ uses UTF-8 character encoding by default to support better internationalization. However, Apache uses latin-1 encoding by default, and so unless your layout specifies otherwise by having a line like this in the <HEAD /> section:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

The other, and more reliable option is to edit your httpd.conf file and add the line:

AddDefaultCharset utf-8

This will cause Apache to serve all documents as UTF-8 encoded.

Note: It can be dangerous to have the site (as recognized by browser) and Midgard use different character encodings. As the content is also edited through the browser this can cause broken characters to get in. Switch to serving your site using correct encoding as soon as you can!

Midgard will have integrated search

Posted on 2005-01-11 22:16:27 UTC to . 0 comments.

Today we secured funding from two clients for developing an integrated search engine into the Midgard CMS. The project will be undertaken by Torben Nehmer and will also improve Midgard's metadata capabilities.

The idea for this new search implementation originates from the Lucene session of OSCOM 4 conference. Instead of running a separate spidering process, MidCOM will update the search index every time content is changed. Search results will be handled as Midgard objects, allowing their respective components to handle display of individual items. This means that photo records in search results can display a thumbnail, and news items publication date.

Other Midgard applications like OpenPSA can also implement the indexing system into their saving routines, making information much more easily available.

This isn't the first time Midgard is going to have an integrated search system. Old, pre-1.0 versions of Midgard implemented SQL LIKE queries for searching, and an old Midgard2 server built by Ami Ganguli had an XML-RPC based indexer. Unfortunately Ami lost the source code for that and it was never deployed outside Stonesoft's extranet.

Midgard as the modern-day Hansa

Posted on 2005-01-12 08:33:39 UTC to . 0 comments.

I really like this comment in CMS Watch's latest Web Content Management Marketplace article:

Even the open-source project Midgard has found a base of sorts in Scandinavia, and has grown through a loose network of developers around the Baltic Sea into a kind of new CMS Hanseatic League.
(Trend #2, Vikings Cometh?)

When you look at the Midgard Who's Who, most of the active developers really are from the ancient Hansa countries around the Baltic sea. Finland, Sweden, Norway, Russia, Germany, Poland, Belarus. This doesn't limit the developer community only to a particular area, but it shows where Midgard is most widely deployed.

The Hansa comparison works quite well, as the historical Hansa was a network of cities collaborating to provide better security and trade access to their merchants. Similarly the Midgard Community is a network of software developers collaborating to provide a better content management system to their clients.

Some of the other trends sound familiar as well. Midgard has always worked "beyond Internet Explorer" (trend #5), and more so after Midas brought WYSIWYG editing into Mozilla 1.3 in 2003. As reported yesterday, Midgard will also gain repository search (trend #6) in next month or two.

The call and requirement for Simplicity (trend #4) is also there. Midgard user interfaces have grown quite feature-packed, and steps must be taken to simplify and make them more intelligent. Projects like GNOMEgard desktop integration, datagard installer and the site creation wizard aim at this. But in addition to those, the whole Midgard developer community must learn to work more closely with usability guidelines.

Adding categories to a Midgard blog

Posted on 2005-01-13 22:07:09 UTC to . 0 comments.

Hot on the heels of my previous Midgard CMS tutorial, "Creating custom navigation with MidCOM, here is a new one about adding categories to a Midgard-powered blog. I've written this in response to Robert Guerra's questions.

Midgard CMS contains a powerful PHP-level data abstraction layer called datamanager. With datamanager it is possible to freely modify the content fields and editing widgets used with any component.

The first thing when adding new categories is to make the category field array. Robert's example was:

"category" => array(
  "description" => "Category",
  "datatype" => "text",
  "location" => "parameter",
  "widget" => "select",
  "widget_select_choices" => array (
     "Privaterra" => "Privaterra",
     "Midgard" => "Midgard",
     "Travel" => "Travel",
     "Security" => "Security",
   ),
),

While I would use more descriptive keys than cat1 for the categories, the actual field definition looks correct.

What you need to do next is to copy the default de.linkm.newsticker schema from the component API reference and add your own field definition there.

it is the area starting with:

"default" => array (
    "name"        => "default",
    "description" => "News Article",
...

Copy that area into a text editor (or just your clip board), and add the category block you've made into the "fields" array. A good place to do that would be between "title" and "abstract".

Then you need to store this new schema definition into your Midgard setup as a snippet.

Go to Aegir, select the "Snippet" tab from the left, and create a snippet directory named "sitegroup-config". Then under that create another snippet directory named "de.linkm.newsticker" by clicking "New" on the right-hand frame's menu.

This is the default location used for MidCOM's configuration. You don't need to follow that convention but I'd recommend it.

Now that you have the snippetdirs created, click "New" (again in the right-hand frame), and create a snippet named "schema-blog", and paste your schema array there.

Then you need to configure your newsticker to use the new schema. Here you have two options, either set it to be used by all "newsticker" folders on your site, or only your blog.

To use it for all newstickers, create another snippet named "config" in the /sitegroup-config/de.linkm.newsticker directory, and in that snippet place the following:

"schemadb" => "/sitegroup-config/de.linkm.newsticker/schema-blog",

If you want to enable it for only one newsticker folder (or override the default specified above), you can do this by going to the newsticker folder on site, and clicking the "Component configuration" toolbar item. Scroll down the form, and enter your schema's path in the "Path to the schema database" field:

/sitegroup-config/de.linkm.newsticker/schema-blog

Now your blog should have categories enabled. I'm not sure how Ecto handles them, but probably the next time you refresh your posting list there, the category selections should appear to the editor. At least that is how it works in MarsEdit. The categories will also appear in the RSS feed generated from your blog. But they won't yet appear on your site. For that you need to modify the output templates of your blog, and that is the subject of another lesson :-)

Note: the steps needed for adding simple category support to your blog might sounds exceedingly difficult. However, it has to be kept in mind that you can use the exactly same technique for controlling all data structures on your site (adding new content fields to articles, photos or whatever). There is more information about modifying schemas in MidCOM schema documentation.

Midgard site creation wizard

Posted on 2005-01-14 17:41:37 UTC to . 0 comments.

After quite some planning, I've today started coding a site creation wizard for Midgard CMS. The goal of this wizard is to make the Midgard learning curve less steep for new users and the site creation process more efficient. The specifications for the wizard can be found in mRFC 0007: Midgard Site Creation Wizard.

The site wizard is being built in MidCOM CVS HEAD, component midgard.admin.sitewizard. Currently the component loads correctly, and lists all regular (non-admin and non-attachment server) Midgard websites in its navigation array. The first form in the wizard, "Select organization" has also been implemented but is so far non-functional.

I expect to get first functional versions of the component done during monday. Before that, this is how it looks like:

select-organization-20050114.jpg

And in Finnish:

select-organization-20050114-fi.jpg

As the Site Wizard operates as a regular MidCOM component, it enjoys all the regular benefits like configuration, localization and templating. This will enable hosting companies to deploy the site wizard using their own branding and terminology.

Site creation wizard runs

Posted on 2005-01-18 09:25:10 UTC to . 0 comments.

Yesterday I got the mRFC 0007 compliant Site Creation Wizard for Midgard CMS into feature-complete state for phase one. This enables Midgard users and developers to test and comment the tool while I refine the user interface and help texts. Here's a screenshot tour of the current wizard

1. Organization selection screen. Here the user can either create a new sitegroup or work with an existing one. If no sitegroups exist the latter option is hidden. The screen also supports defining disk space limits for the new Quota feature if enabled in Midgard installation.

select-organization-20050118.png

2. Website creation. Next the user will be able to enter the hostname of their new Midgard site. Currently enabled Advanced options are setting a user-defined port and directory prefix. When the host is created the site wizard will also look for an initialization interface in the selected site template and create data structures like a content tree if necessary.

create-host-20050118.png

2.1. Website configuration. After the website has been created and initialized the wizard checks if there is a Datamanager compatible configuration interface in the site template. If one exist the user will be directed to the website configuration form. The form enables changing different parameters used by the site template.

configure-host-20050118.png

3. Style selection. After a website has been correctly set up the user can select a style for their website from a set of templates installed on the server. The selected style template will be created as a inherited style owned by the organization, and will be completely editable by the site administrators.

Plans for the style selection screen include displaying screenshots and licensing details of the templates in the list. The list will also include a Custom style option enabling site builders to start from scratch.

select-style-20050118.png

3.1. Style configuration. Just like website templates, the style templates can contain a datamanager compatible configuration interface. Styles can use this configuration interface to enable users to easily change things like colors and images in the layout. If a configuration interface is detected in the style the user will be directed to it after selection.

configure-style-20050118.png

4. Finish. After style has been correctly configured the new Midgard site should be running, provided that corresponding Apache Virtual Host settings have been made using datagard. In the future this screen should determine the status of the virtual host and give user instructions on what still needs to be done, or simply direct to the newly created website if everything works.

finish-20050118.png

At this stage I would really appreciate comments and testing on both the user interface and functionality. I sent quick setup instructions to the midgard-dev list yesterday.

The basic principles while creating the wizard have been:

  • Enable only the UI options the user can actually use at each stage
    • Both PHP and JavaScript are used for hiding or disabling options as needed
  • Let the site template handle most of the setup logic
  • Show sensible error messages to the user
  • Roll back and clean up properly in case something fails

The Midgard Site Wizard will be the first UI seen by users after Midgard 1.7 installation, and so should be as clear and usable as possible.

EU agriculture ministers threaten again with software patents

Posted on 2005-01-21 12:34:20 UTC to . 0 comments.

EU ministers of agriculture will have a fishery meeting on Jan 24th. The meeting agenda includes software patents. The agriculture ministers tried to make a decision on the new European Patent directive earlier, but the Polish agriculture minister, Wlodzimierz Marcinski saved European software business by requesting the withdrawal of patents from the agenda.

I've written the following (in Finnish) to Finland's Minister of Agriculture and Forestry, Juha Korkeaoja and his staff:

Euroopan maatalousministerit kokoontuvat keskustelemaan EU:n kalastusasioista 24.1.

Samaan tapaamiseen on aikataulutettu neuvottelut EU:n ohjelmistopatenttidirektiivistä, jotka hylättiin jo kerran käsittelystä Puolan maatalousministerin aloitteesta.

Millä perusteella tämä asia voisi olla maatalousministerien päätettävissä?

Ohjelmistoalan yrittäjänä olen seurannut huolestuneena miten EU suurten Yhdysvaltalaisten ohjelmistotalojen lobbaamana haluaa antaa kuoliniskun oman maanosansa ohjelmistoteollisuudelle.

Patenttien alkuperäinen ajatus oli tuoda uudet innovaatiot koko ihmiskunnan käyttöön. Porkkanaksi keksijälle keksinnön dokumentoinnista tarjottiin rajoitettu yksinoikeus keksinnön kaupalliseen hyödyntämiseen.

Ohjelmistopatentit kierouttavat tätä alkuperäistä ajatusta mahdollistamalla suuryrityksille monopolin toimialan useisiin tavallisiin ja itsestäänselviin toimintatapoihin. Patentteja myöntävillä tahoilla ei ole tarvittavaa kompetenssia ymmärtää ohjelmistopatenttien järkevään toimintaan tarvittavia ainutkertaisuusvaatimuksia.

Täten haluaisinkin tietää miten Suomi voi EU:n jäsenmaana hyväksyä pienelle ja syrjäiselle maalle elintärkeän pienyritysten harjoittaman ohjelmistoteollisuuden toimintaedellytysten merkittävän heikentämisen.

Story via Ronald Bultje.

Updated 2005-01-24: Poland was able to delay the decision again.

Nemein.com in some interesting language

Posted on 2005-01-24 13:59:48 UTC to . 0 comments.

Expect some future announcements related to this.

nemeincom-20050124-ge.jpg

The technical side of this localization was very easy, as Midgard's UTF-8 mode worked like a charm and the convert tool helped.

Bad taxi day

Posted on 2005-01-25 20:29:29 UTC to . 0 comments.

During the winter there is no motorcycling to be had, and so I use public transportation. To get to and from urgent meetings I usually take a taxi. The taxis in Helsinki region are usually very nice and high-techy. The drivers use a moving map GPS systems for orienteering, and the taxis can be called via SMS.

The SMS ordering system is very nice because it bypasses the long queues in the taxi center and go directly to the cars. When a driver takes a job you get the an SMS notification with the car number. To order a taxi, send an SMS to number 13170 containing:

CITY STREET NUMBER, for example
Espoo Sepetlahdentie 9

This is all very nice. However, today has not been a good taxi day.

  • The first cab driver of the day was visibly drunk, and the whole car stank of old booze
  • The second driver drove cheerfully past Rambo and I when we were waiting on the parking lot, and kept driving away from us every time we walked towards it
  • ...and finally, the third driver arrived 15 minutes late and needed constant advice to avoid getting lost in the city

Oh well, now on to the flight instrument training that is part of FCF's PPL(A) theory course.

In the other news, Midgard CMS got a new WYSIWYG editor alternative thanks to Nico Kaiser. TinyMCE looks very promising, especially with the integrated XHTML and CSS support. I installed Nico's patch to my test server, and it works quite well although configuration interface is still missing. Thanks, Nico!

Revised discussion forum for Midgard

Posted on 2005-01-27 21:40:22 UTC to . 0 comments.

This week I've been working on revising the Midgard discussion forum component to a usable shape. While the old version was OK when dynamically loaded as a comment system for blog postings or photos, it lacked the functionalities needed to make it a real forum.

Main work with this new version was to port the forum to utilize datamanager, MidCOM's data abstraction layer. This enables usage of the communityhtml data type for bbCode support, and makes it possible for the site administrators to add new data fields for comments and threads using a simple configuration format. The complete output of the component can be modified using MidCOM's templating model. The default output templates now provide many hooks for styling via CSS.

discussion-reply.png

In addition to datamanager support, several other features were added:

  • Moderators and administrators can now delete posts
  • Threads are now shown together with posts in the "latest" view
  • Threads have nicer, title-based URL names
  • Thread list is now split to subpages, with configurable number of threads per page
  • Threads are not listed in site navigation by default
  • Subthread support has been removed for better clarity, performance and phpBB compatibility

This new and more usable version of the net.nemein.discussion component is available in MidCOM CVS. However, many more improvements are being worked on.

Tier 1: Better discussion board

  • "Notify me of new messages in this thread" subscription system instead of sending new comments to thread author
  • Native anonymous posting support similar to the Midgard Wiki
  • Datamanager-based configuration UI

Tier 2: External interfaces

  • RSS 2.0 output (both all latest comments and per-thread)
  • wfw:comments API support
  • Gravatar support
  • phpBB import and migration tool
  • Easier addition of comments support for blogs powered by de.linkm.newsticker
  • Skipping MidCOM cache engine in midcom-template when a comment is submitted

Tier 3: Better user experience

  • User registration and avatar handling with the net.nemein.personnel component
  • Caching number of posts per username
  • IP, domain and username blacklisting support
  • Providing thread moderation tools
  • Allowing thread editing and deleting only for the poster, not all owners

Most of this work will be financed by two of our clients, an ISP and a radio station. I will implement tier 1 and some tier 2 features soon myself, and the rest will wait until Torben gets enough time from his work on Midgard's new integrated search engine.

Now the discussion forum is only 1843 lines of code including layout templates. The reason why it was rewritten only now is that I was unnecessarily intimidated by datamanager's creation mode. However, after a bit of thought it proved to be a surprisingly simple API to work with.

This blog post has been written in Pullman Bar powered by Velkopopovický Kozel and Cohiba Siglo III. Next on the agenda is the radio technology lecture of the PPL(A) course.

Back