How to provide a custom Plomino util as a plugin
======================================================

Plomino provides a set of utils in PlominoUtils (DateToString, asUnicode, etc.).

But a custom Plomino utils can be declared to Plomino from a custom 
package and those utils will be available from any Plomino formula.

Example:
    >>> from zope.interface import implements
    >>> from zope import component
    >>> from Products.PythonScripts.Utility import allow_module

Create the utils methods:
    >>> import simplejson as json
    >>> def jsonify(obj):
    >>>     return json.dumps(obj)

    >>> def dejsonify(s):
    >>>     return json.loads(s)

Create a utils class to declare them
    >>> class UnepUtils:
    
    >>>     module = "mypackage.mymodule"
    >>>     methods = ['jsonify', 'dejsonify']

Declare the module as safe so it can be called from PythonScripts
(all Plomino formula are PythonScripts)
    >>> allow_module("mypackage.mymodule")

And register it to Plomino in a configure.zcml:
  <utility
        provides="Products.CMFPlomino.interfaces.IPlominoUtils"
        component="pims.skin.bla.UnepUtils"
        />

Now, jsonify and dejsonify can be used in any Plomino formula.
