Sep 01

underscore JavaScript Library für XPages ServerSide JavaScript (SSJS)

If you’re building web or mobile apps, most probably you know the underscore library from underscorejs.org. If not, you should have a look at it. It contains a lot of useful basic functions that eases developer’s daily work a lot.

Today I had to implement some fancy stuff regarding JavaScript arrays in XPages ServerSide JavaScript (SSJS). And I really missed my beloved underscore library…. so I had a look at the source and tried to use it as library in SSJS.

For sure, it didn’t work right out of the box. There were several issues because SSJS is no real JavaScript… but anyway, I managed to workaround most issues and now it seems to work.

If you’re interested, download this source: jbuss_underscore. Have a look at the notes at the beginning, it listens some underscore functions that cannot work in SSJS.

There is a good chance that some functions doesn’t work yet, if so, leave a comment at this post and I will try to fix it.

If you’re curious: look for “!! jbuss” markers in the code, these are the pieces I needed to change.


Sep 30

Use flowchart.js and raphael.js in XPages – problem and solution

I came across a weird problem today. The task was to use flowchart.js in an XPage to create a flowchart like this:

screenie

So I downloaded flowchart.js, added it to the WebContent folder of the NSF and included it to the XPage using this code:


 

Since flowchart.js is using raphael.js I did the same with Raphaël’s library. Pretty straigtforward, isn’t it?

Unfortunately, it simply didn’t work. Chrome’s console simply told me something about “Raphael is not defined”. So there was some problem with loading the raphael.js, obviously.

First I thought about a charset problem. raphael.js is using some special chars, but the file I downloaded was coded in UTF-8, so it should be fine. On the other hand, when opening raphael.js from the NSF with an URL like “http://host/path/db.nsf/rapahel.js”, Chrome told me it’s in a Windows codepage and there were lots of weird characters.

So I did various tests to investigate further, but to no end. Wether I saved the raphael.js file in Mac or Windows, stored it in WebContent or as file resource or in Domino’s HTML folder, the problem remained.

The customer for which I’m working at the moment found something about the “Raphael is not defined” message at stackoverflow, and the cure should be to use AMD module loading. Due to the charset weirdness I didn’t thought about that proposal very much and continued with the charset investigation… but in the end, I was wrong.

Indeed, raphael.js seems to have problems when loaded after other JavaScript libraries. The following code was suggested at the raphael site:

define([ "path/to/raphael" ], function( Raphael ) {
  console.log( Raphael );
});

Unfortunately, that does not work in XPages wit Dojo. But this combination of traditional loading and Dojo’s AMD loader works for me:


	 
		
		
		 
	

and in the body of the XPage:


After the require the Raphael object exists just fine and can be used by flowchart.js.

I admit that I don’t fully understand what’s going on, since I didn’t used Dojo’s AMD loading much yet. Perhaps someone can shed some more light on this topic 🙂


Sep 23

Some more recent changes in DominoToGo

Beside the multiple category filter feature DominoToGo evolves in other areas, too:

  • The architecture has been re-engineered to use require() and be ready for future Titanium SDK versions (where the Ti.include() call will not be available anymore).
  • When creating a NotesDocument locally in the app, DominoToGo will create a local XML representation of that NotesDocument automatically. You don’t need to upload the data to Domino and download the NotesDocument from Domino in order to work with the NotesDocument in the app.
  • Support for Notes views where documents are displayed multiple times. They can be synchronized for offline usage as every other Notes view now.
  • Improvements for uploading attachments to a Notes document in Domino (for example, take a photo and upload to Domino).
  • As always, even more performance improvements. DominoToGo is the fastest way I’m aware of to synchronize a lot of data to a mobile app.
  • Complete new documentation.

Plus there is a full UI framework for Titanium Alloy now as an option. The framework offers ready-to-use controls for a Domino view, picker dialogs, form fields, validation and more. The documentation for that UI framework starts here.

So, there are new features and improvements – but what’s most important is that the core of DominoToGo is still very stable and reliable. If you want offline first mobile apps, DominoToGo is the way to go.


Sep 23

New in DominoToGo: filter view data by multiple categories

In Notes and XPages you can filter a view by one category using the single category feature. In the most recent version of DominoToGo, one can now use multiple categories to filter a view – again a feature that Notes and XPages don’t offer!

When synchronizing the data of a Notes view to the mobile app, you can now use something like this:

var db = new NotesDatabase("http://acme.com/somepath/database.nsf", "dbid");
var view = db.getView("dataByName");
var callback = function(success, e) {
DTG.log("update completed");
}
view.update(callback, true, "", {
singleCategory: ["Ben Sisko", "Elim Garak", "Worf", "Odo"]
});

Using this feature, you have way more possibilities to filter the data you want to synchronize to the mobile app for offline usage. I wish I would have this feature in Notes and XPages, too 🙂

See the documentation for more.


Jun 05

Why does not everyone use the Ytria tools?

I’m a heavy user of Ytria ScanEZ for years, and I’m using the other tools like viewEZ or databaseEZ occasionally – all in an relatively old version.

Recently, Ben of Ytria gave me a good demo of the most recent versions of all Ytria tools and I’m deeply impressed how many new and incredible useful features went into the products in the last years. I learned that the Ytria tools have many, many features I wasn’t aware of. And every single feature is capable of saving hours or even days of time.

That makes me wonder why there are still Domino developers and admins that are not using Ytria. Do they like to do repetitive, boring tasks? Do they like creating one-time agents just to fix some fields in documents? Do they like to adjust ACLs one after the other? Do they like to be puzzled by replication issues? Do they like to solve conflicts manually?

The list can go on and on. I can only think of one reason why anyone doesn’t use Ytria: because they don’t know what the tools are capable of.

Believe me, I am not paid by Ytria. I am not working for them. I am just convinced. Go, let someone of Ytria give you a demo. It will take some amount of time, but this will be the best amount of time you’ve ever invested.

 

 


Feb 24

Useful tools for Domino Designer, XPages development and automated XPages testing

Note: this post has been migrated from another blog. Some links may be broken.

Holger Chudek of www.perfect-chain.de gave a lot uf useful tips for extending Domino Designer and useful XPages development tools in his excellent session at Entwicklercamp 2011.

In case you don’t know these tools yet, here is a short list:

XPages API Inspector

Tommy Valand published a very useful tool for XPages development: the XPages API inspector allows you for each component on your XPage to see:

– what Java class / type it has
– methods and properties of the the component’s class
– when it’s a JSF related class you get a link to the JSF documentation

Very useful and highly recommended. Download here at OpenNTF.

Performance and memory measures with XPages Toolbox

Philippe Riand and his team published a complete performance measuring tool für XPages at OpenNTF some time ago.

Download at OpenNTF.

See SSJS print statements in local web preview

If you’re developing XPages locally, you can start the local web preview in a seperate window to see output of print() commands.
Start cmd.exe, navigate to your Lotus Notes directory and start

nhttp.exe preview

Then when you click the “preview” button in Designer you can see SSJS print outputs in that window.

Install integrated task management

You can use the Eclipse project “Mylyn” to embed an integrated task managent into your Domino Designer.
With Mylyn you can manage development related tasks right in your Domino Designer. Each task is associated with a code-context, for example an XPage or a CSS file. When you open a task, Mylyn automatically restored the appropriate context (that means, open the XPage, CSS or whatever).

Installation:

  • in Domino Designer: File -> Application -> Install
  • Add a remote update site with this URL: http://download.eclipse.org/tools/mylyn/update/e3.4
  • Select that new update site, click “Finish”, select features and install them.

Click here to open the homepage of Mylyn.

Automated tests for XPages applications

With Selenium you can record test actions on a Website and run these tests automatically. It has a Firefox plugin which is very, very easy to use.

Download Selenium IDE Firefox Plugin here.


Jan 10

(URL fixed!) It’s live! Version Control for Domino Designer, Part 1 — Getting Started in THE VIEW

Note: this post has been migrated from another blog. Some links may be broken.

(Repost due to an URL error on PlanetLotus)

I’m happy that my most recent article in THE VIEW is online:

“Get the peace of mind that comes with having all versions of your code safely stored and readily accessible. Thanks to a new plug-in for IBM Lotus Domino Designer 8.5.2, you can now compare recent versions of your code with older versions and safely return to a working version of your code any time after making changes. In part 1, acquire a grounding in basic versioning concepts and step-by-step instructions for setting up your Designer environment to work with version-control software. Then, in part 2, learn to work with version control in most common scenarios.”


Included in this first article are step-by-step instructions with a LOT of screenshots to setup:


– your own SVN server

– a SVN client for Windows

– all neccessary plugins for Domino Designer 8.5.2


And beside that you learn something about the general idea of a version control system and why you can’t live without it.


Click here to read the article! (and if you don’t have a THE VIEW subscription, it might be worth an consideration since there are a lot good technical articles you don’t find anywhere else…).


Jan 10

It’s live! Version Control for Domino Designer, Part 1 — Getting Started in THE VIEW

Note: this post has been migrated from another blog. Some links may be broken.

I’m happy that my most recent article in THE VIEW is online:

“Get the peace of mind that comes with having all versions of your code safely stored and readily accessible. Thanks to a new plug-in for IBM Lotus Domino Designer 8.5.2, you can now compare recent versions of your code with older versions and safely return to a working version of your code any time after making changes. In part 1, acquire a grounding in basic versioning concepts and step-by-step instructions for setting up your Designer environment to work with version-control software. Then, in part 2, learn to work with version control in most common scenarios.”

Included in this first article are step-by-step instructions with a LOT of screenshots to setup:

– your own SVN server
– a SVN client for Windows
– all neccessary plugins for Domino Designer 8.5.2

And beside that you learn something about the general idea of a version control system and why you can’t live without it.

Click here to read the article! (and if you don’t have a THE VIEW subscription, it might be worth an consideration since there are a lot good technical articles you don’t find anywhere else…).


Jan 07

Upcoming article about version control with Domino Designer in THE VIEW

Note: this post has been migrated from another blog. Some links may be broken.

As a Domino Developer you should now that the dark ages are finally over, since in Designer 8.5.2 we can start using version control with standard version control software like Subversion.

If…

  • you ever wanted to start with version control in Domino Designer, but didn’t had time to dig through the setup yourself
  • you don’t know yet what a version control system is and why you really, really need to use one
  • you don’t know how to setup a SVN server
  • you don’t know how to cover the daily business with version control in Domino Designer

then the upcoming two-part article “Version Control with Domino Designer” in THE VIEW is for you!

The first part will be published in the coming week and covers the setup of an SVN system and the setup of all the neccessary plugins in Domino Designer. The second part will cover how to actually use version control in Domino Designer and how to use version control to improve team development.

So, watch www.eview.com in the coming week for the first part of this article.