Using the beanNamePicker dataProvider for a namepicker

For an application I needed to provide a namepicker with data from a NotesView. Unfortunately I could not use the default dominoViewNamePicker option as the data provider because the column to select from may not be a multi-value field or contain multiple fields. 😕

A search on google provided me an example how to use a beanNamePicker that will read the data from Domino Directories.

I created a GIST for the XPage: https://gist.github.com/PatrickKwinten/0bcc951a8eb1f5ef287c0c9b05a535a3 and for the Java class it uses: https://gist.github.com/PatrickKwinten/4aa15ea09717833bcc9fd1a941d9e5a8 .

Basically here is how you set it up:

<xe:namePicker id=”npDomino” for=”person1″>
<xe:this.dataProvider>
<xe:beanNamePicker dataBean=”org.wordpress.quintessens.demo.app.NamePickerDirectory”
loaded=”true”>
</xe:beanNamePicker>
</xe:this.dataProvider>
</xe:namePicker>

Key is that you return an object of type SimplePickerResult containing a list of objects of type <IPickerEntry>.

For my case I needed to go to a view where all the activities for users for the application where logged. Again I used a similar setup:

<xe:namePicker id=”npDomino” for=”person1″>
<xe:this.dataProvider>
<xe:beanNamePicker dataBean=”org.wordpress.quintessens.demo.app.NamePickerView”
loaded=”true”>
</xe:beanNamePicker>
</xe:this.dataProvider>
</xe:namePicker>

But now I go to a different class which I created a Gist for: https://gist.github.com/PatrickKwinten/c3580344a48704b3589251c0d5bbb8e5 .

Key difference is that my data source has become a Notes view and I check the type of column (columnValue instanceof String, ArrayList, Vector) because I have different type of fields and values in my first column.

So once you understand how you can extend the basic functionality within XPages you gain much flexibility and new opportunities with out of the box controls.

Please IBM provide us with more examples!!!

IBM Champion Nomination

Is this blog-article useful to you? Perhaps you can nominate me as IBM Champion.

 

 

Advertisements

Java and XPages

I still meet Domino developers who want to use XPages in the way IBM told them how to use it. Completely wrong I would say. Now that you have to chance to learn Java skills – EMBRACE IT!

Okay the other way around is sometimes a pain in the ass and complete examples are scarce but it gives you a better way to control your application and it’s behavior. After a while you get better understanding of the underlying technique and there is nothing wrong with that.

At the end it is mostly about creating, reading, updating and deleting stuff.

So for those developers I have setup a simple presentation to get a better understanding of JSF, Java and XPages:

DDE does disruption (4) – xHausting

Yes, DDE is disruptive again!

Today I wanted to copy some code from one application into another, straight via DDE, an a phenomena that I experienced earlier occurred again:

Most XPages and Custom Controls became signed with my Notes ID

With most I mean ALL XPages (20) and most Custom controls (31 out of 34). All other design elements in the NSF (forms, views, pages, agents, script libraries, java design elements, java libraries etc were untouched.

At the moment I had only open: one server-side JavaScript library and one XPage.

Do you have any explanation for this?

I am running 9.0.1 FP 9.

DDE does disruption (3) – Perhaps DDE is not build for it?

I am still complaining about DDE because I am facing the following situation:

I am working with a colleague on a project. Our code resides in a central repository on TFS. We both develop with a local clone and we sync towards our own NSF on a Domino server where we do our development work. The problem  is that she is unable to build the project and have her NSF running. I do not have those problems but perhaps that is because I have written most code lately. When I build HER NSF, the application WILL run.

We have a similar setup (version DDE, installed plugins).

When she performs a clean, build, refresh she does not get errors or anything whatsoever. What might cause that her build process does not succeed or complete?

DDE does disruption (2)

For some reason I was unable to open JavaScript libraries in the JS editor in DDE. It concerned both client- and server-side libraries. LotusScript and Java libraries I could open just fine.

The only thing I could see was this:

The problem was not concerned all databases, but at least the problem was consistent in multiple NSF’s. Building and refreshing the project no effect. Also removing the applications from the workspaces, restarting DDE and re-opening the NSF’s did not change the editor’s behavior.

At this point I was getting a bit annoyed. Colleagues reported similar problems in the past but none had a suggestion other than re-installing the client.

So I let my stubbornness win and installed Feature Pack 9 instead. After 10 minutes (!) the installation was complete so I started DDE and opened the unwilling script library. Hurraaaah! The problem was solved, I could see the code in the editor.

However I noticed some missing in DDE: the nice Swiper 2.0.1 toolbar buttons where gone! So I removed the files from the notes/data/workspace/applications folder, downloaded Swiper from OpenNTF again and installed them. Back to normal. Well not quiet yet.

When working on an XPage I noticed that all the plugins I was using where not recognized anymore. For example the Debug Toolbar plugin. Again, I could not see the plugin disabled under Application Management. So I removed the files, downloaded the plugin from OpenNTF and re-installed it. Now the plugin was visible again in DDE.

So the feeling I am left with is that this Superhuman Software is not so Superhuman anymore.

Adding fontawesome to bootstrap alerts

In an XPages application I wanted to add some house-styling to a validation alert box. By default you do not get icons with Bootstrap alerts as in the IBM’s OneUI messages box.

So what do you when you want to have best of bot worlds? You blend in Fontawesome!

Navigate to any of the icons you want to use from fontawesome and search for the unicode of it. For the exclamation icon http://fontawesome.io/icon/exclamation-circle/ that is f06a.

Next open your style sheet and add the following lines:

ul.text-error {
list-style: none;
padding: 0;
}
ul.text-error > li {
padding-left: 1.3em;
}
ul.text-error > li:before {
content: “\f06a”; /* FontAwesome Unicode */
font-family: FontAwesome;
display: inline-block;
margin-left: -1.3em; /* same as padding-left set on li */
width: 1.3em; /* same as padding-left set on li */
}

For the content property add the unicode as demonstrated above. When you look at the alert in your browser the icon is applied e.g.:

 

DDE Does Disruption

This week we received an incident about an application that was not accessible any longer. It turned out that all the design elements where signed with my Notes ID which has (of course) insufficient rights to run in the Production environment.

The curious case here is that nobody intentionally replaced or refreshed the design of the application.

The application still had the “inherit design from template” option enabled. However the template resides on a different server and there is no replication between the Production and this staging server.

I know I have the two databases somewhere in a Working Set in my Domino Designer so most obvious option for the design refresh must have come from my workstation even though I have not worked with these applications this week .

Have you experienced something similar also? What was the cause?

Source Control disruption in DDE

In a project me and my colleague faced major complications working towards a GIT repository on TFS. In short: she did not see the changes I had made in her Domino Designer even though her GIT client had transferred everything correctly to the On Disk Project (ODP) on her local drive.

It seemed that the problem was totally focusing on her development setup. For the good order here is how our both environments look like:

  • Me: TFS, SourceTree, Domino Designer FP8.
  • Colleague: TFS, Visual Studio, Domino Designer FP8.

As a result we are facing major delay in the project because we can’t rely on the setup so we are 50% developer resources short.

So in order to test our bad experiences we sat up a small test with some other colleagues to see if we could reproduce the disruption and allocate where it occurs.

We had no particular test script in mind. We just sat up a new repository on TFS, we cloned it locally with different GIT clients, imported the ODP’s in DDE, created new NSF’s from it and we started to make changes in them.

Luckily for us a new disruption appeared fairly quickly. Changes made by two of my colleagues did not appear in my NSF but they could see each other changes.

It turned out that the changes where in my ODP but DDE was not able to transfer them in the NSF.

Here are some dumps that shows the situation. The use of capitals in the H2 element are not similar.

XPage in DDE:

XPage in ODP Project in DDE:

Same XPage in ODP on local drive:

Removing the imported ODP, removing source control with the NSF, re-importing the ODP in DDE and re-establishing source control for the NSF with the new project caused that I could see the changes in the NSF. However with the next change which a colleague made we were facing the same disruption on my machine.

For us it clear that this is not a work situation we can trust when DDE is not able to make the transition from ODP to NSF.

Have you experienced the same and have you come up with a work-around?

For us it would mean that we can not complete the DevOps chain that is set for development environments…

XPages sufficient for line of business type of applications?

Hi there, currently I am following another Angular course since it seems to have become the leading development framework at work. So back to learning all the rules within Angular.

At the moment I am modernizing a Domino application with the help of XPages which:

  1. Implements Model-View-Controller architecture, mostly inspired by the guys at Pipelia since IBM never told us to do so.
  2. Is written in Java to support the MVC architecture and to have close integration with XPages runtime.
  3. Is using Expression Language wherever possible to avoid usage of SSJS.
  4. Uses the lifecycle of JSF in XPages at the max.
  5. To cover support for different devices I am using Bootstrap as front-end framework. So I miss some native behavior which I do not tend to cover-up.

So far so good and I think I have come quiet long in my project so I still dare to call it rapid application development.

The code-base has been reduced dramatically and all exotic upcoming JavaScript libraries from the early 2000 I have been able to replace with just XPages. With my latent UX skills and extending the out of the box Bootstrap I might now even call this application ‘sexy’ 🙂

I know I haven’t touched many areas discussed in the XPages community such as:

  • Websockets (I do not see a use-case yet).
  • Writing Java servlets (please pass me a demo NSF).
  • Watson services (cloud is still a sensitive topic).
  • set up micro-services with smartNSF and consume them in my Java code with an mapper library (requires changes in the environment).
  • Integration with IBM Connections.
  • Redefining my data with the help of a Graph DB.

Either I see little usage, it is not possible or there is no-one to guide me (the information is certainly not provided by the vendor).

So now back to Angular. Learning all these rules, technologies and new tools setup I was wondering what new technical options this framework will bring me at work. Reflecting on the type of customer-orders I receive I am wondering:

Is XPages not sufficient for most of your line of business apps?

Perhaps you have a though about this?

Happy development & enjoy your summer 🙂

Where are we?

Today I received a question on a post I wrote some time ago. I had to start up my local development environment just to see if I remembered where I placed the code that was asked for.

So where are we? Or what are we doing?

Still Domino. Still XPages. But then mainly in Java. The story about application development with XPages that IBM did NOT tell you. Why? You may tell.

I was thinking about gathering my past experience and ideas and combine it into a ‘product’ but workload and a private life with small kids is preventing me from this.

OpenNTF? Naaa. Too tired.

CU at Engage? Probably not (I am a developer and development sessions are scarce).

CU at GraphConnect? Good chance!

This blog? Yes, probably some new posts soon.

Something in the pipeline? Yes, tomorrow a presentation for colleagues on using Java in XPages development.

For now: time to watch some CL football 🙂

Capture