XPages Web Analytics custom control on OpenNTF

What a great weekend for open source contributions from me! 🙂 Yesterday I created the XPages SEO custom control – and today I have created a new XPages custom control for the OpenNTF development contest called XPages Web Analytics custom control: the custom control makes it easy to add web analytics to your XPages web site.

In the first release the custom control supports Google Analytics and Woopra Web Analytics.

In order to use the custom control you download it from OpenNTF, unzip the downloaded file and open the included Notes database. In the database you will find a custom control called “WebAnalytics” that you can include in your own XPages application. Once included you just drag the custom control to your XPage and add the custom properties for the specific web analytics providers that you would like to use.

XPages SEO custom control on OpenNTF

I have contributed to the OpenNTF development contest by creating an open source XPages Custom Control for Search Engine Optimization (SEO). The custom control makes it easy to add the following search engine friendly tags to your XPages web site:

  • page title
  • meta description
  • meta robots
  • meta keywords

With these SEO tags bundled in a custom control it also increases your chances of remembering to add these tags to your XPages web pages 🙂

Installation is easy:
Just download the SEO custom control, unzip the downloaded file and open the included Notes database. In the database you will find a custom control called “SEO” that you can include in your own XPages application. Once included you just drag the custom control to your XPage and add the custom properties for the specific XPage (either as static or computed values).

Controlling the HTTP response status code in XPages

This is a follow-up to my post on how to create custom 404 and error pages in XPages.

A very useful improvement to catching controlled errors such as “page not found” errors is to send the related HTTP status code in the response. So for “page not found” errors the HTTP response code 404 should be sent. This helps search engine crawlers understand that the page is not available whereby the search index can be updated accordingly.

The HTTP status code can be controlled with the facesContext response object by using setStatus. The following code example will generate a HTTP status code of 404 when added to the afterRenderResponse event of an error message XPage. The code example assumes that the source XPage sets the requestScope statusCode variable to “404” if the source XPage fails to find a document:

try {
	// The external context gives access to the servlet environment
	var exCon = facesContext.getExternalContext();

	// The servlet's response, check the J2EE documentation what you can do
	var response = exCon.getResponse();

	// Return HTTP status code 404 if necessary
	if (requestScope.statusCode = "404") {
		response.setStatus(404);
	}

	facesContext.responseComplete();
} catch(e) {
	_dump(e);
}

Client project: XPages CMS for company website

My company PHL Consult completed another client project last week involving XPages. The purpose of the project was to modernize an existing Lotus Domino company website by creating a new XPages solution with a related Lotus Notes client CMS for article editing and related content handling (such as menus, graphics, and meta data) – and by using XPages to allow the website to utilize CSS for cross browser compatibility.

The client is Mediaplus.dk and this is an interesting company that takes advantage of Lotus Notes and Domino to offer a CRM solution called Mediaplus CRM targeted at supermarket and grocery store suppliers.

The Mediaplus.dk website

The design for the website was created by Thomas Arendt from Make Your Mark. Based on his design guide I was then responsible for creating the necessary CSS to allow the design to be implemented. The CSS extends the IBM OneUI v2 CSS (although you need to look in the HTML and CSS source to tell).

The CMS includes functionality to improve search engine ranking by providing a sitemap for e.g. Google Webmaster Tools, by using meta tags such as description and robots and by providing useful page titles. These are all small but useful extensions to a website if you want to improve search engine rankings.

DanNotes – Danish Lotus User Group – 45th conference

DanNotes logo

The Danish Lotus user group DanNotes is hosting its 45th conference on May 11 and May 12, 2011.

I am participating in the conference as a member since PHL Consult is a member of DanNotes. I have created a LinkedIn event for the conference. Will I see you there?

Update May 9: I have accepted to be the moderator for the Developer BOF session on Thursday. I am looking forward to a great discussion of developer topics.

Using ODBC for Lotus Domino 32-bit on Windows Server 64-bit

A friendly reminder: if you are running Lotus Domino 32-bit on a Windows Server x64 (64-bit) and need to use ODBC, then you need to define your ODBC data sources in the 32-bit ODBC Administrator program – and not in the standard 64-bit ODBC Administrator program. This is because the Lotus Domino ODBC drivers are 32-bit.

The 32-bit ODBC Administrator program is located at C:\Windows\SysWOW64\ODBCAD32.exe.

Excel automation on Windows Server 2008 x64: solution to SaveAs method problem

A customer of mine uses Lotusscript and the Microsoft Excel object to create Excel spreadsheets with scheduled agents. The code is based on the normal way of creating spreadsheets – e.g.:

Set ExcelApp = CreateObject("Excel.Application")
Set ExcelWorkbook = ExcelApp.Workbooks.Open("C:test.xls")
Set ExcelWorksheet = ExcelWorkbook.Application.Workbooks(1).Worksheets(1)

The scheduled agents worked fine on a Windows Server 2003. The application was then installed on a freshly installed Domino server running on a freshly installed Windows Server 2008 x64 (64 bit) and then the scheduled agents started failing with the following error message: “SaveAs method of Workbook class failed“.

After several tries of fixing the code I finally found the simple (but unexpected) solution to the problem: create a folder called “Desktop” in C:\Windows\SysWOW64\config\systemprofile\.

Yes, that’s it! just create the folder and then the code starts working again 🙂

Client project: XPages CMS and web shop with card payment

A project for one of my clients went live last week. It’s a portal on heart failures and defibilator products with a related web shop where you can buy automated external defibrillators (AEDs) and accessories. The portal is in Danish.

My company PHL Consult was responsible for the implementation of the portal while Supermouse design studio was responsible for the design.

The portal is built entirely on Lotus Domino XPages and features a content management system (CMS) and a web shop.

The CMS is controlled from the Lotus Notes client.

The web shop is integrated with the client’s existing backend product catalog, CRM and ordering system which runs as standard Lotus Notes client only applications on an internal Lotus Domino server. Furthermore, the web shop is integrated with a payment card gateway from the Danish provider DIBS. The use of a payment card gateway effectively shields off the PCI requirements on e.g. encryption of card numbers from the shop and the client.

I am now an IBM Certified Application Developer – Lotus Notes and Domino 8.0

I passed the IBM Lotus Notes Domino 8 Application Development Update exam (LOT-801) today and have thereby upgraded my certification to IBM Certified Application Developer – Lotus Notes and Domino 8.

I primarily used the Lotus Notes/Domino 8.0 release notes and the Notes/Domino Designer 8.0 Help and also the LOT-801 practice test from CertFX. The 801 test has a lot of focus on Domino on DB2, Composite Applications, and Web Services. I can – once again – highly recommend using a practice test as it gives you a good indication of how the actual test will be structured. Good luck if you consider taking a certification test.

I can now look forward to the LOT-951 test to achive the 8.5 certification – and then later the necessary test to achieve the Advanced 8.5 certification.