wissel.net

Usability - Productivity - Business - The web - Singapore & Twins

By Date: July 2015

Adding Notes data to Websphere content manager via RSS


Websphere Content Manager (WCM) can aggregate information from various sources in many formats. A quick and dirty way to add Domino data is to use RSS. The simplest way is to add a page (not an XPage, a Page), define its content type as application/rss+xml and add a few lines to it:

<rss version="2.0">
 <channel>
  <title><Computed Value></title>
  <link><Computed Value>feed.xml</link>
  <description>Extraction of data from the Audience Governance database</description>
  <lastBuildDate><Computed Value></lastBuildDate>
  [Embedded view here]
 </channel>
</rss>

Thereafter create a view with passthrou HTML with all the values for an item element. Of course that is super boring, therefore you can use the following code to speed this up.

Read more

Posted by on 27 July 2015 | Comments (0) | categories: IBM Notes Java

Midget Imaginaire - Scheinzwerg


The imaginary midget

This is an attempt to transpose a concept deeply rooted in the German cultural context into another language. Bear with me.
Over at Omnisophie Professor Dueck has a column titled " Scheinzwerge" (loosely translated: imaginative dwarfs|midgets|gnomes), dealing, besides others, with the Greek crisis.
It draws heavily on a very German childhood classic " Jim Button and Luke the Engine Driver". In this famous children book and string puppet play we meet Mr. Tur Tur who is a imaginative giant (Scheinriese). From a distance Mr. Tur Tur looks like a huge giant, but the closer you come, the more normal he appears until you close enough to see that he's a normal person.
Now the "Scheinzwerg" in Dueck's article is just the opposite: the further away you are the smaller it appears. Once you are close, you see the real dimension, which tends to be way bigger than estimated, imagined or even feared.
In real life that doesn't refer to people but rather tasks, problems or missions.
We are all familiar with "Scheinriesen", that impossible huge looking task (learn to swim, to cycle, to play an instrument, or ask for permission), that shrank when we got close.
The other type is as common, but hidden in plain sight. So I shall name it " Midget Imginaire", short   MI - which is the accepted abbreviation for what it turns into when getting close enough: "Mission impossible". Now if you happen to be Ethan Hawke, all is good. For the rest of us some samples:
  • We will grow double digits, faster than the market
  • Just change the application architecture the week before life
  • The [insert-crisis] can be easily solved by [insert 140 characters or less]
  • They are just 5 little changes, the deadline must not  be moved
  • Become world champion, we know how: run 100m in 8 sec
  • Hire 9 women to give birth to one child in a month
The MI are the single biggest source of eternal tension between management (corporate and political) and executing experts (anyone: " I don't want to hear problems, I want solutions, you have 10 minutes").
Since management has (necessarily?) distance to operations (the big picture needs a vantage point to be seen), a lot of MI appear really tiny (just lets hire the right talent, never mind that pay, reputation and markets that don't have them available to us) and stuttering in execution is interpreted as incompetence or defiance.
In return the "Gods from Olympus" are seen as living in heavenly spheres (also known as management reality distortion field).

The solution is simple (I hope you can see the irony in this statement): We need to add "watching out for Midgets Imaginaire" to our professional portfolio of conduct.


Read more

Posted by on 15 July 2015 | Comments (0) | categories: After hours

Validating JSON object


One of the nice tools for rapid application development in Bluemix is Node-RED which escaped from IBM research. One passes a msg JSON object between nodes that process (mostly) the msg.payload property. A feature I like a lot is the ability to use a http input node that can listen to a POST on an URL and automatically translates the posted form into a JSON object.
The conversion runs non-discriminatory, so any field that is added to the form will end up in the JSON object.
In a real world application that's not a good idea, an object shouldn't have unexpected properties. I had asked before, so it wasn't too hard to derive a function I could use in Node-RED:
Cleaning up an incoming object - properties

this.deepclean = function(template, candidate, hasBeenCleaned) {
   var cleandit = false;
   
   for (var prop in candidate) {
    
    if (template.hasOwnProperty(prop)) {
     // We need to check strict clean and recursion
     var tProp = template[prop];
     var cProp = candidate[prop];
     
     // Case 1: strict checking and types are different
     if (this.strictclean && ((typeof tProp) !== (typeof cProp))) {
      delete candidate[prop];
      cleandit = true;
      
     // Case 2: both are objects - recursion needed 
     } else if (((typeof tProp) === "object") && ((typeof cProp) === "object")) {
      cleandit = node.deepclean(tProp, cProp, (hasBeenCleaned || cleandit));
      candidate[prop] = cProp;
     }
    
    // Case 3: property is not there 
    } else {
     delete candidate[prop];
     cleandit = true;
    }
   }
   
   return (hasBeenCleaned || cleandit);   
  }
The function is called with the template object and the incoming object and the initial parameter false. While the function could be easily used inside a function node, the better option is to wrap it into a node of its own, so it is easy to use anywhere. The details how to do that can be found on the Node-RED website. The easiest way to try the function: add your Node-RED project to version control, download the object cleaner node and unzip it into the nodes directory. Works in Bluemix and in a local Node-RED installation.

Read more

Posted by on 11 July 2015 | Comments (0) | categories: Bluemix NodeRED