OpenERP push changes via HTTP Post to ESB/Middleware

February 12, 2014 – 10:46 pm
ERP's seldom operate alone in an organization. Often you'll want to be able to be notified of changes made to data inside an ERP. I've been doing some research to OpenERP, an open source and very extensive ERP platform. It's not very well documented with respect to integration issues. Luckily, there's a 'general' action type that can be configured for each entity in the system. It's called 'serveraction' and you can specify one of a type that can hold a small piece of Python script. Very easily to post the object's fields to an HTTP server, for instance? Here is how to do it. 1. In order to be able to post to HTTP servers, we'll need 'urllib'. The code checker prevents us from impoting anything that isn't listed, so first of all, you'll need to edit the file:/Server/server/openerp/tools/ On Line 43, add 'urllib': _ALLOWED_MODULES = ['_strptime', 'time', 'urllib'] 2. Write python code ...

Long-polling super simple chatserver in python

April 8, 2013 – 9:48 pm
So you might be looking for the simplest long-polling example you can find. I was looking for one, couldn't find it so I wrote it. Let me explain the server part. A SimpleHTTPRequestHandler can handle two GET request types: /poll and /notify?message. Every /poll request wil wait for the next /notify request using an event.wait() statement (see Python docs for further explanation). On a notify call, the url parm message is sent to all 'frozen' /poll requests. That's all. message = "" class CustomHandler(SimpleHTTPRequestHandler): def do_GET(self): resource = self.path.partition('?')[0].replace('/','') urlparm = self.path.partition('?')[2].partition('?')[0] if resource=="poll": event.wait() global message ...

Enterprise Architecture

March 19, 2013 – 5:13 pm
That's a broad term. Our vision on the topic, including some definitions and roles/responsiblities, can be downloaded here:

Passwords stored in windows

March 6, 2013 – 3:01 pm
Password policies require you to change your password regularly in some organisations. Stored passwords in your computer can cause account lock-outs, very annoying. In order to see what passwords are stored on your computer, use this command in a prompt: rundll32.exe keymgr.dll, KRShowKeyMgr

Active Directory Photo View/Add tool

March 1, 2013 – 4:09 pm
In order to enable users to have a 'corporate' photo in an enterprise Microsoft Active Directory network I created a little tool to upload/view your corporate picture in the active directory. You can download the tool below. ADPhotoTool

Never plan standup meetings first thing in the morning

January 30, 2013 – 10:22 am
A little note to self. Every time I was in an Agile SCRUM team, meetings held 'first thing in the morning' turned out to be 'waiting for the team to be present'. Mentally, your team members will be busy around 15 minutes before the meeting, postponing it by say 30 minutes will affect productivity greatly. So a 15-minute standup meeting held at 9.00 am, postponed say 30 minutes twice a week will cause team members to miss 2 hours of productivity weekly. The solution? Plan the stand-up meeting before or after lunch. This will align team members (lunching together might be a good idea) and will minimize waiting time. Very lean :).

Wrapping the HTML5 Client-Side Storage

December 5, 2012 – 11:20 pm
For my business application development series, I stumbled upon a few limitations of the HTML client-side storage. Only strings are stored It's very limited in size in some browsers (e.g. 5MB for Chrome) Thus, I decided to add a little wrapper around the storage adding object storage (via JSON serialization / de-serialization) and compressing the stored JSON via a GZip implementation. The wrapper is very simple: function Store(key, obj){ localStorage[key]= lzw_encode(JSON.stringify(object)); } function Load(key){ return lzw_decode(JSON.parse(localStorage[key])); } The lzw_encode and lzw_decode implementations can be found in this stackoverflow post (also: added below). json2.js is also needed in order to run this properly on all browsers. // LZW-compress a string function lzw_encode(s) { var dict = {}; var data = (s + "").split(""); var out = []; var currChar; var phrase = data[0]; var code = 256; for (var i=1; i 1 ? ...

Course SOA and ESB, from 24 january 2013

December 4, 2012 – 2:05 pm
At our company, ICRIS, we'll be giving a course on SOA and ESB's, including practical hands-on cases using open-source software in january / february 2013. It's 3 full days , you can register at: Our flyer (in Dutch) can be found here:

Building cross-platform HTML-based mobile LOB apps, part III: application cache

December 4, 2012 – 9:16 am
In my first post in this series I stated that my application should be available off-line, because of the heavily distributed use and potentially not-connected environments. The way to go in HTML5 is the "application cache" as described at w3schools. In my case I modified my HTML file replacing the <html> line with: <html manifest="date.cache"> and adding this date.cache file: CACHE MANIFEST # 2012-12-03 v1.0.0 date3.html NETWORK: FALLBACK: The only file my app exists of now is date3.html, the only-when-network is available file section is empty, as well as the fallback section. One note in order to work in IE, Safari and in the Android browser: the content-type of the cache-file served must be "text/cache-manifest" or nothing will be cached at all! The extended example can be found here.

Building cross-platform HTML-based mobile LOB apps, part II: client-side storage

December 3, 2012 – 1:44 pm
The next step into my quest for cross-platform LOB apps is to enable client-side storage. The 'old' way to do this is using cookies; HTML5 contains a facility called client-side storage, addressable via the Javascript localStorage object. I tweaked my code from the previous example not to store my selected date in a browser variable 'selected' but in the localStorage.selected object. Fairly straight-forward, I only discovered that the localStorage apparently stores all variables serialized: Of course, JSON serialization is an option for this issue. For now, I changed my code to this fragment while loading the page (in the loop through months/days): if(localStorage.selected!=null && curdate.toString()==localStorage.selected.toString()){ ctx.fillStyle="#0000FF"; document.getElementById("selection").innerHTML=new Date(localStorage.selected).toLocaleDateString(); } And in the OnMouseDown handler: date=calculateDateFromCoords(mousePos.x,mousePos.y); if(date!=''){ localStorage.selected = date; } Note that this last fragment stores the date value in the localStorage's 'selected' property as a string. The full example can be used/viewed here: date2.html. Note that reloading or closing and re-opening the browser persists the selected date. Up ...