<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>XPages Wiki of AppliGate</title>
	<atom:link href="http://appligate.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://appligate.wordpress.com</link>
	<description>Wiki for students of AppliGate</description>
	<lastBuildDate>Sun, 01 Jan 2012 12:50:01 +0000</lastBuildDate>
	<language>nl</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='appligate.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/cc25d85a9a5f18b5836d5d4af5be281e?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>XPages Wiki of AppliGate</title>
		<link>http://appligate.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://appligate.wordpress.com/osd.xml" title="XPages Wiki of AppliGate" />
	<atom:link rel='hub' href='http://appligate.wordpress.com/?pushpress=hub'/>
		<item>
		<title>2011 herzien</title>
		<link>http://appligate.wordpress.com/2012/01/01/2011-herzien/</link>
		<comments>http://appligate.wordpress.com/2012/01/01/2011-herzien/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 12:49:58 +0000</pubDate>
		<dc:creator>Rob Bontekoe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://appligate.wordpress.com/?p=900</guid>
		<description><![CDATA[The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog. Here&#8217;s an excerpt: A New York City subway train holds 1,200 people. This blog was viewed about 4.800 times in 2011. If it were a NYC subway train, it would take about 4 trips to carry that many people. Click here to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=appligate.wordpress.com&amp;blog=8977853&amp;post=900&amp;subd=appligate&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog.</p>
<p><a href="/2011/annual-report/"><img src="http://www.wordpress.com/wp-content/mu-plugins/annual-reports/img/emailteaser.jpg" alt="" width="100%" /></a></p>
<p>Here&#8217;s an excerpt:</p>
<blockquote><p>A New York City subway train holds 1,200 people. This blog was viewed about <strong>4.800</strong> times in 2011. If it were a NYC subway train, it would take about 4 trips to carry that many people.</p></blockquote>
<p><a href="/2011/annual-report/">Click here to see the complete report.</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/appligate.wordpress.com/900/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/appligate.wordpress.com/900/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/appligate.wordpress.com/900/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/appligate.wordpress.com/900/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/appligate.wordpress.com/900/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/appligate.wordpress.com/900/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/appligate.wordpress.com/900/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/appligate.wordpress.com/900/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/appligate.wordpress.com/900/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/appligate.wordpress.com/900/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/appligate.wordpress.com/900/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/appligate.wordpress.com/900/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/appligate.wordpress.com/900/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/appligate.wordpress.com/900/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=appligate.wordpress.com&amp;blog=8977853&amp;post=900&amp;subd=appligate&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://appligate.wordpress.com/2012/01/01/2011-herzien/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/386d22db97c9d89432ec625ae3062856?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rob</media:title>
		</media:content>

		<media:content url="http://www.wordpress.com/wp-content/mu-plugins/annual-reports/img/emailteaser.jpg" medium="image" />
	</item>
		<item>
		<title>Reading and Parsing an Atom Feed</title>
		<link>http://appligate.wordpress.com/2011/12/08/reading-and-parsing-an-atom-feed/</link>
		<comments>http://appligate.wordpress.com/2011/12/08/reading-and-parsing-an-atom-feed/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 08:04:42 +0000</pubDate>
		<dc:creator>Rob Bontekoe</dc:creator>
				<category><![CDATA[4. Java]]></category>
		<category><![CDATA[Atom Feed]]></category>
		<category><![CDATA[REST]]></category>

		<guid isPermaLink="false">http://appligate.wordpress.com/?p=890</guid>
		<description><![CDATA[Article copied from December 2011 Clippings. ************************************************************** GURU GUIDANCE ************************************************************** READING AND PARSING AN ATOM FEED By Julian Robichaux, nsftools.com In my previous article, I discussed how to read and parse an RSS feed using Java. In that example, we used standard Java classes to load the feed into an XML parser, and the individual elements [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=appligate.wordpress.com&amp;blog=8977853&amp;post=890&amp;subd=appligate&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignright" style="width: 138px"><a href="http://en.wikipedia.org/wiki/File:Feed-icon.svg"><img class="zemanta-img-inserted zemanta-img-configured" title="English: This icon, known as the &quot;feed ic..." src="http://upload.wikimedia.org/wikipedia/en/thumb/4/43/Feed-icon.svg/128px-Feed-icon.svg.png" alt="English: This icon, known as the &quot;feed ic..." width="128" height="128" /></a><p class="wp-caption-text">Image via Wikipedia</p></div>
<p>Article copied from December 2011 Clippings.</p>
<p>**************************************************************<br />
GURU GUIDANCE<br />
**************************************************************</p>
<p>READING AND PARSING AN ATOM FEED<br />
By Julian Robichaux, <a href="http://nsftools.com/" target="_blank">nsftools.com</a></p>
<p>In my previous article, I discussed how to read and parse an RSS feed using Java. In that example, we used standard Java classes to load the feed into an XML parser, and the individual elements of the feed that were important got extracted as we went through the feed. In this article, we will use a feed parsing library to simplify the task.</p>
<p>Atom feeds are becoming much more common than RSS feeds &#8220;in the wild&#8221;, especially because the Atom feed format is often used to provide REST API functionality for publish/subscribe and document-centric types of operations. The Atom format is also more extensible than RSS, and as such it generally has a lot more elements to sort through when you&#8217;re retrieving information.</p>
<p>Luckily, there are some feed parsing libraries that can remove a lot of the complexity and guesswork (and RFC reading) for you.</p>
<h3>The Two Kinds of Atom Feeds</h3>
<p>There are actually two different kinds of Atom feed formats: The Atom Syndication Format (as described by RFC 4287) and the Atom Publishing Protocol (as described by RFC 5023).</p>
<p>The Syndication Format is more of what most people think of when they talk about &#8220;feeds&#8221; &#8212; like an RSS feed, it is used for listing content like news articles, blog entries, etc. The Publishing Protocol is what is used for REST API applications, where document-type data can be listed, added, edited, and deleted.</p>
<p>In general, with a Syndication feed, you simply read the feed data and you&#8217;re done with it; with a Publishing feed, you can drill down into the data, first pulling the high-level Service feed, and then pulling child Collection feeds (sometimes several levels deep) to get your data.</p>
<p>Good descriptions of both feed formats can be found at the AtomEnabled.org Web site: <a href="http://www.atomenabled.org/developers/syndication" target="_blank">http://www.atomenabled.org/developers/syndication</a> and <a href="http://atomenabled.org/developers/protocol" target="_blank">http://atomenabled.org/developers/protocol</a></p>
<h3>Libraries: ROME, <a class="zem_slink" title="Apache Abdera" href="http://en.wikipedia.org/wiki/Apache_Abdera" rel="wikipedia">Apache Abdera</a>, Apache Wink</h3>
<p>The three major Java libraries I&#8217;ve found and attempted to use for Atom feed parsing are ROME ( <a href="https://rometools.jira.com/wiki/display/ROME/Home" target="_blank">https://rometools.jira.com/wiki/display/ROME/Home</a> ), Apache Abdera ( <a href="http://abdera.apache.org/" target="_blank">http://abdera.apache.org</a> ), and Apache Wink ( <a href="http://incubator.apache.org/wink" target="_blank">http://incubator.apache.org/wink</a> ).</p>
<p>ROME and Apache Abdera both seemed to work well with Notes/Domino 8.5, and both were very easy to use. ROME was smaller in terms of the size of the JAR files and required dependencies, while Abdera had more recent updates.</p>
<p>I was able to make Apache Wink work with XPages, but I consistently got errors trying to use it with script libraries and agents. As a result, I will not show code samples for Wink in this article. However, Niklas Heidloff has a good example of using Wink with XPages on the OpenNTF Web site ( <a href="http://www.openntf.org/p/XPages%20For%20Connections" target="_blank">http://www.openntf.org/p/XPages%20For%20Connections</a> and <a href="http://www.openntf.org/blogs/openntf.nsf/d6plinks/NHEF-8CCDTQ" target="_blank">http://www.openntf.org/blogs/openntf.nsf/d6plinks/NHEF-8CCDTQ</a> ).</p>
<h3>Including the Libraries in Domino</h3>
<p>The first thing you have to do (after choosing a library) is decide how to add the library to your Domino server in such a way that your code can use it. Keep in mind that when I talk about a &#8220;library&#8221; in this sense, it&#8217;s not just a single JAR file. Each of the libraries also has other JAR file dependencies you will need to include, as well.</p>
<p>For XPages, this normally means adding the library files to the WebContent/WEB-INF location in your database. Basic instructions for adding a JAR file to the WEB-INF folder and calling the code from an XPage can be found at <a href="http://www-10.lotus.com/ldd/ddwiki.nsf/dx/reuse_java_xpage.htm" target="_blank">http://www-10.lotus.com/ldd/ddwiki.nsf/dx/reuse_java_xpage.htm</a></p>
<p>For agents, you can import the library files into a script library and then include the script library with your agents. However, if you have permissions to do so on the server (or your Admin is nice enough to do this for you), often the best thing to do is to have the Domino server load the library files on startup and retain it in memory. This will generally give you the best performance because the server won&#8217;t have to reload the JAR files every time they are needed. Your two options for doing this are to add all the JAR files to your Domino server&#8217;s jvm/lib/ext directory, or to put them in an arbitrary directory on the server and use the JavaUserClasses or JavaUserClassesExt notes.ini variables to point to them.</p>
<h3>Reading and Parsing a Syndication Feed</h3>
<p>With that as an intro, on to the examples! Here is sample code for reading and parsing an Atom Syndication feed using both ROME and Apache Abdera:</p>
<pre><strong>ROME</strong>
import lotus.domino.*;
import java.net.URL;
import java.util.Iterator;

import com.sun.syndication.feed.synd.SyndEntry;
import com.sun.syndication.feed.synd.SyndFeed;
import com.sun.syndication.io.SyndFeedInput;
import com.sun.syndication.io.XmlReader;

public class JavaAgent extends AgentBase {
   public void NotesMain() {
     try {
         URL feedUrl = new URL( "<a href="http://www.nsftools.com/blog/blog.xml" target="_blank">http://www.nsftools.com/blog/blog.xml</a>" );
         SyndFeedInput input = new SyndFeedInput();
         SyndFeed feed = input.build(new XmlReader(feedUrl));

         Iterator entryIter = feed.getEntries().iterator();
         while (entryIter.hasNext()) {
             SyndEntry entry = (SyndEntry) entryIter.next();
             System.out.println(entry.getTitle());
         }
     } catch(Exception e) {
         e.printStackTrace();
      }
  }
}
<strong> </strong>
<strong>Abdera</strong>
import lotus.domino.*;
import java.net.URL;
import java.util.Iterator;

import org.apache.abdera.Abdera;
import org.apache.abdera.model.Entry;
import org.apache.abdera.model.Feed;
import org.apache.abdera.parser.Parser;

public class JavaAgent extends AgentBase {
   public void NotesMain() {
     try {
         URL feedUrl = new URL( "<a href="http://www.nsftools.com/blog/blog.xml" target="_blank">http://www.nsftools.com/blog/blog.xml</a>" );
         Abdera abdera = new Abdera();
         Parser parser = abdera.getParser();
         org.apache.abdera.model.Document doc = parser.parse(feedUrl.openStream());
         Feed feed = (Feed) doc.getRoot();

         Iterator entryIter = feed.getEntries().iterator();
         while (entryIter.hasNext()) {
             Entry entry = (Entry) entryIter.next();
             System.out.println(entry.getTitle());
         }
     } catch(Exception e) {
         e.printStackTrace();
      }
  }
}</pre>
<p>You can see that the code in both examples is structured in much the same way: You generate a Feed object by passing in a URL, and then you can iterate through multiple Entry objects inside the feed. While the examples only demonstrate getting the title of the feeds, there are also methods like getAuthor(), getContent(), etc.</p>
<p>Also, in both cases the HTTP transport layer is handled for you, so you don&#8217;t have to worry about the process of actually making the connection to the feed server and retrieving the content.</p>
<h3>Reading and Parsing a Publishing Feed</h3>
<p>Here is some sample code for reading and parsing an Atom Publishing feed using both ROME and Apache Abdera:</p>
<pre><strong>ROME</strong>
import lotus.domino.*;
import java.util.Iterator;

import com.sun.syndication.propono.atom.client.AtomClientFactory;
import com.sun.syndication.propono.atom.client.ClientAtomService;
import com.sun.syndication.propono.atom.client.NoAuthStrategy;
import com.sun.syndication.propono.atom.common.AtomService;
import com.sun.syndication.propono.atom.common.Collection;
import com.sun.syndication.propono.atom.common.Workspace;

import lotus.domino.*;

public class JavaAgent extends AgentBase {
   public void NotesMain() {
     try {
         String endpoint = "<a href="http://quickr.example.com/dm/atom/introspection" target="_blank">http://quickr.example.com/dm/atom/introspection</a>";

         // NOTE: the ROME Propono Atom Service parser is VERY picky about namespaces,
         // and if all the nodes in the feed aren't specifically designated as
         // being in the "<a href="http://www.w3.org/2007/app" target="_blank">http://www.w3.org/2007/app</a>" namespace then the feed
         // parsing will fail.
         ClientAtomService service = AtomClientFactory.getAtomService(endpoint, new NoAuthStrategy());
         Workspace workspace = (Workspace)service.getWorkspaces().get(0);

         Iterator collIter = workspace.getCollections().iterator();
         while (collIter.hasNext()) {
             Collection coll = (Collection) collIter.next();
             System.out.println(coll.getTitle());
         }
     } catch(Exception e) {
         e.printStackTrace();
      }
  }
}
<strong> </strong>
<strong>Abdera</strong>
import lotus.domino.*;
import java.net.URL;
import java.util.Iterator;

import org.apache.abdera.Abdera;
import org.apache.abdera.model.Collection;
import org.apache.abdera.model.Service;
import org.apache.abdera.model.Workspace;
import org.apache.abdera.parser.Parser;

public class JavaAgent extends AgentBase {
   public void NotesMain() {
     try {
         Abdera abdera = new Abdera();
         Parser parser = abdera.getParser();
         URL url = new URL( "<a href="http://quickr.example.com/dm/atom/introspection" target="_blank">http://quickr.example.com/dm/atom/introspection</a>" );

         org.apache.abdera.model.Document doc = parser.parse(url.openStream());
         Service service = (Service) doc.getRoot();
         Workspace workspace = (Workspace)service.getWorkspaces().get(0);

         Iterator collIter = workspace.getCollections().iterator();
         while (collIter.hasNext()) {
             Collection coll = (Collection) collIter.next();
             System.out.println(coll.getTitle());
         }
     } catch(Exception e) {
         e.printStackTrace();
      }
  }
}</pre>
<p>As before, the process is essentially the same with both libraries &#8212; create a Service object from a URL, get the first Workspace in that feed, then iterate through the Collection objects in the Workspace &#8212; although with Abdera, the parsing classes are built-in, while with ROME, there is an additional library called &#8220;Propono&#8221; that also has to be used. You can just include the Propono JAR in the same location that the other ROME-related JARs are stored.</p>
<p>However, I have found the Abdera parser to be much more &#8220;forgiving&#8221; of the incoming feed format than the ROME parser. As noted in the code above, if the Atom feed doesn&#8217;t explicitly use an XML namespace that ROME Propono is looking for, the parsing will fail. I was able to get around this in testing by doing some minor customizations of the ClientAtomService methods, but in practice it&#8217;s often easier just to use Apache Abdera.</p>
<h3>Authentication</h3>
<p>If you have to authenticate with a username and password in order to access a feed, both libraries have support for that as well. Code snippets for how basic authentication works for each library are as follows:</p>
<pre><strong>ROME</strong>
         HttpURLConnection con = (HttpURLConnection)feedUrl.openConnection();
         String encoding = new sun.misc.BASE64Encoder().
           encode( (username + ":" + password).getBytes() );
         con.setRequestProperty ("Authorization", "Basic " + encoding);

         SyndFeedInput input = new SyndFeedInput();
         SyndFeed feed = input.build(new XmlReader(con));
<strong> </strong>
<strong>Abdera</strong>
         AbderaClient client = new AbderaClient(abdera);
         client.usePreemptiveAuthentication(true);
         client.addCredentials("<a href="https://myserver.example.com/" target="_blank">https://myserver.example.com</a>", null, null,
                 new UsernamePasswordCredentials(username, password));
         AbderaClient.registerTrustManager();         response = client.get(feedUrl);
         org.apache.abdera.model.Document doc = parser.parse(response.getInputStream());</pre>
<p>From there, you can plug back into the code from the Syndication examples earlier in this article.</p>
<h3>Performance</h3>
<p>I didn&#8217;t do very much performance testing to compare the two libraries against each other, so I can&#8217;t give an opinion on which one is faster than the other. Unscientifically, they both seemed to have similar performance.</p>
<p>The big performance killer is really just loading the libraries in the first place, because it involves loading several megabytes worth of JAR files into memory before the code can even start running. Script libraries performed poorly, while pre-loading the libraries (either on the classpath or on an XPage) made a huge difference.</p>
<p>Of course, this is also a consideration with using a third-party parsing library like ROME or Abdera, versus retrieving and parsing the feed XML manually like we did in the previous article. Certainly, using fewer libraries and fewer levels of abstraction can sometimes improve performance, especially load-time performance . . . but that&#8217;s the classic tradeoff between ease-of-coding and raw speed. If we were only worried about speed, we&#8217;d still be programming in assembler.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/appligate.wordpress.com/890/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/appligate.wordpress.com/890/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/appligate.wordpress.com/890/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/appligate.wordpress.com/890/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/appligate.wordpress.com/890/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/appligate.wordpress.com/890/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/appligate.wordpress.com/890/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/appligate.wordpress.com/890/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/appligate.wordpress.com/890/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/appligate.wordpress.com/890/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/appligate.wordpress.com/890/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/appligate.wordpress.com/890/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/appligate.wordpress.com/890/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/appligate.wordpress.com/890/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=appligate.wordpress.com&amp;blog=8977853&amp;post=890&amp;subd=appligate&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://appligate.wordpress.com/2011/12/08/reading-and-parsing-an-atom-feed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/386d22db97c9d89432ec625ae3062856?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rob</media:title>
		</media:content>

		<media:content url="http://upload.wikimedia.org/wikipedia/en/thumb/4/43/Feed-icon.svg/128px-Feed-icon.svg.png" medium="image">
			<media:title type="html">English: This icon, known as the &#34;feed ic...</media:title>
		</media:content>
	</item>
		<item>
		<title>JavaScript Special Characters in Regular Expressions</title>
		<link>http://appligate.wordpress.com/2011/06/11/javascript-special-characters-in-regular-expressions/</link>
		<comments>http://appligate.wordpress.com/2011/06/11/javascript-special-characters-in-regular-expressions/#comments</comments>
		<pubDate>Sat, 11 Jun 2011 08:16:23 +0000</pubDate>
		<dc:creator>Rob Bontekoe</dc:creator>
				<category><![CDATA[0. Blog]]></category>
		<category><![CDATA[Regular Expression]]></category>

		<guid isPermaLink="false">http://appligate.wordpress.com/?p=844</guid>
		<description><![CDATA[In our 4-day XP852 – Lotus Domino Designer 8.5.2. Basic XPages Applications course we have examples of how to use JavaScript regular expressions in Custom Converters to remove unnecessary spaces and in Custom Validators to validate an e-mail address. In these regular expression special characters can be used. DevGuru has a web page which explains these characters: http://www.devguru.com/technologies/ecmascript/quickref/regexp_special_characters.html.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=appligate.wordpress.com&amp;blog=8977853&amp;post=844&amp;subd=appligate&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img">
<div class="wp-caption alignright" style="width: 250px"><a href="http://www.flickr.com/photos/99345230@N00/5820604682"><img title="IMG_1027" src="http://farm4.static.flickr.com/3321/5820604682_f74a8f4f35_m.jpg" alt="IMG_1027" width="240" height="180" /></a><p class="wp-caption-text">Image by Oldmaison via Flickr</p></div>
</div>
<p>In our 4-day <span class="Apple-style-span" style="font-size:15px;"><a href="http://rbontekoe.wordpress.com/2010/12/29/xp852-lotus-domino-designer-8-5-2-basic-xpage-applications/" target="_blank">XP852 – Lotus Domino Designer 8.5.2. Basic XPages Applications</a> course we have examples of how to use JavaScript regular expressions in Custom Converters to remove unnecessary spaces and in Custom Validators to validate an e-mail address.</span></p>
<p><span class="Apple-style-span" style="font-size:15px;">In these <a class="zem_slink" title="Regular expression" href="http://en.wikipedia.org/wiki/Regular_expression" rel="wikipedia">regular expression</a> special characters can be used. </span><span class="Apple-style-span" style="font-size:15px;">DevGuru has a web page which explains these characters:</span></p>
<p><span class="Apple-style-span" style="font-size:15px;"><a href="http://www.devguru.com/technologies/ecmascript/quickref/regexp_special_characters.html">http://www.devguru.com/technologies/ecmascript/quickref/regexp_special_characters.html</a>.</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/appligate.wordpress.com/844/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/appligate.wordpress.com/844/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/appligate.wordpress.com/844/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/appligate.wordpress.com/844/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/appligate.wordpress.com/844/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/appligate.wordpress.com/844/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/appligate.wordpress.com/844/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/appligate.wordpress.com/844/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/appligate.wordpress.com/844/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/appligate.wordpress.com/844/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/appligate.wordpress.com/844/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/appligate.wordpress.com/844/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/appligate.wordpress.com/844/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/appligate.wordpress.com/844/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=appligate.wordpress.com&amp;blog=8977853&amp;post=844&amp;subd=appligate&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://appligate.wordpress.com/2011/06/11/javascript-special-characters-in-regular-expressions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/386d22db97c9d89432ec625ae3062856?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rob</media:title>
		</media:content>

		<media:content url="http://farm4.static.flickr.com/3321/5820604682_f74a8f4f35_m.jpg" medium="image">
			<media:title type="html">IMG_1027</media:title>
		</media:content>
	</item>
		<item>
		<title>Google Maps Custom Control</title>
		<link>http://appligate.wordpress.com/2011/06/09/google-maps-custom-control/</link>
		<comments>http://appligate.wordpress.com/2011/06/09/google-maps-custom-control/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 15:44:25 +0000</pubDate>
		<dc:creator>Rob Bontekoe</dc:creator>
				<category><![CDATA[0. Blog]]></category>
		<category><![CDATA[Custom Controls]]></category>
		<category><![CDATA[Google Maps]]></category>

		<guid isPermaLink="false">http://appligate.wordpress.com/?p=835</guid>
		<description><![CDATA[Martin Meijer heeft bij OpenNTF een Custom Control geplaatst waarmee je een Google Maps positie kunt tonen in XPages. Ziet er zeer gaaf uit: http://www.openntf.org/Projects/pmt.nsf/ProjectLookup/Google%20Maps%20Custom%20Control<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=appligate.wordpress.com&amp;blog=8977853&amp;post=835&amp;subd=appligate&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img">
<div class="wp-caption alignright" style="width: 250px"><a href="http://en.wikipedia.org/wiki/File:Sirisinagandla_map.jpg"><img class=" " title="Satellite view of Sirisinagandla in google maps" src="http://upload.wikimedia.org/wikipedia/en/thumb/6/64/Sirisinagandla_map.jpg/300px-Sirisinagandla_map.jpg" alt="Satellite view of Sirisinagandla in google maps" width="240" height="158" /></a><p class="wp-caption-text">Image via Wikipedia</p></div>
</div>
<p>Martin Meijer heeft bij OpenNTF een Custom Control geplaatst waarmee je een Google Maps positie kunt tonen in XPages. Ziet er zeer gaaf uit:</p>
<p><a href="http://www.openntf.org/Projects/pmt.nsf/ProjectLookup/Google%20Maps%20Custom%20Control">http://www.openntf.org/Projects/pmt.nsf/ProjectLookup/Google%20Maps%20Custom%20Control</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/appligate.wordpress.com/835/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/appligate.wordpress.com/835/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/appligate.wordpress.com/835/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/appligate.wordpress.com/835/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/appligate.wordpress.com/835/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/appligate.wordpress.com/835/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/appligate.wordpress.com/835/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/appligate.wordpress.com/835/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/appligate.wordpress.com/835/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/appligate.wordpress.com/835/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/appligate.wordpress.com/835/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/appligate.wordpress.com/835/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/appligate.wordpress.com/835/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/appligate.wordpress.com/835/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=appligate.wordpress.com&amp;blog=8977853&amp;post=835&amp;subd=appligate&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://appligate.wordpress.com/2011/06/09/google-maps-custom-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/386d22db97c9d89432ec625ae3062856?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rob</media:title>
		</media:content>

		<media:content url="http://upload.wikimedia.org/wikipedia/en/thumb/6/64/Sirisinagandla_map.jpg/300px-Sirisinagandla_map.jpg" medium="image">
			<media:title type="html">Satellite view of Sirisinagandla in google maps</media:title>
		</media:content>
	</item>
		<item>
		<title>How to suppress the default XPages CSS stylesheets?</title>
		<link>http://appligate.wordpress.com/2011/05/17/how-to-suppress-the-default-xpages-css-stylesheets/</link>
		<comments>http://appligate.wordpress.com/2011/05/17/how-to-suppress-the-default-xpages-css-stylesheets/#comments</comments>
		<pubDate>Tue, 17 May 2011 07:28:53 +0000</pubDate>
		<dc:creator>Rob Bontekoe</dc:creator>
				<category><![CDATA[2. Additional XPages Techniques]]></category>
		<category><![CDATA[6. Tips]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://appligate.wordpress.com/?p=800</guid>
		<description><![CDATA[XPages load default the next CSS stylesheets: &#60;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;/domjava/xsp/theme/webstandard/xsp.css&#8221;&#62; &#60;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;/domjava/xsp/theme/webstandard/xspLTR.css&#8221;&#62; &#60;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;/domjava/xsp/theme/webstandard/xspIE78.css&#8221;&#62; When you define your own stylesheet for an XPage then still the default ones are loaded. This can cause problems in your application. How to suppress them? Jeroen de Boer one of the students of our [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=appligate.wordpress.com&amp;blog=8977853&amp;post=800&amp;subd=appligate&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>XPages load default the next CSS stylesheets:</p>
<p><small>&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;/domjava/xsp/theme/webstandard/xsp.css&#8221;&gt;</small><br />
<small>&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;/domjava/xsp/theme/webstandard/xspLTR.css&#8221;&gt;</small><br />
<small> &lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;/domjava/xsp/theme/webstandard/xspIE78.css&#8221;&gt;</small></p>
<p><img class="alignright" src="https://lh5.googleusercontent.com/_QQ2pCnb81Gc/TdIZvZEVK9I/AAAAAAAADMs/2pCkxg3YZbI/s800/empty.png" alt="" width="371" height="328" />When you define your own stylesheet for an XPage then still the default ones are loaded. This can cause problems in your application.</p>
<p><strong>How to suppress them?</strong></p>
<p>Jeroen de Boer one of the students of our XPage course came with the next solution:</p>
<p>Define &lt;empty&gt; as default Theme on the XPages tab of the Application Properies.</p>
<p><strong>Want to learn more</strong>?</p>
<p><a href="http://rbontekoe.wordpress.com/2010/12/29/xp852-lotus-domino-designer-8-5-2-basic-xpage-applications/">XP852 &#8211; Lotus Domino Designer 8.5.2 Basic XPage Application</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/appligate.wordpress.com/800/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/appligate.wordpress.com/800/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/appligate.wordpress.com/800/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/appligate.wordpress.com/800/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/appligate.wordpress.com/800/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/appligate.wordpress.com/800/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/appligate.wordpress.com/800/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/appligate.wordpress.com/800/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/appligate.wordpress.com/800/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/appligate.wordpress.com/800/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/appligate.wordpress.com/800/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/appligate.wordpress.com/800/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/appligate.wordpress.com/800/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/appligate.wordpress.com/800/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=appligate.wordpress.com&amp;blog=8977853&amp;post=800&amp;subd=appligate&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://appligate.wordpress.com/2011/05/17/how-to-suppress-the-default-xpages-css-stylesheets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/386d22db97c9d89432ec625ae3062856?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rob</media:title>
		</media:content>

		<media:content url="https://lh5.googleusercontent.com/_QQ2pCnb81Gc/TdIZvZEVK9I/AAAAAAAADMs/2pCkxg3YZbI/s800/empty.png" medium="image" />
	</item>
		<item>
		<title>Simulation @Prompt with dijit.Dialog &#8211; part 2</title>
		<link>http://appligate.wordpress.com/2011/03/31/simulation-prompt-with-dijit-dialog-part-2/</link>
		<comments>http://appligate.wordpress.com/2011/03/31/simulation-prompt-with-dijit-dialog-part-2/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 11:32:41 +0000</pubDate>
		<dc:creator>Rob Bontekoe</dc:creator>
				<category><![CDATA[1. Comparable Domino Techniques]]></category>
		<category><![CDATA[2. Additional XPages Techniques]]></category>
		<category><![CDATA[3. Dojo]]></category>
		<category><![CDATA[@Functions]]></category>
		<category><![CDATA[dijit.Dialog]]></category>

		<guid isPermaLink="false">http://appligate.wordpress.com/?p=748</guid>
		<description><![CDATA[In my previous post you saw an example of how to use dijit.Dialog in a XPages application as a way to ask the user for information. However no input validation was implemented. This post will show you how to display a warning when the user forgets to select a value from the list. To achieve [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=appligate.wordpress.com&amp;blog=8977853&amp;post=748&amp;subd=appligate&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" src="https://lh4.googleusercontent.com/_QQ2pCnb81Gc/TZRJ_RKOfGI/AAAAAAAADE0/um5WQvPIIWk/s800/%40prompt_2.png" alt="" width="422" height="336" />In my <a href="http://appligate.wordpress.com/2011/03/26/simulation-prompt-with-dijit-dialog/">previous post</a> you saw an example of how to use dijit.Dialog in a XPages application as a way to ask the user for information. However no input validation was implemented.</p>
<p>This post will show you how to display a warning when the user forgets to select a value from the list.</p>
<p>To achieve this you have to change the selector.xsp XPage (<a href="http://appligate.wordpress.com/2011/03/26/simulation-prompt-with-dijit-dialog/">discussed in my prevous post</a>) in 4 steps:</p>
<ol>
<li>Add a &#8220;requiredValidator&#8221; validator to the List Box Control;</li>
<li>Define the onclick event of the List Box Control as Partial Update and point to the Link Control;</li>
<li>Make the Link type of the Link Control computed;</li>
<li>Define some dummy code for the  onclick event of the Link Control.</li>
</ol>
<p><strong>Step 1</strong></p>
<ul>
<li>Open the selector.xsp XPage in the Domino Designer;</li>
<li>Select the List Control and open the Properties view;</li>
<li>Select All properties\data\validators -&gt; plus(+)-button and select xp:validateRequired from the list;</li>
<li>Add a  warning message, e.g. Please select a value from the list.</li>
</ul>
<p><strong>Step 2</strong></p>
<ul>
<li>With the List Control still selected, open the Events view and select the <del>onclick</del> onchange event;</li>
<li>In de Server Options box select Partial Update;</li>
<li>Click on the Select Element&#8230; button;</li>
<li>Select link1 from the list and press OK.</li>
</ul>
<p><strong>Step 3</strong></p>
<ul>
<li>Select the Link Control;</li>
<li>In the Properties view select the Link tab;</li>
<li>In the Options box change the Link type to Compute value&#8230; and add the following Server-Side JavaScript code:</li>
</ul>
<pre>var listBox1:com.ibm.xsp.component.xp.XspSelectManyListbox =
       getComponent("listBox1");
if (listBox1.getValue() == null) {
    return "";
} else {
    return "/xPerson.xsp"; // open person form
}</pre>
<p><strong>Step 4</strong></p>
<ul>
<li>The Link Control still selected, open the Events view;</li>
<li>Add the next Server-Side JavaScript dummy code to the onclick event:</li>
</ul>
<pre>var x = null; // somehow you need a statement</pre>
<p>Success</p>
<p><strong>More information</strong></p>
<p><a href="https://rbontekoe.wordpress.com/2010/12/29/xp852-lotus-domino-designer-8-5-2-basic-xpage-applications/">XP852 – Lotus Domino Designer 8.5.2 Basic XPage Applications</a></p>
<h6 class="zemanta-related-title" style="font-size:1em;">Related Articles</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://appligate.wordpress.com/2011/03/26/simulation-prompt-with-dijit-dialog/">Simulation @Prompt with dijit.Dialog</a> (appligate.wordpress.com)</li>
<li class="zemanta-article-ul-li"><a href="http://appligate.wordpress.com/2011/03/23/dijit-dialog-2/">dijit.Dialog</a> (appligate.wordpress.com)</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/appligate.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/appligate.wordpress.com/748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/appligate.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/appligate.wordpress.com/748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/appligate.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/appligate.wordpress.com/748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/appligate.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/appligate.wordpress.com/748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/appligate.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/appligate.wordpress.com/748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/appligate.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/appligate.wordpress.com/748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/appligate.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/appligate.wordpress.com/748/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=appligate.wordpress.com&amp;blog=8977853&amp;post=748&amp;subd=appligate&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://appligate.wordpress.com/2011/03/31/simulation-prompt-with-dijit-dialog-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/386d22db97c9d89432ec625ae3062856?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rob</media:title>
		</media:content>

		<media:content url="https://lh4.googleusercontent.com/_QQ2pCnb81Gc/TZRJ_RKOfGI/AAAAAAAADE0/um5WQvPIIWk/s800/%40prompt_2.png" medium="image" />
	</item>
		<item>
		<title>Simulation @Prompt with dijit.Dialog</title>
		<link>http://appligate.wordpress.com/2011/03/26/simulation-prompt-with-dijit-dialog/</link>
		<comments>http://appligate.wordpress.com/2011/03/26/simulation-prompt-with-dijit-dialog/#comments</comments>
		<pubDate>Sat, 26 Mar 2011 22:30:22 +0000</pubDate>
		<dc:creator>Rob Bontekoe</dc:creator>
				<category><![CDATA[1. Comparable Domino Techniques]]></category>
		<category><![CDATA[2. Additional XPages Techniques]]></category>
		<category><![CDATA[3. Dojo]]></category>
		<category><![CDATA[@Functions]]></category>
		<category><![CDATA[dijit.Dialog]]></category>
		<category><![CDATA[Lotus Notes]]></category>

		<guid isPermaLink="false">http://appligate.wordpress.com/?p=705</guid>
		<description><![CDATA[In a recent XPages project we needed to simulate the @Prompt function where the user could select a company from a list before a new XPage contact form was opened. Some essential company data had to be put in corresponding fields on the contact form automatically. We used the dijit.Dialog widget to simulate more or [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=appligate.wordpress.com&amp;blog=8977853&amp;post=705&amp;subd=appligate&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignright" style="width: 330px"><img src="https://lh3.googleusercontent.com/_QQ2pCnb81Gc/TY7-7gauUdI/AAAAAAAADEc/ySLDxWjgiN4/s800/%40prompt.png" alt="" width="320" height="335" /><p class="wp-caption-text">Using dijit.Dialog in our Disney Employee application</p></div>
<p>In a recent XPages project we needed to simulate the @Prompt function where the user could select a company from a list before a new XPage contact form was opened. Some essential company data had to be put in corresponding fields on the contact form automatically.</p>
<p>We used the dijit.Dialog widget to simulate more or less the look and feel of the @Prompt function.</p>
<p>How did we achieved this?</p>
<p><strong>Step 1</strong></p>
<p>Create a Notes View (e.g. Companies) consisting of two columns. The first (sorted) column contains the data you want to be displayed in list. The second column contains the return value when the user selects a company, in our case the Document UniqueID. Use the next column formula:</p>
<pre>@Text(@DocumentUniqueID)</pre>
<p><strong>Step 2</strong></p>
<p>Create an XPage with a View Control containing the contact info.</p>
<p>Add a Button Control to the page to enable the user to add a new contact. Add the following Client-Side JavaScript code to the onclick event:</p>
<pre>// URL XPage with the List Box Control
var url = "http://server01/xpages/Test.nsf/selector.xsp";

var dialog = new dijit.Dialog({
 title: "New Contact",
 content: "&lt;iframe src='" + 
        url +
        "' height='250' width='380' frameborder='0' scrolling='no'&gt;",
 style: "width: 400px;"
});
dialog.show();</pre>
<p>Modify the XPage properties:</p>
<ul>
<li>All properties\basics\resources -&gt; plus(+)-button -&gt; dojoModule\name -&gt; dijit.Dialog</li>
</ul>
<ul>
<li>All properties\dojo\dojoTheme -&gt; true</li>
</ul>
<p><strong>Step 3</strong></p>
<p>Create a XPage (e.g. selector.xsp) which can be used in the dijit.Dialog box. This XPage contains the next Controls:</p>
<ul>
<li>Label Control</li>
<li>List Box Control (height: 180, width 350)</li>
<li>Link Control</li>
</ul>
<p><strong>Label Control:</strong> add instructions for the user (e.g. Select a company).</p>
<p><strong>List Box Control:</strong> add the next value formula (on the Value tab -&gt; Add Formula Item..):</p>
<pre>var columnNbrCompany = 1;
var columnNbrUNID = 2;
@DbColumn(@DbName(), "Companies", columnNbrCompany) + "|" +
        @DbColumn(@DbName(), "Companies", columnNbrUNID);</pre>
<p><strong>Link Control:</strong> change the label of the link (e.g. Continue) and add the next Server-Side JavaScript code to the <del>onclick</del> onchange event:</p>
<pre>var listBox1:com.ibm.xsp.component.xp.XspSelectManyListbox =
         getComponent("listBox1");
sessionScope.put("value", listBox1.getValue());  // store documentUNID</pre>
<p>Also change the properties of the Link Control into (Options box of the Link tab):</p>
<ul>
<li>Link type: Open Page</li>
<li>XPage: contact (the XPage contact form, eg. contact.xsp)</li>
<li>Window behavior (computed): return &#8220;_top&#8221;;</li>
</ul>
<p><strong>Step 4</strong></p>
<p>Create the XPages contact form (e.g. contact.xsp). Populate the XPage with the needed fields, including the fields for the company data. Add the next Server-Side JavaScript code to the afterPageLoad event of the XPage.</p>
<pre>var value = sessionScope.get("value");  // get documentUniqueId

var doc:NotesDocument = database.getDocumentByUNID(value);  // open the document
var name:string = doc.getItemValueString("Name"); // get the company name
var inputText1:com.ibm.xsp.component.xp.XspInputText =
        getComponent("inputText1"); // create a handle to the control
inputText1.setValue(name); // set the company name</pre>
<p><strong>Want to learn more:</strong></p>
<p><a href="http://rbontekoe.wordpress.com/2010/12/29/xp852-lotus-domino-designer-8-5-2-basic-xpage-applications/">XP852 – Lotus Domino Designer 8.5.2 Basic XPage Applications</a></p>
<div id="_mcePaste" class="mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">corresponding</div>
<h6 class="zemanta-related-title" style="font-size:1em;">Related Articles</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://appligate.wordpress.com/2011/03/31/simulation-prompt-with-dijit-dialog-part-2/">Simulation @Prompt with dijit.Dialog &#8211; part 2</a> (appligate.wordpress.com)</li>
<li class="zemanta-article-ul-li"><a href="http://appligate.wordpress.com/2011/03/23/dijit-dialog-2/">dijit.Dialog</a> (appligate.wordpress.com)</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/appligate.wordpress.com/705/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/appligate.wordpress.com/705/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/appligate.wordpress.com/705/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/appligate.wordpress.com/705/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/appligate.wordpress.com/705/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/appligate.wordpress.com/705/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/appligate.wordpress.com/705/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/appligate.wordpress.com/705/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/appligate.wordpress.com/705/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/appligate.wordpress.com/705/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/appligate.wordpress.com/705/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/appligate.wordpress.com/705/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/appligate.wordpress.com/705/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/appligate.wordpress.com/705/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=appligate.wordpress.com&amp;blog=8977853&amp;post=705&amp;subd=appligate&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://appligate.wordpress.com/2011/03/26/simulation-prompt-with-dijit-dialog/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/386d22db97c9d89432ec625ae3062856?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rob</media:title>
		</media:content>

		<media:content url="https://lh3.googleusercontent.com/_QQ2pCnb81Gc/TY7-7gauUdI/AAAAAAAADEc/ySLDxWjgiN4/s800/%40prompt.png" medium="image" />
	</item>
		<item>
		<title>dijit.Dialog</title>
		<link>http://appligate.wordpress.com/2011/03/23/dijit-dialog-2/</link>
		<comments>http://appligate.wordpress.com/2011/03/23/dijit-dialog-2/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 11:32:42 +0000</pubDate>
		<dc:creator>Rob Bontekoe</dc:creator>
				<category><![CDATA[3. Dojo]]></category>
		<category><![CDATA[dijit.Dialog]]></category>

		<guid isPermaLink="false">http://appligate.wordpress.com/?p=663</guid>
		<description><![CDATA[ROC Mondriaan is developing a new XPage application for the Ronde om Texel. In the application the content of a PDF, the Notice of Race, has to be displayed to the user who can agree or disagree to it. As a solution the dijit.Dialog control can be used. In the example below the code is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=appligate.wordpress.com&amp;blog=8977853&amp;post=663&amp;subd=appligate&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" src="https://lh4.googleusercontent.com/_QQ2pCnb81Gc/TYnlO0ITtbI/AAAAAAAADEA/ycVxM2KIHu4/s400/dijitDialog.png" alt="" width="400" height="260" />ROC Mondriaan is developing a new XPage application for the Ronde om  Texel. In the application the content of a PDF, the Notice of Race, has to be displayed to the user who can agree or disagree to it.</p>
<p>As a solution the dijit.Dialog control can be used.</p>
<p>In the example below the code is placed in the onclick event of a Button Control.  In the code there are two callback function defined who modify the content of a Edit Box Control on the XPage.</p>
<p>In the XPages All Properties:</p>
<ul>
<li>basics\resources: define a dojoModule with the name dijit.Dialog</li>
</ul>
<ul>
<li>dojo: define the dojoForm, dojoParseOnLoad and dojoTheme properties as true</li>
</ul>
<p>You have to replace &#8220;PUT HERE AN IFRAME TAG WITH URL TO PDF&#8221; by a &lt;iframe&gt;-tag with the next attributes: src=&#8217;URL_PDF&#8217;, height=&#8217;500&#8242;, width=&#8217;780&#8242; and  frameborder=&#8217;0&#8242;.</p>
<pre>var dialog = new dijit.Dialog({
 title: "Confirmation Notice of Race",
 content: "PUT HERE AN IFRAME TAG WITH URL TO PDF" +
 "&lt;br/&gt;&lt;br/&gt;&lt;p style='font-weight: bold'&gt;Have you read the NOR and do you agree?&lt;/p&gt;" +
 "&lt;input id='b1' type='button' value='Yes' /&gt;" +
 "&lt;input id='b2' type='button' value='No' /&gt;",
 style: "width: 800px;"
});

dojo.style(dialog.closeButtonNode, "visibility", "hidden");

var handle1 = dojo.connect(dojo.byId("b1"), "onclick", function(){
 // Your Client-side JavaScript code
 dojo.byId("#{id:inputText1}").value = "yes";

 dialog.hide();
 dialog.destroy();
 dojo.disconnect(handle1);
});

var handle2 = dojo.connect(dojo.byId("b2"), "onclick", function(){
 // Your Client-side JavaScript code
 dojo.byId("#{id:inputText1}").value = "no";

 dialog.hide();
 dialog.destroy();
 dojo.disconnect(handle2);
});dialog.show();</pre>
<p><strong>Want to learn more:</strong></p>
<p><a href="http://rbontekoe.wordpress.com/2010/12/29/xp852-lotus-domino-designer-8-5-2-basic-xpage-applications/">XP852 – Lotus Domino Designer 8.5.2 Basic XPage Applications</a></p>
<h6 class="zemanta-related-title" style="font-size:1em;">Related Articles</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://appligate.wordpress.com/2011/03/26/simulation-prompt-with-dijit-dialog/">Simulation @Prompt with dijit.Dialog</a> (appligate.wordpress.com)</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/appligate.wordpress.com/663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/appligate.wordpress.com/663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/appligate.wordpress.com/663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/appligate.wordpress.com/663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/appligate.wordpress.com/663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/appligate.wordpress.com/663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/appligate.wordpress.com/663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/appligate.wordpress.com/663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/appligate.wordpress.com/663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/appligate.wordpress.com/663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/appligate.wordpress.com/663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/appligate.wordpress.com/663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/appligate.wordpress.com/663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/appligate.wordpress.com/663/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=appligate.wordpress.com&amp;blog=8977853&amp;post=663&amp;subd=appligate&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://appligate.wordpress.com/2011/03/23/dijit-dialog-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/386d22db97c9d89432ec625ae3062856?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rob</media:title>
		</media:content>

		<media:content url="https://lh4.googleusercontent.com/_QQ2pCnb81Gc/TYnlO0ITtbI/AAAAAAAADEA/ycVxM2KIHu4/s400/dijitDialog.png" medium="image" />
	</item>
		<item>
		<title>dijit.form.ValidationTextBox</title>
		<link>http://appligate.wordpress.com/2011/02/23/dijit-form-validationtextbox/</link>
		<comments>http://appligate.wordpress.com/2011/02/23/dijit-form-validationtextbox/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 15:20:55 +0000</pubDate>
		<dc:creator>Rob Bontekoe</dc:creator>
				<category><![CDATA[3. Dojo]]></category>
		<category><![CDATA[Input Validation]]></category>
		<category><![CDATA[Regular Expression]]></category>
		<category><![CDATA[ValidationTextBox]]></category>

		<guid isPermaLink="false">http://appligate.wordpress.com/?p=639</guid>
		<description><![CDATA[In our 4-days XPages course we look at the several possible input validation strategies, client-side and server-side. One of the students, Oscar Bout,  expert on Dojo told me he was missing the client-side Dojo strategy using the dijit.form.ValidationTextBox control in combination with and dojo.form.Form. We tried his code which gaves the error popup as shown [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=appligate.wordpress.com&amp;blog=8977853&amp;post=639&amp;subd=appligate&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignleft" style="width: 397px"><img src="https://lh3.googleusercontent.com/_QQ2pCnb81Gc/TWUaeAnZKfI/AAAAAAAAC_4/gFm3cuOdQsc/s800/fig64.png" alt="" width="387" height="65" /><p class="wp-caption-text">Fig 1. Error message is shown when user type wrong Dutch zip code</p></div>
<p>In our <a href="http://rbontekoe.wordpress.com/2010/12/29/xp852-lotus-domino-designer-8-5-2-basic-xpage-applications/" target="_blank">4-days XPages course</a> we look at the several possible input validation strategies, client-side and server-side.</p>
<p>One of the students, Oscar Bout,  expert on Dojo told me he was missing the client-side Dojo strategy using the dijit.form.ValidationTextBox control in combination with and dojo.form.Form.</p>
<p>We tried his code which gaves the error popup as shown in fig. 1</p>
<p><strong>How to implement this?</strong></p>
<ol>
<li>Select the Edit Box Control and select All Properties\dojo \dojoType and enter dijit.form.ValidationTextBox;</li>
<li>Select All Properties \ Dojo \ dojoAttributes and click 3 time on the + button to create three attributes (see fig 2):
<ol>
<li>Dojo attribute 1: name: invalidMessage, value: your error message</li>
<li>Dojo attribute 2: name: required, value: true</li>
<li>Dojo attribute 3: name: regExp, value (your regular expression to test the input):<br />
[0-9]{4}[ a-zA-Z][a-zA-Z]{1,2}</li>
</ol>
</li>
<li>Select the XPage and select All Properties\dojo and enter the next values (see fig 3):
<ol>
<li>dojoForm: true</li>
<li>dojoParseOnLoad: false</li>
<li>dojoThemo: true</li>
</ol>
</li>
</ol>
<div class="mceTemp" style="text-align:left;">
<dl class="wp-caption alignleft">
<dt class="wp-caption-dt"><img src="https://lh3.googleusercontent.com/_QQ2pCnb81Gc/TWUg4ck068I/AAAAAAAADAE/1Lr-dAeSf7M/s800/fig65.png" alt="" width="386" height="275" /></dt>
<dd class="wp-caption-dd">fig2. dijit.form.ValidationTextBox</dd>
</dl>
</div>
<div class="mceTemp" style="text-align:left;">
<dl class="wp-caption alignleft">
<dt class="wp-caption-dt"><img src="https://lh6.googleusercontent.com/_QQ2pCnb81Gc/TWUhAzplqKI/AAAAAAAADAM/PdKYo4o8omo/s800/fig66.png" alt="" width="271" height="78" /></dt>
<dd class="wp-caption-dd">fig 3. XPages dojo form value</dd>
</dl>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/appligate.wordpress.com/639/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/appligate.wordpress.com/639/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/appligate.wordpress.com/639/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/appligate.wordpress.com/639/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/appligate.wordpress.com/639/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/appligate.wordpress.com/639/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/appligate.wordpress.com/639/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/appligate.wordpress.com/639/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/appligate.wordpress.com/639/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/appligate.wordpress.com/639/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/appligate.wordpress.com/639/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/appligate.wordpress.com/639/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/appligate.wordpress.com/639/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/appligate.wordpress.com/639/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=appligate.wordpress.com&amp;blog=8977853&amp;post=639&amp;subd=appligate&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://appligate.wordpress.com/2011/02/23/dijit-form-validationtextbox/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/386d22db97c9d89432ec625ae3062856?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rob</media:title>
		</media:content>

		<media:content url="https://lh3.googleusercontent.com/_QQ2pCnb81Gc/TWUaeAnZKfI/AAAAAAAAC_4/gFm3cuOdQsc/s800/fig64.png" medium="image" />

		<media:content url="https://lh3.googleusercontent.com/_QQ2pCnb81Gc/TWUg4ck068I/AAAAAAAADAE/1Lr-dAeSf7M/s800/fig65.png" medium="image" />

		<media:content url="https://lh6.googleusercontent.com/_QQ2pCnb81Gc/TWUhAzplqKI/AAAAAAAADAM/PdKYo4o8omo/s800/fig66.png" medium="image" />
	</item>
		<item>
		<title>LS11 &#8211; AD116 XPages Extension Library: Making Application Development Even Easier</title>
		<link>http://appligate.wordpress.com/2011/02/14/ls11-ad116-xpages-extension-library-making-application-development-even-easier/</link>
		<comments>http://appligate.wordpress.com/2011/02/14/ls11-ad116-xpages-extension-library-making-application-development-even-easier/#comments</comments>
		<pubDate>Mon, 14 Feb 2011 10:37:25 +0000</pubDate>
		<dc:creator>Rob Bontekoe</dc:creator>
				<category><![CDATA[5. Libraries]]></category>
		<category><![CDATA[XPages Extention Library]]></category>

		<guid isPermaLink="false">http://appligate.wordpress.com/?p=635</guid>
		<description><![CDATA[Slide share presentatie over XPages Extention Library gegeven op Lotusphere 2011: http://www.slideshare.net/pdhannan/ad116-01<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=appligate.wordpress.com&amp;blog=8977853&amp;post=635&amp;subd=appligate&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Slide share presentatie over XPages Extention Library gegeven op Lotusphere 2011: <a href="http://www.slideshare.net/pdhannan/ad116-01" target="_blank">http://www.slideshare.net/pdhannan/ad116-01</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/appligate.wordpress.com/635/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/appligate.wordpress.com/635/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/appligate.wordpress.com/635/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/appligate.wordpress.com/635/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/appligate.wordpress.com/635/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/appligate.wordpress.com/635/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/appligate.wordpress.com/635/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/appligate.wordpress.com/635/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/appligate.wordpress.com/635/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/appligate.wordpress.com/635/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/appligate.wordpress.com/635/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/appligate.wordpress.com/635/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/appligate.wordpress.com/635/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/appligate.wordpress.com/635/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=appligate.wordpress.com&amp;blog=8977853&amp;post=635&amp;subd=appligate&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://appligate.wordpress.com/2011/02/14/ls11-ad116-xpages-extension-library-making-application-development-even-easier/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/386d22db97c9d89432ec625ae3062856?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rob</media:title>
		</media:content>
	</item>
	</channel>
</rss>
