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:

Using Validation and Vibration API in HTML5

HTML5 provides bevy of features which enable developers to build some really interesting applications. In this example I will build a small HTML5 based validation which will vibrate the mobile device in case of invalid input.

Validation API

Validation in HTML5 is as simple as adding an attribute. Just add the required attribute and you are good to go.

In the above code snippet the text field is required and browser supporting this attribute will not let you submit the form if the field value is empty.

Now we need to check if the user has entered valid value in the field or not. It he hasn’t then we vibrate the mobile device. To check it in JavaScript use the statement input.validity.valid. This returns true in case valid value is entered in the field else returns false. In case its invalid you can then vibrate the mobile device using Vibration API.

Vibration API

This article describes Vibration API and how easy it is to implement.

First you need check if the device supports Vibration API 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:

XPages: Make your PhaseListener Thread Safe

When implementing a JavaServer Faces (JSF) based framework for your XPages, you may decide to use a PhaseListener, or two, or three, or any number you want. PhaseListeners can be very powerful tools to help perform centralized processing for your application. Before we dive into the main topic of this article, it may be helpful to provide a base understanding of PhaseListeners and how to define one. If you already know how to use a PhaseListener then feel free to jump the next section.

What is a PhaseListener and how would I use it?

As JSF processes requests it fires specific events. These events are called Continue reading

Share:
Page 1 of 612345...Last »