Part 1: Understanding Lenya

22 January 05

In this first installment in a series of articles on Lenya, I’d like to talk about what Lenya is and what approach it takes in content management, including its advantages and disadvantages.

History

Lenya was started by Michael Wechner in early 1999 as a way to document a journal on pattern formation. From there, he co-started a company called Wyona which continued to work on the project until the spring of 2003, where the project was donated to the Apache Software Foundation.

Hiram College, for which I am the webmaster, hopped aboard the Lenya train around July 2004 as a solution for our content management needs for our external website. My experiences do not make me an expert on Lenya, but I can give some insight to those who have just started or who are interested in trying Lenya.

Approach to Content Management

Lenya’s approach to content management is just that: content management. While some CMS’s allow users to change the styling of pages in the graphical interface of the application, Lenya does not. Some consider this to be a big negative for Lenya, and for a large institution with multiple designers and CSS developers, it can be. I’ve been finding, however, as just one user that maintains the look and feel of Hiram’s website, this isn’t that bad. Instead of working in a webpage to update my CSS, I just upload it to the server.

Of course, this means that the structural markup for the overall page layout is not managed in Lenya either, well, at least not through the graphical user interface. Instead, your page layout is done in XSL files, and when the page is accessed through your web browser, the content and the XSL template merge and get transformed into a valid HTML or XHTML document.

The good stuff

What grabbed my attention with Lenya was how it went about presenting your content for editing. When you log in to your website through Lenya, you can click on the navigation in the pages as if you were browsing your website right there. Find something wrong in the text of one page as you browse? Just go to Edit -> WYSIWYG Editor and you’re taken to a page where you can change the content. Save your changes, then publish the updated page. It’s incredibly easy.

What’s also nice is that the foundation of Lenya is built on XML which, of course, is great news for web standards gurus who will only work with XHTML. By default, Lenya uses HTML 4.0, but a quick change in one file will switch all your pages to XHTML Strict. And since it relies on XML, there’s no backend database that manages this: it’s all flat XML files stored on the server. Don’t get this confused, however, with having the ability to connect to a database as you would with any PHP-type language, because Lenya can definitely do this as well.

And as any good CMS would, information about the pages, like metadata, amongst other things, can be edited for each page and is kept separate from the content on the page itself. Lenya utilizes the Dublin Core for its metadata tags in pages.

Some downers

OK, so there are some downers. The terminology takes a bit of getting used to. For example, “assets” are documents, images, or anything you want to link to in the page that isn’t text. Some things just don’t happen by default in Lenya: they require some extra programming. For example, say you add a new item in your site’s navigation, but it doesn’t have a page on your website, it just links to an outside site. There’s no nice way of doing this in the graphical interface. A login to the server to edit the publication’s sitemap will provide this functionality.

Also, Lenya runs on top of Apache Cocoon, which is not the downer, but the time required to learn it makes a lot of people give up quickly. Pipelines are the big key to understanding how a page is created in Lenya, and trust me, that will take some getting used to when you want to do something that doesn’t fit the general site provided for you as an example. With that, it’s much harder to find a company that will host Lenya for you – chances are you’ll need to have a server of your own.

One last thing for picky web developers: getting a website to have clean URLs is a bit tricky. Even I have yet to get this working exactly the way I would like it to. And with Lenya and clean URLs comes a much more detailed look into configurations with the Apache web server than you are probably used to, which does take some time.

What’s next?

So, you read the advantages and disadvantages and you want to take the plunge into Lenya? Good, because in my next article I’ll be explaining the methods I took to get Lenya up and running on our RedHat Enterprise Linux server. Don’t worry, you won’t need this specific operating system to make Lenya work. Lenya can run on pretty much any UNIX/Linux server and (even) Microsoft Windows.

Feel free to post general questions on Lenya and I’ll try to help as best as I can.

Comments?

Kyle - Jan 23, 5:01am

I’ll be looking forward to these articles. Some suggestions: perhaps provide some screenshots? I am curious to how Lenya is managed and works from the backend. I’ve been unable to find a way of how this works without installing the whole suite of apps to run it – which I’m not prepared to do just to “test out” a new CMS.

I’m personally really excited about more XML based CMS systems. I use an XML based framework at my work transformed through XSL and I can clearly see that this is where the future of the web is headed. One templating language for all… it’s hard to understand until you work with it though :)

Jon Linczak - Jan 23, 7:46am

Hey Kyle, I can do you one better than screenshots. How about a demo site to play around with? You can do that here: http://olr.kbs.uni-hannover.de:8888/index.html. I don’t know how often they reset it, but it’s definitely worth the look.

Oh, and thanks for being the first commenter! :)

mike - Jan 24, 12:35pm

Really looking forward to your next installment(s). I’ve taken it a step further than Kyle—installing Lenya (on my machine)—but have stopped there.

The lack of available documentation (and articles like yours) are a major roadblock to taking this to my supervisors and saying, “Let’s do it!” The price tag of free helps.

Ameya - Jan 27, 1:47am

Hi Jon!
Thanks for the wonderful lenya 101! I am a webmaster from India and was considering using Lenya for developing our college website. I really look forward to your next installment(s) and would love to talk to you about your experience of deploying lenya for your college

Thanks
Ameya

Jon - Jan 27, 4:34pm

Thanks Mike and Ameya! I agree, Mike, that documentation is scarce and even if it is there, it’s difficult to read or understand. The next article is a culmination of about a million questions on the Lenya developers and users mailing lists, so I hope it will help someone… look for it in a couple of days!

Mike - Feb 9, 7:37pm

Kyle, I don’t know why you think you need to install all this stuff to run it. I downloaded the Windows binary and all I had to do was unpack it, run lenya.bat and connect to localhost:8888. It runs its own jetty, etc and no setup is needed to get the tutorial site right out of the box. The only extra thing you need is a jdk.

Funmi - Mar 21, 5:50am

Hello,

I would like to know if it is possible to integrate Lenya with a DB2 database so that any data entered by a content contributor can be stored permanently and used elsewhere.

If this can be done, can you tell me how.

Thanks,

Funmi.

Jon Linczak - Mar 21, 1:44pm

Hi Funmi, the short answer to your question is, yes, it can. I don’t really have the explanation on how to do this though, but it would basically be changing the process for publication. You can post your question on the Lenya user mailing list for more help.

Amna & Kiran - Mar 26, 1:09am

Hi, we have been going through the Lenya and Cocoon source code and we couldn’t understand the reason why there r so many sitemaps in cocoon n lenya source folders…Initially after studying abt the sitemap, we presumed there would be a single sitemap But upon going through the source we found ourselves totally lost…Plz help us

Jon Linczak - Mar 27, 12:03am

Hi Amna & Kiran, indeed, when going through Lenya for the first time, it’s quite daunting. I would encourage you to start with what’s given to you and see what you can accomplish. When you’re ready with limitations in hand, then I would send an email to the Lenya user mailing list and ask for help. Starting with the source just kinda confuses you.

However, I’m not a developer so I can’t say for sure, but the reason why there are so many sitemaps is because they are all grouped together for a purpose. You’ll notice that there’s one main sitemap in the publication folder (publication-sitemap.xmap) that controls most of the Lenya and website functionality for that publication. But, there’s another for all of Lenya, which houses more global things.

In general, Cocoon is setup so that any processing from one page to another is accomplished in a sitemap (read my article on pipelines to see how this works), which is why you see so many. If you stick to just the publication-sitemap.xmap file in the default publication, you should be OK. Only when you get into some seriously advanced stuff will you need to look at any of the others.

Hope this helps!
Jon

ansuman - Oct 6, 5:17am

hi jon,
i recently started up cocoon and lenya and i am designing a simple cms with lenya. now after going through the documentation i did not understand where to start up with.

I have one more question. Is cocoon necessary to progress development in lenya. ok if its necessary then what all things i need to learn about it.

cheers,
Ansuman

Jay - Jul 22, 5:29am

I have install and read the documentation very well, almost 5 times. but like ‘ansuman’ still not sure from where to start.i need more easy and detail information of using lenya.please if any body can help me.Thanks

commenting closed for this article

in this site