Category Archives: XPages

Using HTML5 Notification API in XPages

HTML5 introduces Web Notifications API which “allows alerting the user outside the context of a web page of an occurrence, such as the delivery of email“. This opens up quite a few possibilities for developers like alerting a user when a document needs approval irrespective of the XPage he is currently on.

In this example I will use the Extension Library control Remote Service to poll a view to check if any documents require approval and if yes then show notification to user.

Remote Service control

The Remote Service control allows calling SSJS code from client side JavaScript code without a full page refresh. Instead the output of the SSJS code is returned asynchronously. Tim Tripcony gave a beautiful explanation here on how this control should be used and its usage scenarios.

You can find the Remote Service control under Continue reading

Share:

Give Web Site Rules a Little Help from XPages and Help your SEO

Domino Web Site rules have been around since long before XPages.  The Domino Administrator guide defines Web Site rules as follows:

Web Site rules are documents that help you maintain the organization of a Web site. They have two main uses:

  • Enable the administrator to create a consistent and user-friendly navigation scheme for a Web site, which is independent of the site’s actual physical organization.
  • Allow parts of the site to be relocated or reorganized without breaking existing links or browser bookmarks.

The definition from IBM says that there are “two main reasons”. But if you are familiar with Web Site rules you know that they can also be used to provide connectivity to resources on the file system as well as manipulating the response headers. Those are excellent capabilities and were sorely needed. But in this article we are going to focus on the primary definition provided by IBM and how XPages can provide a little extra help where the Web Site rules begin to conflict and fail.

Web Site Rules Brief Overview

Domino offers four different types of Web Site rules:

  • Substitution Rules
  • Redirection Rules
  • Directory Rules
  • HTTP Response Header Rules

This article will focus on the first two types of rules.   Continue reading

Share:

Meaning of CLFAD####E, CLFAD####W in XPages

Many a times during XPages development I have encountered error message like CLFAD####E and sometimes CLFAD####W. The error messages are very cryptic and give very little information and you might see something like this:

SEVERE: CLFAD####E: Exception processing XPage request.

There are time when the # characters get replaced by Continue reading

Share:

Capturing image from camera using getUserMedia() and saving it in a document using XPages

HTML5 introduces a new API navigator.getUserMedia() which allows web applications to access a user’s camera and microphone. This article on HTML5 Rocks and this question on StackOverflow describe how to use it in your web applications.

In this article I will describe how to use navigator.getUserMedia() in your XPage and save the captured image in your Notes document. As of now this demo is supported only on Google Chrome & Mozilla Firefox on desktop and mobile (I have tested it on Andorid only).

HTML5 introduces <video> tag which allow developers access to user’s camera.

Next we need to add <canvas> tag and an <image> tag. The image captured from user’s camera is drawn on to <canvas>. We then get the Base64 encoded image from <canvas> put it into our <image> (JavaScript code to do that comes later in article).


Notice that the <canvas> is hidden.

I am also going to add a text area to my XPage where I will store the Base64 encoded text of the captured image which later would be converted into image using Java (code for that comes later in article). While developing applications you can hide this text area using CSS.

And finally we need a button to take snapshot from camera. Continue reading

Share: