Genii Weblog

Our first winner and all he had to do was complain

Thu 10 Mar 2011, 01:50 PM

by Ben Langhinrichs
I made an offer the day before yesterday: Gripe about XPages and win valuable software.  Today, I'm announcing the first winner, although the offer is still open, of course.  

Inline JPEG imageUlrich Krause

Ulrich suggested a few things, but the idea that definitely made sense to me was this (rephrased since I better understand his point after a follow up email):

The concept to support multiple languages in an XPages based app is great and simple but lacks an easy way to maintain the file resources which hold the language settings. You need to either use Domino Designer or a fairly complex agent to transfer the language information from a normal notes document to the file resource. If there were an easier way to have the language information in the front-end but still leverage the eclipse features for handling the file resources, XPages would be more powerful. 

I thought how best to do this. As with any new feature, I worried about how to make the methods as powerful and general as possible so they could be used for various purposes, while still being easy to use and understand. After a few discarded attempts, I have come up with two methods that are being added to the Midas Rich Text LSX and Midas C++ API for the next version. 

The methods will be part of the GeniiRTItem class, and are GetAsText and SetAsText. The script example below retrieves the string properties from a file resource, copies them into a rich text field where they can be modified, then retrieves them from the rich text field and puts them back into the file resource.  This would work with HTML files, CSS files, themes, etc.  The developer could just as easily copy them into a text field, but rich text works better for large files.

' *** Put the contents of a properties file resource
' *** into a rich text field where it may be modified
' *** and then replace it in the file resource
Dim rtItem As New GeniiRTItem
Dim rtProps As New GeniiRTItem

Call rtItem.CreateBackend(doc.Handle, "Body", True)
Call rtProps.ConnectFileResource(db.Server, db.FilePath, "")
str = rtProps.GetAsText()
Call rtItem.Everything.AppendText(str)

' *** Do whatever processing of rich text that you like

str = rtItem.GetAsText()
Call rtProps.SetAsText(str)
Call rtProps.Save()

Congratulations, Ulrich. For that idea, you win a free 50-user client license for the Midas Rich Text LSX with support and maintenance for a year, a $1500 US value.

Do you have any complaints about XPages? You could be a winner too.

Copyright 2011 Genii Software Ltd.

What has been said:

982.1. Ben Langhinrichs
(03/11/2011 03:28 AM)

Bruce - Doesn't surprise me. It seems like a fairly sensible feature. My goal is simply to make such code easier for others to add, not necessarily to do that which has never been done before (although that might be fun as well).