tag:blogger.com,1999:blog-10901561575905833102008-09-23T15:06:04.726+02:00Web 2.0 & DominoHow to implement Ajax and other Web 2.0 solutions in Lotus Notes/Domino.<br/>
<a href="http://dominoweb.blogspot.com"><img src="http://photos1.blogger.com/blogger2/6158/133075702830881/400/fr.gif" alt="version francaise" border="0" /> Version française</a>Philippe GAUVINhttp://www.blogger.com/profile/12499706055358952821noreply@blogger.comBlogger16125tag:blogger.com,1999:blog-1090156157590583310.post-39496847507325323652007-04-21T10:00:00.000+02:002007-04-21T10:29:17.691+02:00TIPS - Warning before navigate away from a web form without saveMy users often click on a link or change page when they fill a form without save it before. Then, they lose all the informations.<br /><br />With Lotus Notes client they have to confirm to exit the page. You can do the same thing on Web.<br /><br /><img id="BLOGGER_PHOTO_ID_5052504532568226738" style="DISPLAY: block; MARGIN: 0px auto 10px; TEXT-ALIGN: center" alt="" src="http://bp1.blogger.com/_yi4tWEd8Ewk/Rh4aGmHHu7I/AAAAAAAAAB0/Gwh9d3Z5MFs/s400/avertissement.jpg" border="0" /><br /><br /><strong><span style="color:#cc6600;">When to display the warning message ?<br /></span></strong>I prefer display the message only if the user have change the form. If you display the warning every time, the user will finish to ignore it. To detect if the form has been changed, I use an hidden field who his value is changed when one field of the form is changed:<br /><pre class="code"><code><input type="hidden" name="isChanged" id="isChanged" value="0"></code></pre><br />To modifiy the value of this field I use javascript function. You can declare this function on the header of your form (or subform) or in Javascript library. This function can looks like that :<pre class="code"><code>function formChange(){<br /> document.forms[0].isChanged.value="1";<br />}</code></pre><br />You just have to add a call to this function on the "onChange" event of the fields you want to control.<img id="BLOGGER_PHOTO_ID_5052504768791428034" style="DISPLAY: block; MARGIN: 0px auto 10px; TEXT-ALIGN: center" alt="" src="http://bp0.blogger.com/_yi4tWEd8Ewk/Rh4aUWHHu8I/AAAAAAAAAB8/wSFRLHiUqz0/s400/onchange.jpg" border="0" /><br />How to detect the user navigate away ?<br />To detect if a user navigate away the web page, you have to add the event onBeforeUnload. To do that, add to the header of our Notes form :<pre class="code"><code>window.onbeforeunload = confirmExit;</code></pre><br />Where confirmExit is a Javascript function who control if it's necessary to display the warning and where you can customize the message.<pre class="code"><code>function confirmExit() {<br /> if(document.forms[0].isChanged.value=='1') <br /> return "You've not save the form. Are you sure ?";<br />}</code></pre><br />The first condition verify the hidden field of control to know if the form has been changed.Philippe GAUVINhttp://www.blogger.com/profile/12499706055358952821noreply@blogger.com7tag:blogger.com,1999:blog-1090156157590583310.post-34987450958588928672006-10-25T21:23:00.000+02:002006-10-25T21:30:48.310+02:00LINK - Example of website on Lotus Domino who used Lightbox and Smooth SlideshowAfter a long silence, I come back slowly with the presentation of a Lotus Domino Web Site who used some technics prensented in this blog.<br /><br />The new web site of this company specialized on instrumentation integer <a href="http://webdomino.blogspot.com/2006/09/ajax-photo-library-2nd-part-how-to-zoom.html">litghtbox</a> and <a href="http://webdomino.blogspot.com/2006/09/ajax-photo-library-1st-part-how-to.html">Smooth Slideshow</a> : <a href="http://www.soldatagroup.com/">Sol Data web site</a><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger2/6158/133075702830881/1600/web-soldata.0.gif"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger2/6158/133075702830881/400/web-soldata.0.png" alt="" border="0" /></a>Philippe GAUVINhttp://www.blogger.com/profile/12499706055358952821noreply@blogger.com0tag:blogger.com,1999:blog-1090156157590583310.post-2811263402659426522006-09-14T22:15:00.000+02:002006-09-14T22:42:43.197+02:00TIPS - How to force font style of Lotus Notes rich text items on WebI hate web site where text font changes between pages. It's possible to control graphical chart on public web sites but it's impossible with Intranet applications. If we define default font on rich text field, the users can change it. They just have to copy/paste Word document or Web Page in rich text to lose default font property.<br /><br />Fortunately, Lotus Domino uses "old" html tag to change font properties : <font>. I don't use any more this font since CSS style sheet. If you redefine the properties of this tag in a CSS style sheet, you can bypass text font arguments passed by Lotus Domino and then force your text font properties for all the informations in rich text field.<br /><br />For example if I define style :<pre class="code"><code><style><br />font {<br />font-family : tahoma, arial, helvetica, sans-serif;<br />font-size : 1em;<br />}<br /></style></code> </pre>All the content of the rich text will be display in tahoma 1em. The user can add bold or italic but if he defines bigger size font, the content of the text will be display on Web in 1em, no more.<br /><br />With this method you force font properties of all <font> tag of your document. If you want to restrict the effect to only one rich text field only, you just have to embedded it in div with specific class name :<br /><pre class="code"><code><div class="mybody"><br />Richtext field<br /></div></code></pre>Then style sheet will look like this:<br /><pre class="code"><code><</code><code>style</code><code>><br /></code><code>#mybody font {<br />font-family : georgia, "Times New Roman", Times, Roman, serif;<br />font-size : 12px;<br />}<br /></code><code><</code><code>/style</code><code>></code></pre>Philippe GAUVINhttp://www.blogger.com/profile/12499706055358952821noreply@blogger.com2tag:blogger.com,1999:blog-1090156157590583310.post-39984358686987844522006-09-14T21:54:00.000+02:002006-09-14T22:15:10.426+02:00GOOGLE API - Another tips with Google MapsI've discovered two new functions in google maps api release 2 : Geographical localisation from postal address and multitab info box.<br /><br /><span style="font-weight: bold; color: rgb(204, 102, 0);">Geographical localisation with Google API</span><br /><br />In one of my first entries in this blog I've describe a method to <a href="http://webdomino.blogspot.com/2006/08/google-api-how-to-search-informations.html">search geographical localisation from postal address</a>. This method had two problems for me :<br /><ol><li>I must separate each element of my postal address (street, town and country)</li><li>I'm not sure this service will be available during long time</li></ol>Google Maps API offers the solution with <a href="http://www.google.com/apis/maps/documentation/#Geocoding_Examples">Geocoder</a>.<br /><br />One of the most simple solution to extract longitude and latitude is to use it thru http call like this :<br /><pre class="code">http://maps.google.com/maps/geo?q=adresse+recherchee&output=csv&key=abcdefg</pre>Where :<br /><ul><li>q= : postal address to search. For example : waterloo+bridge+london</li><li>output= : file format to send response. You can choose xml, kml, json or csv. The csv format is the most simple.</li><li>key= : your Google Maps API key</li></ul><br />CSV format response send four values : code status (200 if all is good), zoom level, latitude and logitude.<br /><br /><span style="font-weight: bold; color: rgb(204, 102, 0);">Multi tabs info box</span><br /><br />If you want to display information box with multiple tabs, you just have to replace the call <span style="font-style: italic;">marker.openInfoWindowHtml(bulle);</span>, like I've described it in a <a href="http://webdomino.blogspot.com/2006/08/google-api-lotus-notes-google-maps.html">precedent article</a>, by <span style="font-style: italic;">marker.openInfoWindowTabsHtml(infoTabs); </span>where infoTabs is defined like this :<br /><pre class="code"><code>var infoTabs = [<br />new GInfoWindowTab("Tab1 title", "Content of tab 1"),<br />new GInfoWindowTab("Tab2 title", "Content of tab 2")<br />];</code></pre>Philippe GAUVINhttp://www.blogger.com/profile/12499706055358952821noreply@blogger.com0tag:blogger.com,1999:blog-1090156157590583310.post-33336047597385395702006-09-10T22:18:00.000+02:002006-09-10T22:57:24.589+02:00AJAX - Photo library (2nd Part) : How to zoom on a photoA new Javascript Library is used more and more on Web 2.0 sites : Lightbox. This AJAX library, based on prototype.js and scriptaculous, display effect to zoom from a thumbnail. For example, you can find this functionality on <a href="http://beta.zooomr.com/">Zoomr</a>.<br /><br /><img style="margin: 0px auto 10px; display: block; text-align: center;" src="http://photos1.blogger.com/blogger/366/1667/400/lightbox.jpg" alt="" border="0" /><br /><span style="font-weight: bold; color: rgb(204, 102, 0);">How to install the javascript library</span><br /><ol><li>to download the javascript library on <a href="http://www.huddletogether.com/projects/lightbox2/">http://www.huddletogether.com/projects/lightbox2/</a></li><li>to uncompress the zip file</li><li>to add protoype.js, scriptaculous.js, effect.js, lightbox.js and lightbox.css files in shared resources library of your Lotus Notes Database</li><li>to add close.gif, loading.gif, blank.gif in shared pictures resources of your Lotus Notes database. You can added this other pictures too but it's not necessary in this example.</li></ol><span style="font-weight: bold; color: rgb(204, 102, 0);">How to use LightBox Javascript library with Lotus Notes</span><br />The first step is to declare javascript files on your web page. This web page can be a form or Lotus Notes page. The HTML header content looks like :<br /><pre class="code"><code>"<link rel=\"stylesheet\"<br />type=\"text/css\" href=\"lightbox.css\"<br />media=\"screen\" title=\"Normal\" /><br /><script src="\" type="\"><br /></script><br /><script src="\" type="\"><br /></script><br /><script src="\" type="\"><br /></script>"</code></pre>Be careful with the path of your javascript files.<br /><br />Add an Onload event :<br /><pre class="code"><code>initLightbox();</code></pre>Your form or page is ready to use lightbox. To add photo in your web page you have to add in the content of your web page :<br /><pre class="code"><code><a href="path_of_the_big_picture" rel="lightbox"><br /><img src="path_of_the_thumbnail_picture" /><br /></a></code></pre><span style="font-weight: bold; color: rgb(204, 102, 0);">Download an example</span><br />You can dowload an Lotus Notes Database who show how to implement lightbox library with Domino. This application is very simple and in english.<br /><br /><a href="http://free.dominoserver.de/it/dominoweb.nsf/dw_ajax_photos_en.zip" onclick="javascript:urchinTracker('/download/galerie');"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/366/1667/400/lightboxzoo.jpg" alt="" border="0" />download the database</a>Philippe GAUVINhttp://www.blogger.com/profile/12499706055358952821noreply@blogger.com2tag:blogger.com,1999:blog-1090156157590583310.post-4768681938841761452006-09-10T21:39:00.000+02:002006-09-10T22:17:36.514+02:00AJAX - Photo library (1st Part) : How to display a slideshow without FlashAfter summer holiday, it's time to show photos to all the family. This article and the next present how to use AJAX libraries to add effects on photo without using Flash. This first part show how to integer a slideshow, the next how to zoom on photo with the actual very famous library lightbox.<br /><br /><a href="http://free.dominoserver.de/it/dominoweb.nsf/slide"><img style="margin: 0px auto 10px; display: block; text-align: center;" src="http://photos1.blogger.com/blogger/366/1667/400/diapo1.jpg" alt="" border="0" /></a><br /><span style="font-weight: bold; color: rgb(204, 102, 0);">Jonathan Shemoul's </span><span style="font-weight: bold; color: rgb(204, 102, 0);">Smooth SlideShow</span><br /><a href="http://smoothslideshow.jondesign.net/">The Jonathan Shemoul's Smooth Slideshow</a> javascript library allow to display animated splash screen or header to your web Site. This library uses protoype.js and moo.fx. The total file size of this library (without pictures) is around 21,6 kB. To compare with Flash solution, <a href="http://www.estvideo.com/dew/index/2005/08/15/514-dewslider-20-le-retour-des-diaporamas-en-flash">dewsliders</a> (famous french flash picture slideshow) use 30,4 kB. I don't want to compare this two solutions because I don't know Flash. The choice of this javascript library is motivated by the target of this blog, how to implement AJAX solution with Lotus Domino.<br /><br /><span style="color: rgb(204, 102, 0); font-weight: bold;">Installation of the library</span><br />To use the library you must first <a href="http://smoothslideshow.jondesign.net/">download the files</a>. Extract the files from the zip file. Add the files in shared resources of your database :<br /><ul><li>moo.fx.js </li><li>moo.fx.pack.js </li><li>protoype.lite.js </li><li>showcase.slideshow.js </li><li>timed.slideshow.js </li><li>jd.slideshow.css</li></ul><span style="font-weight: bold; color: rgb(204, 102, 0);">How to use the library</span><br />To use the library you must :<br /><ul><li>to declare javascript library ans css style sheet in the header of your web page</li><li>to declare the pictures files to display in the slideshow</li><li>to custommize the size of the slideshow</li><li>to define where to display the slideshow in your web page</li></ul>The pictures to display is define thru a javascript array like this :<pre class="code"><code>mySlideData[countArticle++] = new Array(<br />'picture1.jpg',<br />'linkedwebpage1.html',<br />'Item 1 Title',<br />'Item 1 Description'<br />);</code></pre><span style="font-weight: bold; color: rgb(204, 102, 0);">How to use it in Lotus Notes database</span><br />To manage easily the photo to display in my slideshow, I use a form to record each pictures. This form have the fields :<br /><ul><li>Title : text field<br /></li><li>Link : text field</li><li>Description : text field</li><li>Photo : rich-text field<br /></li></ul>I define a view to display this documents. This view will be called by the javascript to define the array. Then I specify the formula of my second column like this :<pre class="code"><code>"mySlideData[countArticle++] = new Array('"<br />+ "0/" + @Text(@DocumentUniqueID) + "/$file/"<br />+ @subset(@attachmentnames; 1) + "', '"<br />+ Lien + "', '"<br />+ Titre + "', '"<br />+ Description + "');"</code></pre>The first column of my view is defined with the sort key I want to use. In my example the title of the document. Don't forgotto specify this column as sorted to use @dbcolumn.<br /><br />To created my Web page who displayed the SlideShow I use a Lotus Notes Page. You can use a form too if you want.<br /><br />In the HTML header content we must specify the path to javascript files and css stylesheet file, add an OnLoad event to load the library and add the picture array :<br /><pre class="code"><code>Photos:= @DbColumn("":"";"";"Photos" 1);<br />@If(@IsError(val); "" ;<br />"<script src="\" type="\"></script><br /><script src="\" type="\"></script><br /><script src="\" type="\"></script><br /><script src="\" type="\"></script><br /><link rel=\"stylesheet\" href=\"jd.slideshow.css\"<br />type=\"text/css\" media=\"screen\" /><br /><br /><script type="\"><br />function addLoadEvent(func) {<br />var oldonload = window.onload;<br />if (typeof window.onload != 'function') {<br />window.onload = func; }<br />else {<br />window.onload = function() {<br />oldonload();<br />func();<br />}<br />}<br />}<br />function startSlideshow() {<br />initSlideShow($('mySlideshow'), mySlideData);<br />}<br /><br />countArticle = 0;<br />var mySlideData = new Array();"<br />+ @Implode(Photos) +<br />"addLoadEvent(startSlideshow); </script><br /><style><br />#mySlideshow {<br />width: 400px !important;<br />height: 200px !important;<br />}<br /></style>");</code></pre><br />With "Photo" the name of view who displayed photos.<br /><br />Now, you just have to add in your web page :<pre class="code"><code><div id="mySlideshow"></div></code></pre>to define where you want to display the slideshow.<br /><br />You can display an example with <a href="http://free.dominoserver.de/it/dominoweb.nsf/slide">my photos from Britain</a>.Philippe GAUVINhttp://www.blogger.com/profile/12499706055358952821noreply@blogger.com1tag:blogger.com,1999:blog-1090156157590583310.post-26511307929043014242006-09-04T20:25:00.000+02:002006-09-04T21:25:35.947+02:00AJAX - Tag CloudsI searched how to implement a tag cloud on my Lotus Notes application for web and I've the surprise to find quickly 3 solutions. All this solution implemented three differents way. I find them very interresting because they reproduced the three standard new ways to develop Lotus Notes Application on Web; Formula & Javascript, LotusScript and LotusScript with DXL.<br /><br /><span style="font-weight: bold; color: rgb(204, 102, 0);">What is a tag cloud ?</span><br /><br />A tag cloud is a representation of keywords defined by users who are displayed with a font size proportional at his importance. The most common criteria to define importance is the number of occurence of this tag in all the documents.<br /><br />You can find tag cloud in all the important web 2.0 application like <a href="http://del.icio.us/tag/">delicious</a>, <a href="http://www.flickr.com/photos/tags/">Flickr</a> or <a href="http://www.technorati.com/tag/">Technorati</a>.<br /><br /><img style="margin: 0px auto 10px; display: block; text-align: center;" src="http://photos1.blogger.com/blogger2/6158/133075702830881/400/tagclouden.gif" alt="" border="0" /><br />If I want to use tag use, it's to replace the categorized view. I find categorization too hard to manage in web application.<br /><br /><span style="font-weight: bold; color: rgb(204, 102, 0);">Three ways to implement a tag cloud in Lotus Notes for the Web</span><br /><br /><span style="font-weight: bold;">First Way : Formula & Javascript</span><br /><a href="http://www.ferdychristant.com/fchristant/production/fdm.nsf/archive/DOMM-6SKFQW">Ferdy Christant</a> suggest to <a href="http://www.ferdychristant.com/fchristant/production/fdm.nsf/archive/DOMM-6SKFQW">create a javascript array thru Notes view with little formula</a>. The tag cloud is generated by Javascript on browser.<br /><br />The principal advantage is to not overload the server. Only a view is called by the users.<br /><br />Unfortunately this solution is not perfect<br /><ul><li>The browser must support Javascript. If all the modern browser allow to run Javascript code, the user can deactivate this option. Second thing, if the Javascript can be executed, we must be careful to not overload the browser with too much data.</li><li>One of the advantages of tag cloud for webmaster is for indexation on search engine. For search bots, a tag cloud is a library of links with smart keywords, the tag, to index the content of the link. Today, the javascript isn't running by this bots. Then, the tag cloud is ignore by search engine.</li><li>You can't use this method to display tag cloud on Lotus Notes Client</li></ul><span style="font-weight: bold;">Second way : Traditional LotusScript</span><br /><a href="http://www.notessidan.se/A55B53/blogg.nsf/blogg">Thomas Adrian</a> uses a <a href="http://www.notessidan.se/A55B53/blogg.nsf/plink/TADN-6RPTKK">LotusScript agent</a> to build the TagCloud. The tag cloud is computed in real time from an agent who is based on <span style="font-style: italic;">NotesView Navigator </span>and <span style="font-style: italic;">print</span> function. The server must run this agent for every call to display the tag cloud. The advantage is that the tag cloud is coded in HTML format, then the search bot can index it. The disavantage of that solution is the avantage of the first solution and inverse.<br /><br />If I had to choose one these two solution, I will prefer first for an Intranet and second for Internet. In an intranet application I can control browsers versions, I don't need to index my tag cloud and the most important is to preserve the CPU.<br /><br /><span style="font-weight: bold;">Third way : LotusScript with DXL</span><br /><a href="http://smoki.atblogs.de/index.php?blogId=82">Christian Mueller</a> purpose a variation of the second solution with <a href="http://smoki.atblogs.de/index.php?op=ViewArticle&articleId=772&blogId=82">DXL</a>. He computes the tag cloud with the same method than Thomas Adrian but doesn't display the result directly to the browser. He saves the result in a new form with DXL. We just need to execute the agent when a document is created, updated or deleted, when the tag cloud is modified.<br /><br />With this solution the server has just to open a form to display the tag cloud in HTML format. Another advantage is it's possible to display the tag cloud on Lotus Notes Client.<br /><br />Is the ideal solution ? It's the best solution for my first constraints. But there are two new problems :<br /><ul><li>In french version of this blog, <a href="http://darkmag.net/darkBlog/index.php">Yogi</a> has remarked it's not possible to manage documents with reader field,<br /></li><li>It's difficult today to find developper who really knows DXL to integer and maintain this type of application.</li></ul>Philippe GAUVINhttp://www.blogger.com/profile/12499706055358952821noreply@blogger.com4tag:blogger.com,1999:blog-1090156157590583310.post-66555079275991303482006-08-29T19:48:00.000+02:002006-08-29T21:16:05.387+02:00AJAX - AutocompletionThis article is an abstract of three articles in french section. If you read <a href="http://www.nsftools.com/blog/CurrentBlog.htm">NSFTools</a> blog, you've had a first solution to implement autocompletion with scriptaculous.<br /><br /><span style="font-weight: bold; color: rgb(204, 102, 0);">First Step : Installation of javascript libraries</span><br />Like Julian, I use javascript library Scriptaculous. Scriptaculous is based on another Javascript library, prototype.js. You can download all this libraries on <a href="http://script.aculo.us/downloads">scriptaculous web site</a>. Unzip the file in your hard disk and add all the files in shared resources of your Lotus Notes Database. You can create a new database to add this javascript files too. This new database can be used by all your application who need this javascript libraries and it will be easier to update the javascript files. The advantage of files resources is to be accessible from Windows explorer with WebDAV. I'll write an article about this new Domino service.<br /><br /><span style="font-weight: bold; color: rgb(204, 102, 0);">Second Step : Creation of the form</span><br />We just need one editable field.<ul><li>create new form</li><li>add editable text field</li><li>in the last tab of the property of the field add an id name. For example : autocomplete<br /><img style="margin: 0px auto 10px; display: block; text-align: center;" src="http://photos1.blogger.com/blogger/366/1667/400/ajax_id.gif" alt="" border="0" /></li><li>add javascript code as HTML relay just after your field :<pre class="code"><code><div id="autocomplete_choices" class="autocomplete"></div><br /><script language="javascript" charset="UTF-8" ><br />new Ajax.Autocompleter("autocomplete", "autocomplete_choices",<br />"search?openpage", {method:'get',paramName: 'autocomplete'});<br /></script></code></pre></li><li>add in your HTML Head content the declaration of the javascript libraries prototype.js and scriptaculous and the stylesheet to display list :<pre class="code"><code>"<script src=\"prototype.js\" type=\"text/javascript\"></script><br /><script src=\"effects.js\" type=\"text/javascript\"></script><br /><script src=\"dragdrop.js\" type=\"text/javascript\"></script><br /><script src=\"controls.js\" type=\"text/javascript\"></script><br /><style><br />div.autocomplete {<br />font-size:10px;<br />font-family : tahoma, arial, helvetica, sans-serif;<br />width: 350px;<br />background: #fff;<br />}<br />div.autocomplete ul {<br />border:1px solid #888;<br />margin:0;<br />padding:0;<br />width:100%;<br />list-style-type:none;<br />}<br />div.autocomplete ul li.selected {background-color: #ffb;}<br />div.autocomplete ul li {<br />margin:0;<br />padding:3px;<br />cursor:pointer;<br />}<br /></style>"</code></pre></li></ul>Be careful, perhaps you'll need to change the path of the javascript libraries.<br />The form is ready to use.<br /><br /><span style="font-weight: bold; color: rgb(204, 102, 0);">Third Step : Search view</span><br />In my example, the search view have only one sorted column. This column only display the values to show in autocompletion list.<br /><br /><span style="font-weight: bold; color: rgb(204, 102, 0);">Last Step : Search page</span><br />To search all the words who begin by the letters and send the response to Ajax, I use a Notes Page. It's possible to use form or agent too. The result must look like :<br /><ul><br /><li>1st word</li><br />...<br /></ul><br /><ul><li>Create new page named "search"</li><li>Select "Type of content : HTML" in the second tab of the page properties</li><li>Add new computed field with formula :<pre class="code"><code>val := @DbLookup("":"nocache"; "";"dbautocomplete"; @UrlQueryString("autocomplete"); 1; [PartialMatch] );<br />@If(@IsError(val); ""; "<ul>" + @Implode("<li>" + val + "</li>") + "</ul>");</code></pre></li></ul>It's finish ! <a href="http://free.dominoserver.de/it/dominoweb.nsf/autocompletewithoutls?openform">You can test</a>.<br /><br /><span style="color: rgb(204, 102, 0); font-weight: bold;">BONUS</span><br />You can add two interresting options to the declaration of the autocomplete class<br /><br /><span style="font-weight: bold;">1. Start search after the nth characters</span><br />If you don't want to start autocomplete search from the first letter, you can add a parameter to specify after how many letter you want to begin.<br />Add the parameter "minChars" like this : <pre class="code"><code>new Ajax.Autocompleter("autocomplete", "autocomplete_choices",<br />"search?openpage", {method:'get',paramName: 'autocomplete', <span style="font-weight: bold;">minChars: 2</span>});</code></pre>In this example the search will start after the second characters<br /><br /><span style="font-weight: bold;">2. Manage multivalues field</span><br />You can specify a separator values too. When the user will type this separator the autocompleter will start a new search with only the charaters typed after.<br />Add the parameter "tokens" like this : <pre class="code"><code>new Ajax.Autocompleter("autocomplete", "autocomplete_choices",<br />"search?openpage", {method:'get',paramName: 'autocomplete', <span style="font-weight: bold;">tokens: ','</span>});</code></pre>Philippe GAUVINhttp://www.blogger.com/profile/12499706055358952821noreply@blogger.com6tag:blogger.com,1999:blog-1090156157590583310.post-58150044511284142782006-08-27T11:23:00.000+02:002006-08-27T11:50:54.868+02:00TIPS - How to export web data to MS ExcelTo export data to MS Excel, we can use CSV file format. This option is used by a lot of statiscal web site like Google Analytics.<br /><br /><span style="font-weight: bold; color: rgb(204, 102, 0);">Description of CSV File Format</span><br />CSV file format is a text file with values separated by comma or semicolon. Every rows are separated by carriage return. An example of CSV data :<br /><blockquote>Name; January;February; March<br />John; 12; 14;18<br />Tatiana;8;18; 15<br />Juan; 13; 12.5; 18</blockquote><img style="margin: 0px auto 10px; display: block; text-align: center;" src="http://photos1.blogger.com/blogger/366/1667/400/csv.gif" alt="" border="0" /><br /><span style="font-weight: bold; color: rgb(204, 102, 0);">How to integrate CSV export in Lotus Domino</span><br />In this example I use a Notes View but we can use a Notes agent too.<br /><br /><span style="font-weight: bold;">Creation of view "statistics.csv"</span><br />To separate values, I create column between every column of values with formula ";". To separate each line I add a last column with formula : @char(13) + @char(10). I select option of my view <span style="color: rgb(204, 102, 0);"><span style="color: rgb(0, 0, 0);">"treat view content as HTML"<br /><br /><span style="font-weight: bold;">Creation of form "$$View Template for statistics.csv"</span><br />I integer the Notes View in a new form named "$$ViewTemplate ofr statistics.csv". I unselect "display column title" of the Embedded view option and I selcet to display it with HTML.<br /><br />I want to open the view in MS Excel and not in Web Browser. To do that I just have to change MIME-Type of this form. The Mime-Type define to Web Browser how to display data and with which software. The MIME-Type for CSV file is : text/csv. I define this Mime-Type in the second tab of form options.<br /><br /><img style="margin: 0px auto 10px; display: block; text-align: center;" src="http://photos1.blogger.com/blogger/366/1667/400/mimecsv.gif" alt="" border="0" /><br />You can open this <a href="http://free.dominoserver.de/it/dominoweb.nsf/statistiques.csv">exemple </a>in Excel.<br /></span></span>Philippe GAUVINhttp://www.blogger.com/profile/12499706055358952821noreply@blogger.com6tag:blogger.com,1999:blog-1090156157590583310.post-23913153578298360732006-08-21T22:18:00.000+02:002006-08-21T22:34:30.503+02:00GOOGLE API - Geolocalisation search from Lotus Notes clientIt's possible to search geolocalisation of an postal address from Lotus Notes client too.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/366/1667/400/sample_notesadresse.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px;" src="http://photos1.blogger.com/blogger/366/1667/400/sample_notesadresse.jpg" alt="" border="0" /></a><br /><span style="font-weight: bold; color: rgb(204, 102, 0);">ALAX : Asynchronous LotusScript And XML</span><br /><br />To search the geolocalisation of a postal address from Lotus Notes Client, I use XMLHTTP object like in AJAX solutions. This object can be used in lotuscript thru agent, event or action.<br /><br /><span style="font-weight: bold; color: rgb(204, 102, 0);">Search Form</span><br /><br />The elements of my form are :<br /><ul><li>"street" : text field<br /></li><li>"town" : text field<br /></li><li>"country" : text filed<br /></li><li>button "search"<br /></li><li>"latitude" : text field<br /></li><li>"longitude" : text field<br /></li></ul>The user will specify street, town and town, then will click on search button. The values of Lattitude and longititude fields will be automatically added.<br /><br /><span style="font-weight: bold;">Search button</span><br /><br />I use the same web service than previous entry. The function must :<br /><ul><li>format search query from fields values</li><li>send request to web service</li><li>parse the result</li><li>added values to longitude and latitude fields</li></ul>The LotusScript code :<pre class="code"><code>Sub Click(Source As Button)<br />Dim wk As New NotesUIWorkspace<br />Dim uidoc As NotesUIDocument<br />Dim doc As NotesDocument<br />Dim street, town, country As Variant<br /><br />Set uidoc = wk.CurrentDocument<br />Set doc = uidoc.Document<br /><br />' longitude/latitude search request<br />' -----------------------------------------------------------<br />' the text must be encoded in URL format to replace special characters<br />' and spaces. localsearchmaps web service doesn't accept null value<br />' for street. If the user doesn't specify this information, we'll send<br />' "%20"<br /><br />street = Evaluate({@URLEncode("UTF-8";"} + doc.street(0) + {")})<br />If street(0)="" Then street(0) = "%20"<br />town = Evaluate({@URLEncode("UTF-8";"} + doc.town(0) + {")})<br />country = Evaluate({@URLEncode("UTF-8";"} + doc.country(0) + {")})<br />request = "http://www.localsearchmaps.com/geo/?street=" + street(0) + _<br />"&city=" + town(0) + "&country=" + country(0) + "&cb=notes"<br /><br />' Call and reception of the request<br />' -------------------------------------------------------------<br />' The XMLHTTP object only work if user have Internet Explorer<br /><br />Set page = CreateObject("Microsoft.XMLHTTP")<br />Call page.open("GET", request, False)<br />Call page.send()<br /><br />strReturn =page.responseText<br /><br />If (Instr(strReturn,"notes")>0) Then<br />' Extraction of longitude and latitude<br />' ----------------------------------------------------<br />' The result of the request looks like :<br />' notes(latitude, longitude,'TOWN', 'CODE', 'COUNTRY');<br /><br />search = Mid(strReturn, 7, Instr(strReturn, ",'") -7)<br />lattitude = Left(search, Instr(search, ",") -1)<br />longitude = Mid(search, Instr(search, ",") +2)<br /><br />Call uidoc.FieldSetText("latitude", lattitude)<br />Call uidoc.FieldSetText("longitude", longitude)<br />Else<br />Messagebox "The postal address wasn't found", 48, "Geolocalisation"<br />End If<br /><br />Set page = Nothing<br />End Sub</code></pre>Philippe GAUVINhttp://www.blogger.com/profile/12499706055358952821noreply@blogger.com2tag:blogger.com,1999:blog-1090156157590583310.post-24192201337803357452006-08-20T23:36:00.000+02:002006-08-20T23:52:41.137+02:00GOOGLE API - Full-Text search in Google Maps API (2/3)The previous entry presented how to find documents placed close to a postal address. I present now how to find the location of a document on the map. To find document in the database, I'll use Lotus Notes Full-Text Search.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://free.dominoserver.de/it/dominoweb.nsf/googlemapsftsearch"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px;" src="http://photos1.blogger.com/blogger/366/1667/400/sample_googlemapsft.jpg" alt="" border="0" /></a><span style="font-weight: bold; color: rgb(204, 102, 0);">AJAX : (</span><i style="font-weight: bold; color: rgb(204, 102, 0);">Asynchronous JavaScript And XML</i><span style="font-weight: bold; color: rgb(204, 102, 0);">)</span><br />I can't use standard Lotus Notes full-test search without using frames or iframes. The search form is "POSTed". Then the map will be reloaded after each requests. I'll use AJAX and little DHTML to perform my full-text search in asynchronous mode and integer the result without reload the web page. To learn more about AJAX you can read :<br /><ul><li><a href="http://en.wikipedia.org/wiki/Ajax_%28programming%29">AJAX on Wikipedia</a></li><li><a href="http://www.ajaxian.com/">Ajaxian </a></li></ul><span style="font-weight: bold; color: rgb(204, 102, 0);">How to customize result search view</span><br /><br />When users will click on a link in the result view, I want to center and center on Google Map at the position represented by the document. To do that, I reuse the Javascript function <span style="color: rgb(204, 102, 0);"><span style="color: rgb(0, 0, 0);">"<span style="font-style: italic;">mapZoom</span>". To have more details on this function read the previous post. The hypertext link of the document will look like :<br /></span></span><span style="color: rgb(204, 102, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(204, 102, 0);font-family:courier new;" >$lt;A HREF="" OnClick="mapZoom(longitude, latitude); return(false);">myLink</A></span></span></span><br /><span style="color: rgb(204, 102, 0);"><span style="color: rgb(0, 0, 0);"><br />To obtain this result :<ol><li>Create a new view "Search"<br /><ul><li><span style="color: rgb(204, 102, 0);"><span style="color: rgb(0, 0, 0);">First column formula : </span></span><span style="color: rgb(204, 102, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(204, 102, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(204, 102, 0);font-family:courier new;" >"<A HREF="" OnClick="mapZoom(" + longitude + ", " + latitude + "); return(false);">" + title + "</A>"</span></span></span></span></span></li><li><span style="color: rgb(204, 102, 0);"><span style="color: rgb(0, 0, 0);">Second column formula : <span style="color: rgb(204, 102, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(204, 102, 0);font-family:courier new;" >description + "<br />"</span></span></span></span></span></li><li><span style="color: rgb(204, 102, 0);"><span style="color: rgb(0, 0, 0);">Select view option : </span></span>"treat view content as HTML"</li></ul></li><li>Create form to display search result : "$$SearchTemplateDefault"<br /><ul><li>Insert new field named "$$ViewBody"</li></ul><br /></li></ol><span style="color: rgb(204, 102, 0); font-weight: bold;">The search form and result area</span><br /><br />The user needs only one field to type his request and a search button. In html : <pre class="code"><code><FORM NAME="form_fts"><br /><LABEL>Texte : </LABEL> <INPUT NAME="req" SIZE=35 /><br /><BUTTON VALUE="Rechercher" NAME="Rechercher"<br />TYPE="button" onClick="searchNotes()"><br />Rechercher<br /></BUTTON><br /></FORM><br /><br /><DIV id="affres" style="overflow:auto; padding:5px; height:100px;"></DIV></code></pre><span style="font-weight: bold; color: rgb(204, 102, 0);">Search and display result with AJAX</span><br /><br />The AJAX function use Lotus Notes standard search url to call result web page and display it in the div with id "affres". The url to search query looks like : </span></span>"<span style="font-family:courier new;">search?searchview&query=<span style="font-style: italic;">text from my query field</span></span>".<pre class="code"><code>function searchNotes(){<br />var xmlhttp=false;<br />/*@cc_on @*/<br />/*@if (@_jscript_version >= 5)<br />try {<br />xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");<br />} catch (e) {<br />try {<br />xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");<br />} catch (E) {<br />xmlhttp = false;<br />}<br />}<br />@end @*/<br /><br />if (!xmlhttp && typeof XMLHttpRequest!='undefined') {<br />try {<br />xmlhttp = new XMLHttpRequest();<br />} catch (e) {<br />xmlhttp=false;<br />}<br />}<br />if (!xmlhttp && window.createRequest) {<br />try {<br />xmlhttp = window.createRequest();<br />} catch (e) {<br />xmlhttp=false;<br />}<br />}<br /><br />xmlhttp.open("GET", "search?searchview&query=" +<br /> escape( document.form_fts.req.value),true);<br />xmlhttp.onreadystatechange=function() {<br />if (xmlhttp.readyState==4) {<br />document.getElementById("affres").innerHTML = xmlhttp.responseText;<br />}<br />}<br />xmlhttp.send(null)<br />}</code></pre><span style="font-family: courier new;"><span style="font-style: italic;">document.getElementById("idname").innerHTML</span> display result as content of the div with id "idname".</span>Philippe GAUVINhttp://www.blogger.com/profile/12499706055358952821noreply@blogger.com0tag:blogger.com,1999:blog-1090156157590583310.post-80701651511757307572006-08-20T22:05:00.000+02:002006-08-20T22:37:27.215+02:00GOOGLE API - How to search informations with Google Maps API (1/3)There are no geographical localisation search function from postal address in Google Maps API. If we haven't latitude and longitude of the points, it will be difficult for users to search informations for every documents.<br /><br />If I use Google Maps and Google Earth it's I want :<br /><ul><li>to find all documents in a region</li><li>to find where is the site referenced by the document</li></ul><br />To find the position of a document the user need to zoom on the by clicking on this document in a list for example. With Google Earth there is no problem. The list of document appears in left pannel. We juste have to double click on the title of a document to be centered and zoomed on the site referenced by the document. Unfortunately you haven't this option with Google Maps.<br /><br /><span style="font-weight: bold; color: rgb(204, 102, 0);">How to find, center and zoom on Google Maps with a postal address</span><br /><a href="http://free.dominoserver.de/it/dominoweb.nsf/googlemapssearch"><img style="margin: 0px auto 10px; display: block; text-align: center;" src="http://photos1.blogger.com/blogger/366/1667/400/sample_googlemapsadresse.jpg" alt="" border="0" /></a>To find geolocalisation of a postal address I use web service <a href="http://www.localsearchmaps.com/">localsearchmap</a>. This web service return by default the Google Maps API syntax to center and zoom on this point. Unfortunately, it uses the version 1 of the API syntax who's not compatible with the actual version. The web service permiss to custumize the format of the response.<br /><br />The basic syntaxe to call this service is :<br />http://www.localsearchmaps.com/geo/?street=mystreet&town=mytown<br />&country=mycountry<br />It's possible to add an argument to return the result with call to Javascript function : &cb=myJavascriptFonction<br /><br />For example :<br /><a href="http://www.localsearchmaps.com/geo/?street=rue+des+cosmonautes&town=palaiseau&country=france&cb=mapZoom">http://www.localsearchmaps.com/geo/<br />?street=rue+des+cosmonautes&town=palaiseau<br />&country=france&cb=mapZoom</a><br />return the result : <span style="font-family:courier new;">mapZoom(46.624, 2.4622);</span><br /><br />To use map object in Javascript function I must declare this object as global in the javascript code who display Google Maps map (<a href="http://webdomino.blogspot.com/2006/08/google-api-lotus-notes-google-maps.html">previous entry</a>).<br /><p style="font-weight: bold;">The search form</p><p>The user needs to specify postal address in a form. We must add three fields and a button in the Google Maps page : street, town, coutry fields and search button.</p><pre class="code"><code><FORM NAME="form"><br /><LABEL>Street : </LABEL> <INPUT NAME="street" SIZE=50 /><BR /><br /><LABEL>Town : </LABEL> <INPUT NAME="town" SIZE=50 /><BR /><br /><LABEL>Country : </LABEL> <INPUT NAME="country" /><br /><BUTTON VALUE="Search</code><code>" NAME="Search" TYPE="button"<br />onclick="searchPoint()"><br />Search<br /></BUTTON><br /></FORM></code></pre><p></p><strong>mapZoom(lat,long) Javascript function</strong><br />When we'll have found the geolocalisation of the point, we must center and zoom on the point. Then I declare a new Javascript function to do that :<pre class="code"><code>function mapZoom(lat, long,town,state,country){<br />var point = new GLatLng( parseFloat(lat), parseFloat(long));<br />map.setCenter(point,14, G_HYBRID_MAP );<br />}</code></pre><strong>searchPoint() Javascript function<br /><span style="font-weight: normal;">This function call web service with datas of the form in argument. The result will launch the previous function to zoom and center on the point.<pre class="code"><code>function searchPoint() {<br />var queries = "?street=" + escape( document.form.street.value)+<br /> "&city="+escape( document.form.town.value)+<br /> "&country=" + escape( document.form.country.value);<br />var s = document.createElement( "script" );<br />s.src="http://www.localsearchmaps.com/geo/" + queries + "&cb=mapZoom";<br />s.type = "text/javascript";<br />document.getElementsByTagName( "head" )[0].appendChild(s);<br />}</code></pre></span></strong><a href="http://free.dominoserver.de/it/dominoweb.nsf/googlemapssearch">This example</a> (in french for the moment) shows you the result.Philippe GAUVINhttp://www.blogger.com/profile/12499706055358952821noreply@blogger.com0tag:blogger.com,1999:blog-1090156157590583310.post-44988214351599227262006-08-20T05:00:00.000+02:002006-08-20T20:19:16.875+02:00GOOGLE API - Lotus Notes & Google MapsAn API is available to customize Google Maps. You can add your own points on the earth like with Google Earth.<br /><br />Steps to interface Lotus Notes and Google Maps :<br /><ol><li>Signup for a Google Maps API key</li><li>Create data source to define points to display (position and description)</li><li>Create web page to display the Google Maps map and your points</li></ol><span style="font-weight: bold; color: rgb(204, 102, 0);">Step 1 : Google Maps API key</span><br />The usage of API key is restricted to an URL to define. Only elements directly accessible from this "directory" can be displayed on the map. Be careful when you define the URL. Don't panic if you define a wrong URL. You'll can define a new API Key.<br /><ul><li>If you want to call map from a page or an agent you'll specify the URL of the database. for example http://www.acme.com/sample.nsf/</li><li>If you want to call map from a document you'll must add the view in your URL. You can use the special view "0" too. For example : http://www.acme.com/sample/0/</li></ul>In my example, I'll use a page to declare the Google Maps. Then, I use the URL <span style="font-family:monospace;"></span>http://free.dominoserver.de/it/dominoweb.nsf/ to define my new Google Maps API key.<br /><br />To obtain an API key, go to web page <a href="http://www.google.com/apis/maps/">http://www.google.com/apis/maps/</a><br /><br /><span style="font-weight: bold; color: rgb(204, 102, 0);">Step 2 : Creation of the data source</span><br />I need the same informations than Google Earth. Then I use the same form.<br /><br />The extraction of data thru XML file is managed by Javascript. I could use the same file format than Google Earth. I've defined another XML format in this example to simplify the javascript code.<br /><br /><span style="font-weight: bold;">XML View for Google Maps</span><br />The XML File must define at least latitude and longitude. In this example I've chosen the format :<pre class="code"><code><markers><br /><marker lat="latitude" long="longitude" title="titre"><br /><description><![CDATA[description]]></description><br /></marker><br /></markers></code></pre>Then the column formula for the "Google Maps" view is :<br /><pre class="code"><code>"<marker<br />lat=\"" + latitude + "\"<br />long=\"" + longitude + "\"<br />title=\"" + titre + "\"><br /><description><![CDATA[" + description + "]]></description><br /></marker>"</code></pre>Select option "treat view content as HTML" in view properties.<br /><br />I create a form to display view as XML flow.<ul><br /><li>New form named "$$ViewTemplate for <Name of my view>"</li><li>Select Option "Type of file : Other : text/xml" in form properties</li><li>Insert XML header code : <pre class="code"><code><?xml version="1.0" encoding="ISO-8859-1" ?><br /><markers></code></pre></li><li>Insert the view with option display as HTML</li><br /><li>Insert XML footer code : <pre class="code"><code></markers></code></pre></li></ul><span style="font-weight: bold;"></span><span style="font-weight: bold; color: rgb(204, 102, 0);"> Step 3 : Display the map and points from a page</span><br /><br />I use a Lotus Notes "Page" to display map and points. You can use agent or document too.<br />The minimal code display map without points is :<pre class="code"><code><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"<br />"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><br /><html xmlns="http://www.w3.org/1999/xhtml"><br /><br /><head><br /><meta http-equiv="content-type" content="text/html; charset=utf-8"/><br /><title>Google Maps JavaScript API Example</title><br /><script src="http://maps.google.com/maps?file=api&v=2&key=MyGoogleMapsAPIKey"<br />type="text/javascript"></script><br /><br /><script type="text/javascript"><br />//<![CDATA[<br />function load() {<br />if (GBrowserIsCompatible()) {<br /> var map = new GMap2(document.getElementById("map"));<br /> map.addControl(new GLargeMapControl());<br /> map.addControl(new GMapTypeControl());<br /> map.setCenter(new GLatLng(27.994401,13.164063),1, G_HYBRID_MAP );<br />}<br />}<br />//]]><br /></script><br /></head><br /><br /><body onload="load()" onunload="GUnload()"><br /><div id="map" style="width: 500px; height: 300px"></div><br /></body><br /><br /></html></code></pre>To download XML file and display points on the map I use <span style="font-style: italic;">"GDownloadUrl"</span> Google javascript function.<pre class="code"><code><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"<br />"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><br /><html xmlns="http://www.w3.org/1999/xhtml"><br /><br /><head><br /><meta http-equiv="content-type" content="text/html; charset=utf-8"/><br /><title>Google Maps JavaScript API Example</title><br /><script src="http://maps.google.com/maps?file=api&v=2&key=MaCleAPIGoogleMaps"<br />type="text/javascript"></script><br /><br /><script type="text/javascript"><br />//<![CDATA[<br />function load() {<br /><br />if (GBrowserIsCompatible()) {<br />var map = new GMap2(document.getElementById("map"));<br />map.addControl(new GLargeMapControl());<br />map.addControl(new GMapTypeControl());<br />map.setCenter(new GLatLng(27.994401,13.164063),1, G_HYBRID_MAP );<br /><br />GDownloadUrl("googlemaps.xml", function(data, responseCode) {<br />var xml = GXml.parse(data);<br />var markers = xml.documentElement.getElementsByTagName("marker");<br />for (var i = 0; i < markers.length; i++) {<br />var latitude = parseFloat(markers[i].getAttribute("lat"));<br />var longitude = parseFloat(markers[i].getAttribute("long"));<br />var title = markers[i].getAttribute("title");<br />var desc =<br />markers[i].getElementsByTagName("description")[0].firstChild.nodeValue;<br />var point = new GLatLng(latitude,longitude);<br />var marker = new GMarker(point);<br />map.addOverlay(marker);<br />}<br />});<br />}<br />}<br />//]]><br /></script><br /></head><br /><br /><body onload="load()" onunload="GUnload()"><br /><div id="map" style="width: 500px; height: 300px"></div><br /></body><br /><br /></html></code></pre>I use two differents type of call in javascript to extract XML File datas.<br /><ul><li><span style="font-family:courier new;">var latitude = parseFloat(markers[i].</span><span style="font-weight: bold;font-family:courier new;" >getAttribute("lat")</span><span style="font-family:courier new;">); </span><br />To extract attribute of XML tag.</li><li><span style="font-family:courier new;">var desc = markers[i].<span style="font-weight: bold;">getElementsByTagName("description")[0]</span></span><br /><span style="font-family:courier new;"><span style="font-weight: bold;">.firstChild.nodeValue;</span></span><br />To extract values declared between two XML tags.<br /></li></ul>For the moment I've just displayed the points. I can't display description when I click on a point.<br />To do that, I declare a new Javascript function :<pre class="code"><code>function createMarker(point,title, desc ) {<br />var bulle = "<h3>" + title + "</h3><p>" + desc +"</p>";<br />var marker = new GMarker(point);<br />GEvent.addListener(marker, "click", function() {<br />map.setCenter(point,14, G_HYBRID_MAP );<br />marker.openInfoWindowHtml(bulle);<br />});<br />return marker;<br />}</code></pre>To use this function, I replace <span style="color: rgb(204, 102, 0);font-family:courier new;" >var marker = new GMarker(point);</span> by <span style="color: rgb(204, 102, 0);font-family:courier new;" >var marker = createMarker(point,title, desc);</span><br />You can look at an example (for the moment in french): <a href="http://free.dominoserver.de/it/dominoweb.nsf/googlemaps">http://free.dominoserver.de/it/dominoweb.nsf/googlemaps</a><br /><br />To have more informations about Google Maps API you can read the <a href="http://www.google.com/apis/maps/documentation/">API documentation</a>Philippe GAUVINhttp://www.blogger.com/profile/12499706055358952821noreply@blogger.com1tag:blogger.com,1999:blog-1090156157590583310.post-78748154273422922462006-08-20T03:05:00.000+02:002006-08-20T17:41:01.279+02:00GOOGLE API - Lotus Notes & Google EarthDisplay Lotus Notes Document on Google Earth is simpliest solution. To add points on maps you just have to prepare KML file.<br /><br /><span style="font-weight: bold; color: rgb(204, 102, 0);">Quick description of KML format</span><br />KML files are XML files who permiss to describe the points to display on earth. The definition of a point include position of the point (latitude and longitude) and a description.<pre class="code"><code><kml xmlns="http://earth.google.com/kml/2.0"><br /><Placemark><br /><span style="margin-left: 20px;"><description><br /><![CDATA[<a href="http://www.google.com/">Google Search!</a>]]><br /></description></span><br /><span style="margin-left: 20px;"><name>Google Headquarters</name></span><br /><span style="margin-left: 20px;"><Lookat></span><br /><span style="margin-left: 40px;"><longitude>-122.0839</longitude></span><br /><span style="margin-left: 40px;"><latitude>37.4219</latitude></span><br /><span style="margin-left: 40px;"><range>540.68</range></span><br /><span style="margin-left: 40px;"><tilt>0</tilt></span><br /><span style="margin-left: 40px;"><heading>3</heading></span><br /><span style="margin-left: 20px;"></Lookat></span><br /><span style="margin-left: 20px;"><Point></span><br /><span style="margin-left: 40px;"><coordinates>-122.0839,37.4219,0</coordinates><br /><span style="margin-left: 20px;"></Point></span><br /></Placemark><br /></kml></span></code></pre><ul><li><span style="font-weight: bold;">Placemark</span> : New point<br /></li><li><span style="font-weight: bold;">description</span> : description displayed when you click on a point in Google Earth.<br /></li><li><span style="font-weight: bold;">name</span> : name of the point<br /></li><li><span style="font-weight: bold;">Lookat</span> : geolocalisation</li><li><span style="font-weight: bold;">longitude</span> : longitude of the point<br /></li><li><span style="font-weight: bold;">latitude</span> : latitude of the point<br /></li><li><span style="font-weight: bold;">range</span> : altitude<br /></li><li><span style="font-weight: bold;">tilt</span> : angle from North<br /></li><li><span style="font-weight: bold;">heading</span> : angle from skyline<br /></li><li><span style="font-weight: bold;">coordinates</span> : coordonnates of the point</li></ul>If you want to define several points you must had the root tag <Document>. This tag accept tag "name" who permiss to describe the flow in Google Earth.<br /><br />Other options can be used like customization of the icon. You'll find all informations on the help page of Google Earth : (<a href="http://www.keyhole.com/kml/docs/webhelp/index.htm">http://www.keyhole.com/kml/docs/webhelp/index.htm</a>)<br /><br /><span style="font-weight: bold; color: rgb(204, 102, 0);">How to integer Lotus Notes data in Google Earth with a simple view</span><br />There's a lot of solutions to interface Lotus Notes and Google Earth. I've choosen to generate KML file from Notes View.<br /><br /><span style="font-weight: bold; color: rgb(0, 0, 0);">Step 1 : The form</span><br />We need to have this informations :<ul><li>a title<br /></li><li>a description<br /></li><li>longitude</li><li> latitude</li></ul>The other elements will be define in the view.<br /><br /><img style="margin: 0px auto 10px; display: block; text-align: center;" src="http://photos1.blogger.com/blogger2/6158/133075702830881/400/googleearth_form.gif" alt="" border="0" /><br /><span style="font-weight: bold; color: rgb(0, 0, 0);">Step 2 : The view</span><br /><span style=";font-family:georgia;font-size:100%;" >After create new view, select option "</span><span sans="" serif="" style=";font-family:Default;font-size:78%;" ><span style="font-size:100%;"><span style="font-family:georgia;">treat view content as HTML".</span><br /><span style="font-family:georgia;">Column formula is (be carefull with Uppercase and Lowercase):</span></span></span><br /><pre class="code"><code>"<Placemark><br /><description><![CDATA[" + description + "]]></description><br /><name>" + titre + "</name><br /><Lookat><br /><longitude>" + longitude + "</longitude><br /><latitude>" + latitude + "</latitude><br /><range>540.68</range><br /><tilt>0</tilt><br /><heading>3</heading><br /></Lookat><br /><Point><br /><coordinates>" + longitude + "," + latitude +"</coordinates><br /></Point><br /></Placemark>"</code></pre><br /><br /><span style="font-weight: bold; color: rgb(0, 0, 0);">Step 3 : form to display view</span><br />To integer header and character setting of the KML file, I create a form to display the embedded view.<br /><br /><ul><li>Create a forme named : $$ViewTemplate For <name></name></li><li><nom>Select Option "Type of file : Other : Application/vnd.google-earth.kml+xml" in form properties<br /></nom></li><li><nom>Insert KML header. I choose iso-8859-1 charset to support french characters. You can choose UTF-8 or other local charset.<br /></nom></li><pre class="code"><code><?xml version="1.0" encoding="iso-8859-1" ?><br /><kml xmlns="http://earth.google.com/kml/2.0"><br /><Document><br /><name>Titre de mon flux Google Earth</name></code></pre><li>Insert embedded view<br /></li><li>Insert KML footer<pre class="code"><code></Document><br /></kml></code></pre></li></ul><span style="font-weight: bold; color: rgb(204, 102, 0);"><span style="color: rgb(0, 0, 0);">Etape 5 : Integer KML File in Google Earth</span></span><br />The MIME type was defined in Form properties. If you have installed Google Earth, you can open the view from a Web Browser. A dialog box will be open to ask you if you want to open the file in Google Earth. If you click on OK your file will be automaticly integer in Google Earth.<br /><br />You can integer this file directly in Google Earth too. Open Google Earth and select Add\Network Link in menu. You'll just have to insert the URL of your view in location field.<br /><br /><span style="font-weight: bold; color: rgb(204, 102, 0);">Limitation with access control list</span><br />Be careful, you must defin Anaonymous with Reader access at least. I'll write an entries more later to resolve this problem.<br /><br /><span style="font-weight: bold; color: rgb(204, 102, 0);">Examples</span><br /><ul><li>An example of KML File from Lotus Notes Database : <a href="http://free.dominoserver.de/it/dominoweb.nsf/googleearth.kml">http://free.dominoserver.de/it/dominoweb.nsf/googleearth.kml</a></li><li>The same file but in XML to display it in Web Browser:<a href="http://free.dominoserver.de/it/dominoweb.nsf/googleearth.xml"> http://free.dominoserver.de/it/dominoweb.nsf/googleearth.xml</a></li></ul>Philippe GAUVINhttp://www.blogger.com/profile/12499706055358952821noreply@blogger.com1tag:blogger.com,1999:blog-1090156157590583310.post-29871496641208947832006-08-20T00:52:00.000+02:002006-08-19T01:11:30.983+02:00GOOGLE API - Google Earth and Google Maps the new views for Lotus DominoGoogleEarth and GoogleMaps now allow to display Lotus Notes documents, not in views, but on the earth.<br /><br />The objectives of this first stage are to present :<br /><ul><li>how to display documents on Google Earth</li><li>how to display documents on Google Maps</li><li>the limitations of this tools with Lotus Notes</li><li>how to simplify the geolocalisation </li></ul><span style="font-weight: bold;"><span style="color: rgb(204, 102, 0);">Why would you want to display documents on a map ?</span><br /></span>The geolocalisation of the documents should not be generalized with all types of documents. The first condition is to should associate geographical position to a document. The representation of the documents on a map can have two advantages :<br /><ul><li>To know the geographical position of a document</li><li>To know the documents who exist on a geographical position</li></ul>This two informations are totaly differents. Google Earth and Google Maps can do the two things but it will be more or less simple to implement natively with.<br /><span style="font-weight: bold;"><br /><span style="color: rgb(204, 102, 0);">Differences between Google Earth and Google Maps</span><br /></span><span>Google Earth is a software then Google Maps is a service thru recent web browser (IE6 +, or Firefox).<br /><br />Google Earth needs minimum configuration of the desktop and more particulary a recent graphic cards. You can dowload free version of Google Earth :<br /></span><a href="http://earth.google.com/download-earth.html">http://earth.google.com/download-earth.html</a><br /><br /><div style="text-align: center;"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/366/1667/320/googleearth.png" alt="" border="0" /><span style="font-style: italic;">Google Earth</span><br /></div><br /><span>You ca access to </span><span style="font-weight: bold;">Google Maps</span><span> on URL http://maps.google.com. You can customized this maps with Google API. I use this API in the next entries. For more informations about GoogleMaps API, phlease consult the web site </span><a href="http://www.google.com/apis/maps/">http://www.google.com/apis/maps/</a>.<br /><br /><div style="text-align: center;"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/366/1667/320/googlemaps.png" alt="" border="0" /><span style="font-style: italic;">Interface Google Maps</span><br /></div>Philippe GAUVINhttp://www.blogger.com/profile/12499706055358952821noreply@blogger.com0tag:blogger.com,1999:blog-1090156157590583310.post-3837813836353794062006-08-19T05:00:00.000+02:002006-08-20T17:04:16.823+02:00SITE - My Taylor is richThis blog is the english translation of the French Blog <a href="http://dominoweb.blogspot.com/">Domino & Web 2.0</a>.Philippe GAUVINhttp://www.blogger.com/profile/12499706055358952821noreply@blogger.com0