The English part of my blog is mainly technical. If you can read Italian, check the Italian section for articles of other kind.
The English part of my blog is mainly technical. If you can read Italian, check the Italian section for articles of other kind.
Themes are one of the most important parts of any CMS. They let users define how pages must be shown to visitors, so I want to show you how the theme of my website is written, with the hope that this can give you some hints on how to add value to your pages with MeshCMS.
First of all, a doctype is declared:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
I import user information since I want to display a different footer for logged users:
<jsp:useBean id="userInfo" scope="session" class="org.meshcms.core.UserInfo" />
The tag library is imported as usual:
<%@ taglib uri="meshcms-taglib" prefix="cms" %>
Setting a default locale is always a good idea, even if you're going to use the multilanguage feature as in this case:
<cms:setlocale defaultValue="en" />
Let the HEAD begin:
<html xmlns="http://www.w3.org/1999/xhtml"> <head>
Additional CSS files are included using the common LINK tag:
<link rel="stylesheet" type="text/css" href="<cms:themepath />/layout.css" media="screen,projection,tv" />
<link rel="stylesheet" type="text/css" href="<cms:themepath />/print.css" media="print" />
I build a custom title adding breadcrumbs:
<title><cms:pagetitle /><cms:breadcrumbs current="false" separator=" » " pre="…
I use a VMWare virtual machine to run my favorite software anywhere. It is a very nice solution, nevertheless when I run it at home I feel quite frustrated for not being able to run it on real hardware.
The easiest solution is to mount it as a local drive and access files from a real Linux installation. VMWare server provides a tool to mount vmdk files, but I don't want to install it just to be able to use that command.
Fortunately, I'm using a flat VMWare image, and this makes possibile to mount the image vithout any special tool. After all, the flat vmdk file is just a raw image of the disk, so you just need to use it as a loopback device.
Let's assume that the disk image is located at /diskimage-flat.vmdk (quite unlikely, but it's OK for an example) and that there are no other loopback devices in use (i.e. /dev/loop0 and /dev/loop1 are free). The needed commands would be:
losetup /dev/loop0 /diskimage-flat.vmdk losetup -o 32256 /dev/loop1 /dev/loop0 mount /dev/loop1 /mnt/diskimage
The offset in the second command might change for a different virtual disk (although I don't tink so if you want to mount the first partition). To check it, run the first command, then use fdisk on the first loopback device:
losetup /dev/loop0 /diskimage-flat.vmdk fdisk -l /dev/loop0
The offset is the start of the partition per the number of bytes per sector (63*512 in my case).
During the summer of 2004 I started writing my first web application: MeshCMS. I already had some background in JSP and a good knowledge of Java, but it was the first time for me to get the whole thing done. I decided to use what I already knew since I wanted to complete it in a short time: I was working as a freelance web designer/developer and I saw that many customers needed a CMS that was really easy to use. I tried many open source CMSes, but they were too complicated for end users.
It was a very formative experience: the application is still working and it is based on the original code. It has many of the issues that one could expect from such an application: JSPs contain Java code, the application flow is not clear and so on. This helped me to understand why web frameworks are a good thing, so I began another search: choosing a web framework.
I have a good knowledge of the HTTP request cycle, so an action framework should be OK, but all acition frameworks I tried tend to introduce scripting languages to create pages. While they do a good job, all of them have constructs that should belong to programming languages, not to web pages: loops, conditionals and so on. This does not help keeping presentation cleanly separated from logic.
Component framewors, on the other hand, add a substantial overhead, that is often unacceptable for small projects. (In my life I never worked on a project that involved more than five developers, so that is…
MeshCMS has been thought to manage websites, not blogs, but I really wanted to start a blog within my site, so I created a Blog module that is currently available on SVN. Let's make clear that if you want to get a blog, MeshCMS is not the best tool around, but in situations similar to mine, where the blog is just a part of the whole, it might come handy to be able to use a single tool for all things.
The blog module is really easy to use: just create a new page and insert the blog module into it. Articles must be subpages of that page, and it is recommended to hide the submenu for the main blog page (you can do that with the Page Manager).
You can add the Comments module in the theme as a fixed module, so you don't need to insert it into each article you write. Alternatively, you can do that for each page, so you get fine-grained control about which pages should be opened to comments.
Page keywords (declared using the standard <meta name="keywords" content="..." />) are used as tags. I will add a tag list module soon to allow to navigate the blog using tags. I will also add a simple calendar module, to select articles by date, and a RSS feed feature.
Modules to insert image galleries, audio and video are already available, and if you insert images using TinyMCE, MeshCMS is able to rescale them on the fly so you don't need to create multiple versions of those images. To see this feature in action, look at an example in an article from the Italian version…
MeshCMS is 3½ years old and the last major release is 5 months old. It started as a work project when I was a freelance web designer/developer, but now I work for a company and I don't sell it anymore. Development has become slower, and even if recently I committed many changes, they are just related to what I was needed for my own website: I've added a blog module, jtidy to clean HTML, better storage of MeshCMS information in the HTML (using meta tags instead of attributes of the html tag), a Lang tag to localize themes and other minor features. I've also improved the listmenu and info tags and some modules.
I often think about a new major version: MeshCMS 4. The main reason is that the current code does not reflect what I've learned in these years and it is even incompatible with my current vision of how a web application must be developed. To fix this, I should rewrite the whole CMS just to improve quality code, but it would require much work to achieve the same level of features that it currently has. At the same time, I don't want to make substantial changes to the current codebase.
I've collected many ideas about how I should rewrite this CMS, and I really hope to have the time to do that. Unfortunately, it would be a long process, since I know that I should code it during spare time.
Nevertheless, MeshCMS 4 is in my wishlist, and it will be a rewrite, so I would take some time to define which core changes should happen before I start. Some of…
English
Italiano