Lotus Notes Design and Admin tips

Fix full text search results within PDF and DocX documents

Ferdi Verlaan  February 10 2011 02:56:31 PM
We found that several installations of Lotus Domino 8.5.1 and 8.5.2 had issues when searching a full-text indexed database with attachment conversion filters turned on. When searching for content within the attachment, no results were displayed.
 
This is due to a wrong characterset in the keyview settings. This can be fixed by adding the following notes.ini entries:

FT_BINARY_FILTER_OFF=0

OS400_KEYVIEW_CSID=0052

PLATFORM_CSID=052


Where 0052 stands for
ISO 1252 West European Latin.
For more information see
this page.

After changing the ini-settings, restart the server and completely remove the FT-index and then re-create it. Attachments will be searchable again.

    Bookmark and Share

Google sitemap agent and update it to Google with a ’ping’ service

Ferdi Verlaan  November 11 2010 03:41:46 PM
Google has a cool little website called 'Google Webmaster tools' located at: https://www.google.com/webmasters/tools/

One of the features of Webmaster tools is the possibility to upload the sitemap of your site. This will improve the indexing of your website. A Google sitemap is a XML file which has the following structure:


<?xml version="1.0" encoding="UTF-8" ?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84
http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">
<url>
  <loc>http://www.domain.com/dir/page.html</loc>
  <lastmod>2010-10-27</lastmod>
  <priority>1</priority>
  </url>
</urlset>

Dynamic sitemap

We want to update this sitemap automatically with a Lotusscript agent when we create or modify a page. We have created a view called 'vw-web-Sitemap' which has the structure of our content in it in hierachical format. It loops through the view, get the field 'urlkey_seo' and the last modified date and places them in the XML. The field 'urlkey_seo' contains the actual path of the page (ex: /products/coolproduct1/specs).


We created a small function to get the date in the correct format (yy-mm-dd). In our case we use three templates (forms), and we give a different priority to it, the homepage should be 1 (high), our products should have a priority of 0.8, and all other pages should have a priority of 0.5 (medium).


The agent has the following code:


%REM

       Agent web-GoogleSitemap

       Created Oct 27, 2010 by Ferdi Verlaan/Aas

       Description: Creates a google sitemap from the content of the sitemap view

%END REM

Option
Public
Option
Declare

Sub
Initialize

       
On Error GoTo errh

       
Dim session As New NotesSession
       
Dim db As NotesDatabase
       
Dim view As NotesView
       
Dim doc As NotesDocument
       
Dim rel As String        
       
       
Set db = session.Currentdatabase
       
Set view = db.Getview("vw-web-Sitemap")
       
Set doc = view.Getfirstdocument()

       
'header information for XML        
       
Print {Content-Type: application/xml"}
       
Print {<?xml version="1.0" encoding="UTF-8"?>}
       
Print {<urlset xmlns="http://www.google.com/schemas/sitemap/0.84"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84
        http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">}

       
Do Until doc Is Nothing
               
               
If doc.Form(0) = "cnt-Diensten" Then
                       rel =
"0.8"
               
elseIf doc.Form(0) = "cnt-Start" Then
                       rel =
"1"
               
Else
                       rel =
"0.5"
               
End If
               
               
Print {<url>}
               
Print {<loc>http://www.aashq.nl} & doc.urlkey_seo(0) & {</loc>}
               
Print {<lastmod>} & genDate(doc) & {</lastmod>}
               
Print {<priority>} & CStr(rel) &{</priority>}
               
Print {</url>}
               
               
Set doc = view.Getnextdocument(doc)
       
Loop        
       
       
Print {</urlset>}
       
       
Exit Sub
       
errh:

       
Print "Error on line " & Erl & " - " & Err & " - " & Error & " in "& GetThreadInfo(1)        
       
Exit Sub
       

End
Sub


%REM

       Function lenDate

       Description: checks the length of the day or month value

%END REM

Function
lenDate(ndt As String) As string
       
       
If Len(ndt) = 1 Then
               lenDate =
"0" + ndt
       
Else
               lenDate = ndt

       
End If
       

End
Function
%REM

       Sub genDate

       Description: Creates a yy-mm-dd date string

%END REM

Function
genDate(doc As NotesDocument) As string
       
       
Dim ndt As New NotesDateTime(CStr(doc.LastModified))
       
Dim y As String
       
Dim m As String
       
Dim d As string
       
       y =
CStr(Year(CStr(ndt.Lslocaltime)))
       m = lenDate(
CStr(Month(CStr(ndt.Lslocaltime))))
       d = lenDate(
CStr(Day(CStr(ndt.Lslocaltime))))
       
       genDate = y +
"-" + m + "-" + d
       
       
Exit Function
               

End
Function


This agent will create a nice XML output for Google Sitemaps. You can submit it to Google with Webmaster tools > Siteconfiguration > Sitemaps.


Image:Google sitemap agent and update it to Google with a ’ping’ service

Ping sitemap

After submission Google will index the sitemap periodically, but wouldn't it be great to let Google now that the sitemap has been updated? That is possible through a special PING website of Google. The url of this ping service is:
http://www.google.com/webmasters/sitemaps/ping? and then the url of your sitemap.

We have created a ping agent for Lotus Notes which automatically runs after a modification or creating of a new document.

The agent code is listed below (works only from Windows):


%REM

       Agent web-pingSitemap

       Created Nov 11, 2010 by Ferdi Verlaan/Aas

       Description: Pings the sitemap to Google services

%END REM

Option
Public
Option
Declare

Sub
Initialize
       
Dim result As String
       result = pingSitemap(
"http://www.google.com/webmasters/sitemaps/ping?sitemap=http://www.domain.com/website.nsf/web-GoogleSitemap.xml")
End
Sub

Function
pingSitemap(strUrl As String) As String
       
 
       
Dim oHTTP As Variant
       
Dim strReturn As String
       
       
Set oHTTP = CreateObject("Microsoft.XMLHTTP")

       oHTTP.open
UCase$("POST"), strUrl, False, "", ""
       oHTTP.setRequestHeader
"Content-type", "application/x-www-form-urlencoded"
       oHTTP.send(
"")
       
       pingSitemap = oHTTP.responseText

       
Set oHTTP = Nothing
       

End
Function

Good luck with implementing this on your own website.
    Bookmark and Share

Custom 404 errorpages with Lotus Domino

Ferdi Verlaan  November 2 2010 12:10:14 PM
Although we try to prevent it, it is always possible to have deleted or moved content within your website. In Apache you can easily create custom 404 pages. In Lotus Domino it is just as easy!

Create a new form within your website application (website.nsf) with the name and alias: "$$ReturnGeneralError".


Image:Custom 404 errorpages with Lotus Domino

Just place all your html code within this form to resemble your own website look & feel. We also place a custom google javascript to ensure users can search within our site for the missing content. Just place the following code in your html:


<script type="text/javascript">

var GOOG_FIXURL_LANG = 'en';

var GOOG_FIXURL_SITE = 'http://www.example.com'

</script>

<script type="text/javascript"

src="http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js">

</script>


This widget automatically provides suggestions or alternatives for the missing content, based on the Google index of your website. Visitors can now find the missing information more easily. From our own experiments it seems that the sitemap and closest match functionality wasn't available. This is probably because of the fact that our website isn't indexed completely by Google at the moment.


Image:Custom 404 errorpages with Lotus Domino
    Bookmark and Share

SEO optimization for Lotus Domino websites

Ferdi Verlaan  October 28 2010 05:19:52 PM

We have launched our new website a few months ago, and had training by Alain Sadon, an
SEO Guru. After training my hands were itching to optimize our own website. Although the basic setup of our new website was good, there were a few optimalizations to be done. One of them was to implement a clean hierarchial path to the content.

Previous setup

I’ve already set up the website in the following manner: website.nsf/view/pagename
The view contained all the documents sorted by key and pagename was the actual key. It delivered a construction where a hierarchy was only two elements deep, for example:

website.nsf/products/coolproduct1

website.nsf/services/coolservice1

If I wanted to add specs to the cool product (ex: website.nsf/products/coolproduct1/specs), the hierarchy in Domino couldn't go deeper. At least, that was my initial assumption. After some reading and some testing I’ve come up with another construction.


New setup

In the website form I already had a field ‘key’, which contains a userfriendly alias for the document, for example  ‘coolproduct1’. I’ve also setup a button where the user can select which parent the current document has. After selecting the parent, a field parentunid is filled with a unique id.  After that I’ve created a computed field called ‘urlkey_seo’ which contains the following formula:



punid := parentunid;
pkey := "";


@While(punid != "";

pkey :=  "/" + @GetDocField(punid;"key") + pkey;

punid := @GetDocField(punid;"parentunid")

);


@LowerCase(pkey + "/" + key)


In essence, the formula loops through all parents and gets the field ‘key’ and separates the entries with a slash. Then I created the SEO template view ‘vw-tpl-SEO’ with the alias ’SEO’ which is sorted on the first column, with the value of the field ‘urlkey_seo’. Below a subset of the hierarchy of our corporate website.


Image:SEO optimization for Lotus Domino websites

To be able to open a document by key with a slash in it you have to add ‘?OpenDocument’ after the key: website.nsf/products/coolproduct1/specs?OpenDocument where ‘products/coolproduct1/specs’ is the key. But this isn’t the SEO way to go. We need to remove the '?OpenDocument ' and remove the .nsf in the path. For that issue we have the Domino subsitution rules on the server.


Substitution rules

Launch your Domino Administrator, go to the tab ‘Configuration’, in the tree select ‘Web’ \ ‘Internet sites’. In the middle you will see the website documents created for your websites. There we make three rules to keep our entire website working (our website.nsf  is located in the root, but could be used with deeper directory paths as well). Create a new website rule from within your website document with ‘Web site’ > ‘Create rule’.

Image:SEO optimization for Lotus Domino websites

First rule:

Type: Substitution

Incoming URL pattern:  /website.nsf/*

Replacement pattern: /website.nsf/*

Second rule:

Type: Substitution

Incoming URL pattern:  /*

Replacement pattern: /website.nsf/*

Third rule:

Type: Substitution

Incoming URL pattern:  /*/*

Replacement pattern: /website.nsf/SEO/*/*?OpenDocument

The first rule is to ensure our old links, that we don’t get a lot of 404’s. The second rule is to redirect the homepage (/website.nsf), since the third rule will mess that up. The third rule is the most important, it will replace all incoming paths to the newly created SEO view and fills in the wildcards with our 'urlkey_seo' value. The need of the double /* is again for the homepage, Domino doesn’t see the difference for a / or a /* in the incoming url pattern, and you will get a exception error that /website.nsf/SEO/?OpenDocument is not valid.


Screenshot of our substitution rules:

Image:SEO optimization for Lotus Domino websites

Restart the http task on the server and our new hierarchy
www.domain.com/products/coolproduct1/specs is working. You can go as deep as you want because of the wildcard(s).

Images

With the above rules in place a /$FILE/attachmentname.jpg will result in a error. Because of the substitution it will append ?OpenDocument, and will result in an error. Therefor setup a new website document (ex: images.domain.com) and link to that path for your images. It will also give you an small improvement on your ratings, since Google appreciates cookie-less domains for images.

To see the whole thing in action, take a look on our new corporate website (only Dutch at the moment) at
www.aashq.nl.


Next step is to optimize the default IBM blog for use with the above principle. We will post a new entry when we got that fixed.


Interesting links

Other interesting websites for SEO optimalization for Lotus Domino websites:

Codestore: http://www.codestore.net/store.nsf/unid/BLOG-20100617-0347

Domino Guru: http://www.dominoguru.com/pages/08112010083541.html

    Bookmark and Share

Enable Eclipse plugin installation in Lotus Designer 8.5.2

Ferdi Verlaan  October 27 2010 11:00:14 AM
After reading the excellent article by Rishi Singapore how to Install Subclipse for Domino. In his post he talked about that to enable this feature you need to add following line in plugin_customization.ini file which is located at \Notes\framework\rcp path.

com.ibm.notes.branding/enable.update.ui=true


After doing that and restarting the Lotus Notes client + designer, still no options under File > Application > Install.


This behaviour has changed in 8.5.2, for Domino designer 8.5.2 you have a nice little option in the preferences:


Image:Enable Eclipse plugin installation in Lotus Designer 8.5.2

Voila, Subsclipse can now be installed! SVN support in Lotus Domino Designer!

    Bookmark and Share