Categories
Lotus

Validation of an Edit Box control in the XPages

In the XPages the “Edit Box” controls have some settings that allow you to perform simple validations.
These settings are under the label “Validation” of the control and depend on the value of “Display Type” under the label “Data”; in the figure you can see a screenshot of the validation of an Edit Box control of type String
validation

The result of the validation if negative can be shown on the page from the controls “Display Error” and “Display Errors”.

Categories
Lotus

Buttons for a view in a Custom Control

There are standard buttons that are often added to a view that perform the basic functions (new, delete, refresh) that usually you put in a view.
The code in this post is a Custom Control you can add to a XPage bound to a lotus view to insert the buttons New, Delete and Refresh.
This is also an example about how to pass values from a XPage to a Custom Control using the Custom Properties and the object compositeData.

Categories
Lotus

Buttons for a form in a Custom Control

There are standard buttons that are often added to a form that perform the basic functions (edit, save, close) that usually you put in a form.
The code in this post is a Custom Control that you can add to a XPage connected to a lotus form to place the buttons Edit, Save and Close.
In the XPage under the label “Data” configure “Data sources” to the form lotus and under the label “XPage” set the “Next Page” as follows:

Categories
Lotus

Exporting a lotus view to excel

In this post I explain how to export all the documents in a view of a lotus database to an excel spreadsheet using the library Apache POI.
It is a very simple example that exports the string for each column in the view for every document, but you can add other features such as the formatting of the cell contents, or other features of excel.

Categories
Lotus

Passing information about UI objects to a java agent

The lotus java agents don’t have classes to manage the UI objects, such as in LotusScript with the classes NotesUIDocument or NotesUIView.
It’s true that you can find several info about the Notes Client Java UI API in internet, but these classes are not officially supported.
In this post I explain 3 ways to obtain the currently open view or document inside an agent java.
You take advantage of the LotusScript UI classes that can easily manage the UI objects, and you pass them to the java agent using the variables in the notes.ini or a profile document or a notes document.

Categories
Lotus

The Dojo attributes toolbarType and toolbar of a Rich Rext control in the XPages

The Rich Text control of a xpage is derived from CKEditor from lotus 8.5.2, however in previous versions it was a Dojo rich text editor.
A CKEditor control just created in a xpage doesn’t have Dojo attribute explicitly defined as shown in the figure below:

Categories
Lotus

Displaying errors in xpages

During the development of a lotus application with XPages is very useful to show the runtime errors on the XPages, to enable this feature check the “Display XPage runtime error page” under the tab XPages in Application Properties as shown below:

Categories
Lotus

Lotus designer client slow

If your lotus designer client is slow opening design elements, try to exclude the lotus directory from the antivirus scan in real time.

Categories
Lotus

Getting the list of users belonging to a role

Lotus provides the method QueryAccessRoles of the NotesDatabase class to get the roles of a user and there are no methods to get users belonging to a role, but you can get them by combining IsRoleEnabled of the NotesACLEntry class with the function getUsersByGroup that I wrote in a previous article.

Categories
Lotus

Getting the list of users belonging to a group

There is not a method in lotusccript to get the list of all users belonging to a group, and to complicate matters, groups can contain other groups as members.
To solve this problem I wrote getUsersByGroup function that returns the list of users belonging to a group, provided that:

  • the public names.nsf is accessible
  • users have a document “Person” in the public address book
  • groups are defined in the names
  • the maximum number of nested groups is 100, but you can change this setting changing the variable maxNestedGroup