DominoJam – The need for an appstore

With a couple of days left to a DominoJam here in Stockholm  was thinking what I think is really desired (perhaps needed) at the moment for development in IBM Notes.

Perhaps besides a stable and enhanced Domino Designer (hint) I would probably benefit most from a real appstore for Domino. With appstore I mean some sort of updatesite provided by IBM.

We all use the extension library in some form, if it the version that is shipped with the Domino server in form of an feature pack or a version that is available via OpenNTF.

Can you imagine starting a project WITHOUT that library nowadays? So this is a practical example of something that is good ON TOP of the Domino server when using it as an APPLICATION DEVELOPMENT platform, so MORE THAN JUST EMAIL.

In the beginning I heard several administrators and hosting companies (including IBM) complaining that they was no guarantee on the library. Well I do not know how many crashed servers you have had due to that extension but I can not remember a single one.

So if IBM would somehow guarantee the quality of plugins on that appstore (do some quality- & security checks and some code review) and there is hardly no argument for administrators not to install of plugins from that appstore (in Production).

An easy install from the Domino console (similar to npm – install) and voila! a plugin is installed. For paid plugins you should provide somehow a registered IBM account (you know how to bill us).

It would also could make Domino more attractive to developers if plugins could become available with a reasonable price (you do the suggestion here).

I do not think that the amount of plugins on the appstore will so overwhelming (lost opportunity?/not the most important) but at least the threshold to have the ability to extend the Domino server for your development projects is much less.

Good initial candidates for the store are:

My apologies if there are OpenNTF projects that I have been using during the years and do not appear in my list. Perhaps some projects could be split up in several projects with dependencies.

My goal would be a quicker, easier, latest (update) installment of stable and secure plugins and perhaps a wider range of offerings. This would enable me to quicker adapt new technologies and perhaps trigger myself to learn how to write an extension one day.

Ending with an adapted famous movie quote:

All right, plugins, plugins, plugins! Come on in plugin lovers! Here at the Titty Twister we’re slashing plugins in half! Give us an offer on our vast selection of plugins, this is a plugin blow out! All right, we got white plugin, black plugin, Spanish plugin, yellow plugin, we got hot plugin, cold plugin, we got wet plugin, we got smelly plugin, we got hairy plugin, bloody plugin, we got snappin’ plugin, we got silk plugin, velvet plugin, Naugahyde plugin, we even got horse plugin, dog plugin, chicken plugin! Come on, you want plugins, come on in, plugin lovers! If we don’t got it, you don’t want it! Come on in, plugin lovers!

 

Or more decent (from a colleague) :

When you roast old bread it becomes tasteful again.

Happy DominoJam 🙂

A happy camper?

Advertisements

A day lost due to DDE incapabilities

Today I lost a complete development day due to errors related to DDE. After building a project I constantly get errors as followed:

HTTP JVM: com.ibm.xsp.webapp.FacesServlet$ExtendedServletException: javax.faces.el.EvaluationException: java.util.MissingResourceException: Can’t find resource for bundle java.util.PropertyResourceBundle, key strings

and:

HTTP JVM: java.lang.SecurityException: Error verifying signature for resource WEB-INF/classes/se/acme/namis/app/Application.class. For more detailed information, please consult error-log-0.xml located in E:/IBM/Domino/data/domino/workspace/logs

The way I am forced to work now is to clean the project, build the project, sign the complete database, PRAY.

Is there no way to build an XPages project OUTSIDE of DDE?

This is no workable way of developing anymore.

XPexit?

Passing a SSJS function to a custom control

Introduction

I am building a custom control that mimics the viewPanel control but it is a repeat control which data is not a view but a managed bean that returns an arraylist of java objects (representing Notes documents).

I am using a Bootstrap table for display I in a previous post I have demonstrated how I can provide a JSON object to have flexibility in the columns I want to display and the values I want to display.

Next step is the option to provide custom actions to the custom control, in a way that the code under an action button in the custom control is provided via a property. So in one case hitting the button could print all selected documents, in the other case it could remove all documents from the database.

Step 1 – Creating an arraylist of unid’s

Key here is that I have an arraylist of unid’s to work with. The technique how to select documents in a repeat control was demonstrated by David Leedy in Notes in 9 episode 25. Instead of buttons I use a checkboxgroup:

So now I want from my xp:button in my custom control do something with this arraylist of unid’s…

Step 2 – set up the property definition

Next step is to setup the property in the property definition of the custom control:

Not the most common type of class and editor you use for a property.

Step 3 – setup the event handler for the button

In order to have the button to understand that the action to be performed is coming from a action property we need to specify that in the onClick event:

(Note: my property resides in the group property actionButton)

Step 4 – set up the SSJS  function you want to run

So now our button knows it’a action comes from a propert we need to write the SSJS function for the button. I have placed it in a SSJS script library. Here is an example to remove documents from a database:

Step 5 – Add the SSJS to the property

The last step is the most tricky one. In the property you are not allwed to provide any parameters or parentheses for the SSJS function. So our action property becomes as followed:

Result

As a result I have the following UI:

  • A custom control with a button which onClick action is provided via a property on that host xpage.

IBM Champion Nomination

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

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.

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.:

 

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 🙂

Display JSON pretty in a textarea control

In an application I am using heavily JSON default as the data-format. To make debugging a bit more easy I am working on a toolbar to be able to check the content of the JSON objects.

Normally I use JSONLint most of the time to prettify (and validate) the JSON so it becomes a bit easier to read and check. But this copy and paste habit becomes more and more obnoxious so there I wanted to have a toolbar (like the debug toolbar) to have a good overview of the JSON objects.

However if you write the JSON object to a computed field or text area field (inputTextarea control in the XPages world) it is just plain, unformatted text. Not pretty for the eye and not much helpful for the brain.

So I tested a simple approach which turns out to run just fine. I display the json object in a textarea input control and then with CSJS I format the content. Here is some sample code:

<xp:inputTextarea id=”input-fieldx” defaultValue=”#{javascript:App.currCollection}”>
</xp:inputTextarea>
<xp:button value=”Make Pretty” id=”button1″>
<xp:eventHandler event=”onclick” submit=”false”>
<xp:this.script>
<![CDATA[var name = x$(‘#{id:input-fieldx}’).attr(“name”);
prettyPrint(name);]]>
</xp:this.script>
</xp:eventHandler>
</xp:button>
<xp:scriptBlock id=”scriptBlock1″>
<xp:this.value>
<![CDATA[function prettyPrint(id) {
var obj = dojo.byId(id);
var ugly = obj.value;
var json = dojo.fromJson(ugly);
var pretty = JSON.stringify(json, undefined, 4);
obj.innerHTML = pretty;
dojo.setAttr(id,”rows”,10);
}]]>
</xp:this.value>
</xp:scriptBlock>

Here is what it looks like:

json-before

The content how it looks initially.

json-after

The content how it looks like after running the code.

Note I had to include the [ ] signs in my code to make the JSON valid due to circumstances in my code, I removed it from the sample code above.

At least now I understand my JSON objects again and I can avoid some copy and paste to JSONLint 🙂

This is probably my last blog of this year so I would like to wish you some wonderful Christmas days. Take care and best wishes for a healthy 2017!

 

 

Adventurer

I have always known that I am an adventurer. My Lotus/IBM Notes career started as a adventure into an international professional working-experience and the people who know me will probably say that it will be very hard to make an ordinary “9 to 5” office guy out of me.

I could never resist the call of the trail – Buffalo Bill

So far about me as person. The occasion of this post are several calls in the community to take a look at Salesforce as an application development platform.

So I took the time to take a look at it to find out if it would be of interest of me. As suggested my journey started with Trailhead. My journey, so far has lead me to finish the developer beginner trail.

I will write about my first experience and will not do any comparison, simply because my knowledge on Salesforce is limited to do so.

If you read this trail description it tells you it will take you up to 15 hrs and 45 minutes. Well I can tell you: it took me much more time. There is a LOT of text to read, video’s are  included and there are challenges to complete modules and to earn points for badges. A challenge can be a list of questions or an exercise.

So let’s assume all the effort and time-investment does contribute to your understanding of the platform.

Before starting, a couple of developers told me about the similarities with Notes and XPages and I have to say it is nice to recognize that building XPages applications have brought Notes developers closer to genuine application development (as far as it compared with Salesforce).

Salesforce biggest ugliness at start is of course it is not NonSQL as Notes is.

A nice feature is Salesforce web enabled development interface. I have not come to the Eclipse IDE yet. I have used the classic web interface, since in Trailhead the examples and screenshots are from the classic interface. I can not say I am in love with a web interface since I noticed some genuine lags compared to the XPages IDE (autocomplete for example). Also getting into read mode after performing a save action I found annoying.

I admit there are similarities programming in Salesforce compared to Notes and XPages, but I guess this comparison is similar with other programming languages. When it regards to building custom user interfaces Visualforce reminds me a lot about XPages.

So after completing this first trail I find the learning curve not that steep. Using Trailhead is just very time-consuming. An instructor or video-learning would have been much more time efficient. But if you want to gain some deep knowledge it doesn’t hurt to spend time on the approach.

A quote I heard is that Salesforce is the platform Notes should have been (if IBM would have prioritized it more) and that there are many more goodies to be found in the trail Develop for Lightning Experience so I am looking forward to take another hike. Ofcourse with my newly earned Adventurer badge on my backpack 🙂