Part 4: Editing in Lenya

19 February 05

There are several editors that you can use in Lenya, but because I only have used 2 of them, these are the ones I will briefly go over here.

Kupu

Kupu is a WYSIWYG editor that was developed through OSCOM and has been integrated into Lenya. The editor is quite simple to use, and has an aggressive timeline for future improvements. You can see a screenshot of Kupu in action below:

When you install Lenya, you'll notice that when you try to edit a page in your publication using it, you'll get a message stating to build it before you can use it. You'll need to go to Kupu's main directory and type make to build it properly:

cd /usr/local/tomcat/webapps/lenya/lenya/resources/kupu
make

You may get an error stating that the build could not be completed successfully because it could not find xsltproc. If this is the case, you'll need to download the xsltproc package and install it before continuing. Since I'm using RedHat Linux, I'll give you the steps for installing the RPM. Adapt the instructions for your own OS.

First off, check to see if you have the proper RPMs:

rpm -qa | grep libxml2
rpm -qa | grep libxslt

If nothing is returned for either one of them (or both), then there's two ways to download the proper RPMs. One is by using RPMFind. Go to these URLs:

Look for your OS and download the appropriate RPM. Once downloaded to your server, install the packages:

rpm -ivh libxml2-2.5.10-7.i386.rpm
rpm -ivh libxslt-1.0.33-5.i386.rpm

The version numbers are probably different from the latest. Just be sure you get the latest versions of each.

The second way is if you use RedHat's up2date program (you must be registered with RedHat). To use this, just run the following command:

up2date --showall | grep libxml2
up2date --showall | grep libxslt

Once the package names are found, you can download them from the up2date server like so:

up2date --get libxml2-2.5.10-7.i386
up2date --get libxslt-1.0.33-5.i386

The RPMs will be stored in /var/spool/up2date/. Go there, then install them as mentioned above (recapped below as well):

rpm -ivh libxml2-2.5.10-7.i386.rpm
rpm -ivh libxslt-1.0.33-5.i386.rpm

Those that are savvy with up2date can find a more efficient way to install these RPMs, but this will do for now. Once the RPMs are installed, go back to Kupu's directory and run make as mentioned above. Now you're ready to edit using Kupu!

It should be noted that it is planned for future versions of Lenya that Kupu will already be built, so the steps above should no longer be necessary.

Bitflux (or BXE)

Bitflux is another WYSIWYG editor that was developed separately from Lenya and integrated into the project. Bitflux's approach is slightly different from Kupu's in that from the visual standpoint, it appears as if you are editing the content right on the layout of the page. Kupu, from the screenshot above, gives you a whole new page that focuses just on the content. I'll let you work with either one and decide which is your favorite. Hiram College chose to use Kupu, not because Bitflux was worse, but because Kupu was more flexible and easier to understand for the faculty and staff that were using it. Below is a screenshot of Bitflux at work:

In version 1.2.1, Bitflux is already installed and ready to go, so there's no need for any added configuration.

Next articles

Well, I wanted to keep this one short, as I'm working on cooking up some more heftier articles, including customizing your navigation and an intro to doctypes and usecases. As always, if you have questions, please don't hesitate to post here and I'll be glad to help.

Comments?

Jure Jerman - Feb 20, 6:56am

Hi,
we have just started thinking how to implement Lenya in typical govermental environment. It is great to read your articels every week and to proceed in line with them.

Jure

Jon Linczak - Feb 21, 11:37pm

Hi Jure, thanks so much for the note. I get comments and emails from people just like this one telling me who appreciative they have been for the articles on Lenya, and all I can say is how appreciative I have been to everyone for reading them. Best of luck on your project!

Nick Aliwell - Mar 18, 3:57pm

Hi,
Thanks for the articles.
Couple of questions you might be able to help with.
Do you know where i can get help with installing xsltproc on os x?
and another question, probably more appropriate to the previous article on installation:- Whats the main difference/advantage between installing the binary version and the source version of lenya? its just i tried to get the source version installed but have run into a few problems, which i didnt see when installing the binary version previously.
Thanks

Jon Linczak - Mar 20, 10:54pm

Hi Nick,
For help on xsltproc on MacOS X, I found this page that has binaries you can download and install for the latest versions.

As far as the differences between the binary and source version – that’s a good question. I’ve never used the binary version, to be honest, since I’ve always needed to make customizations before installation. I’d say if you like Lenya the way it is by default, and you aren’t having problems with the binary release, continue to use it and have fun. The biggest advantage for me on the source version is just that I can read, understand, and change the source code to suit my needs.

Hope this helps!

Nick Aliwell - Mar 22, 4:26pm

Thanks for the reply,
What kind of customizations? Im not sure i understand the separation between application and publication. Are all changes to a publication made to the deployed app? And if you need extra functionality from the CMS application level do you redeploy? Does redeploying overwrite publications?
Looking forward to reading the new article.

Jon Linczak - Mar 24, 9:16am

Well, “customizations” really are just things like fixing “bugs” that haven’t been added yet to the release, or some customizations to the Lenya interface that hasn’t been added yet. For example, I submitted an update to the Lenya developers for a brand new interface around the Authoring environment, and they have implemented it in 1.4, but not the 1.2 series. Since I want to use it because it has better support for XHTML, I’ll add in my files before building.

Any changes made to a publication are done only to the publication itself (like changing XSLT files for navigation, etc.), so it won’t affect all of Lenya or any other publication. You can change global files to affect all publications, but it’s not recommended.

I’m not sure what you mean by redeployment. If you mean do you have to re-build the application, then that’s a no for most cases. A restart would typically do it. But if you are changing source files, then a rebuild would be necessary.

In the build process, there are options to say not to overwrite certain files or directories, which makes it nice for upgrades and customizations. Of course, if something changes in the content itself (like any of the XML tags in the beginning of the document), then a merger of the old and new information needs to be done, and that’s a process I’ve seen described in the mailing list, but have yet to do it myself.

Thanks for reading, and hope the explanation has helped!

Nick Aliwell - Mar 25, 5:27pm

It’s been a great help.
Thanks

Peter - Apr 27, 5:13am

Hi Jon,

1. I’ve been having trouble with Kupu – especially with text/image alignment. Even though it aligns the text/image after clicking on the apropriate icon, it won’t save this alignment (always sets back to default after saving).

Also under IE it comes up with an error (“Error saving your data. Response status: 1223. Check your server log for more information”).

I’ve googled, tried mailing list and found this question being asked, but never answered.

Have you come across this problem and solution?

2. Also some more documentation on using KUPU would be good. There isn’t much on their website and it’s making me a bit cranky. Like how do use those table classes, how do you set them up to have border-less and bordered tables?

3. Then how can users add other assets (PDF documents…) to web pages? Uploading is easy, but then what about adding link to those assets in page’s text?

4. Is it possible to switch off RELAX NG Validation? After creating/editing the page in KUPU and then making some changes in source editor, it yells with errors in code generated by KUPU. Or another suggestion?

5. Where did you get Lenya 1.2.3 you describe in your tutorials from?

Some inside and help be very appreciated.

[Same probs on: Win XP Pro, RedHat9;
apache-lenya-1.2.2-bin, but also tried 1.2.1, and 1.2.2-src and build KUPU, as well as downloaded and build KUPU separately.]

Peter

Jon Linczak - Apr 27, 9:07pm

Hi Peter,

These are definitely good questions – I think I better mark on my list of articles to be done that one should be done on Kupu. I’ll try to briefly answer your questions:

1. Text image alignment can be fixed if you add your own CSS styling to the publication. So, whatever Kupu uses for the class names when you assign image alignment to an image, those are the class names you use in your CSS to set either float: left or float: right. I changed the source code in Kupu to assign the class names I want, and if you need to know how to do that, let me know.

The other possibility with the lost image alignment is that the align attribute for HTML tags was blacklisted, so that once you save your content in Kupu, Kupu strips out all tags and attributes that were blacklisted. This archived email thread talks about it. Let me know if you get to this point and run into more problems.

As for the error, yes, I have come across that in IE myself. I ended up telling all of my users to use Firefox instead and that gets rid of the errors. A five minute glance at the Bug Tracker for Kupu didn’t yield any results, but I could have sworn I saw it mentioned on the mailing list… I’ll keep searching and I’ll let you know if I find anything. Regardless, my recommendation is to just use Firefox so the errors are avoided.

2. The table classes are interesting. While I’ve never used them to my advantage, my guess would be to just find out what class is assigned, and then add your styles in CSS for tables with those class names. You’re right, though, it’s not very intuitive.

3. Yeah, another downer, and I sent an email to the Lenya users list crying that the support for BXE is so much better than Kupu. In BXE, they have a button you press that you can get a list of assets and then it creates the link for you. Not so in Kupu. To do it, all you have to know is that Lenya sets up pages thusly:

* All pages are < document ID >.html
* All pages with assets have a folder at the same level as the HTML file with the name of < document ID >

So, if you have a page called faculty.html, then there’s a folder called faculty in the same level. So, when you create a link to a PDF file you uploaded as an asset, highlight the text you want as the link, go to the right side of Kupu where the Links box is located, and type the following:

< document ID >/< asset name >

So, in our case, if we uploaded a file called listing.pdf, then in the Links box, I would type in:

faculty/listing.pdf

And there you have it.

4. That one I am not sure about, and you would have to post that question on the Lenya user mailing list. What I do know is that often, the editors do not work well together. That’s why at Hiram, I decided we were all using Kupu so that we can avoid any RelaxNG Schema errors.

5. Lenya 1.2.3 is actually only available through SVN, but the official release should be ready within a week or so, according to the release schedule. There is documentation on the Lenya site for installing the SVN release here

Peter - May 2, 2:05am

Thanks heaps Jon.
1. I’ve tried to change whitelisted and blacklisted tags or even comment out some of the validation javascript in ‘kupucontentfilters.js’ or other files… But no success. Have emailed to KUPU’s mailing list, but if you know mentioned workarround or which file’s source to edit to get align=’center’ and align=’right’ saved, would be very helpful :-)

2. – 5. All good, thanks :-)

6. Now am getting headaches from Lucene which is part of Lenya. Have you got this search engine working? I could get index created as described at http://lenya.apache.org/1_2_x/components/search/lucene.html but can’t get the crawl (Java error – Index out of bounds…). Someone pointed at paths problems, so I have tried changing absolute, relative, fwd/ backwd\ slashes – still the same error.
I even noticed Lenya using Google search instead!?

Peter

Jon Linczak - May 4, 7:04pm

Hey Peter,

1. I think the problem you are running into with part 1, at least from what I can remember, is that changes don’t take place right away. You usually have to restart Lenya, or, sometimes, change the source code, then re-make Lenya. I don’t know why that’s the case, but I remember that I couldn’t get any of my changes to show up unless I did one of those two things. You might want to give it a shot and see if that helps.

6. Yeah, I’ve heard a lot of problems crop up with Lucene, and unfortunately, I’d have to say that I’m not an expert in this area because I’ve never used it myself. I opted to use Google search instead since we’re a College and can customize the results for free. Last I heard, there was a bug found in Lucene that the developers needed to fix, but I’m not sure if that was done in time for the 1.2.3 release. You might want to check out BugZilla for Lenya and see if anyone filed a bug for Lucene integration that has yet to be closed. Sorry I couldn’t be more helpful.

Jon

ahmed - Jul 26, 9:05am

Hi everybody ,

Can somebody educate me , in configuring lucene search with lenya 1.4 , i couldn’t get much information on internet search engine .

I would really apprecaite , your thooght .

thanks in advance !!/

With regards

commenting closed for this article

in this site