Ben Langhinrichs

Photograph of Ben Langhinrichs

IBM Champion logo

E-mail address - Ben Langhinrichs







Recent posts

Wed 13 Feb 2019

@MQRY and on-the-fly data retrieval



Mon 11 Feb 2019

Formula language in a JavaScript world: JSON db lookups



Thu 7 Feb 2019

Could working with rich text really be RESTful?


April, 2019
SMTWTFS
 01 02 03 04 05 06
07 08 09 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

Search the weblog





























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.  

Ulrich Krause
Website: http://www.eknori.de/
Twitter: http://twitter.com/eknori


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, "settings.properties")
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:


1008.1. Bruce
(03/11/2011 01:51 AM)

Elguji's IQJam allows for language file manipulations in the Notes client. When the language document is saved the properties file that XPages need to render the labels is generated.

http://iqjam.net


1008.2. 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).