General discussion on installation and configuration of SOGo

Text archives Help


[SOGo] Ideas for hooks


Chronological Thread 
  • From: Ludovic Marcotte < >
  • To:
  • Subject: [SOGo] Ideas for hooks
  • Date: Fri, 29 Jul 2011 17:31:13 -0400
  • Organization: Inverse inc.

Hello,

It's done - we can now extend SOGo directly in Python. One can easily create a Python class, define methods and create it as an object in Objective-C.

So what does that mean? It'll be possible for us to define "hooks" - methods that SOGo will invoke and people will implement in Python. For example, we could create a hook in SOGoParentFolder (_createPersonalFolder) :

- Name: -personalFolderWasCreated: (SOGoGCSFolder *) theFolder forUser: (SOGoUser *) theUser

- Description: This method will be invoked whenever a personal folder (default Calendar or
Address Book) is created. Using this hook, you can for example, automatically
subscribe the user when he "first logs in" to some other resources or you can
create additional resources.

Your Python module would simply look like:

=== SNIP ===
import objc

class Foobar (objc.lookUpClass('NSObject')):
"""Simple SOGo Bundle"""

def init(self):
return self

def personalFolderWasCreated_forUser_(self, folder, user):
// do your own stuff here
=== SNIP ===

Of course, from Python, you will be able to call Objective-C methods on objects (from SOGo/SOPE/GNUstep, etc.) or any other stuff coming for the gazillion on Python modules out there. Your Python module would simply be in a bundle, together with its resources.

What we need from you? Ideas for hooks.

Regards,

--
Ludovic Marcotte

:: +1.514.755.3630 :: www.inverse.ca
Inverse inc. :: Leaders behind SOGo (www.sogo.nu) and PacketFence
(www.packetfence.org)




Archive powered by MHonArc 2.6.18.

Top of page