Perhaps there are some other users that implemented this for their own application, but if not there are plenty of code examples on that on the internet, for example try stackoverflow.com. There isn't really anything Mendix-specific needed for this. Maybe you could even try to get your patch included in the Community Commons module :)