GBE::GKolabAgent Class Reference

Integrated Kolab Groupware. More...

#include <GKolabAgent.h>

Inheritance diagram for GBE::GKolabAgent:

Inheritance graph
[legend]
Collaboration diagram for GBE::GKolabAgent:

Collaboration graph
[legend]
List of all members.

Public Slots

virtual void closeConnection ()
virtual void initKolabServerName (const QString &server)
virtual void initKolabUserName (const QString &username)
virtual void initKolabUserPassword (const QString &password)
virtual void initKolabObject (const QString &objectpath)

Public Member Functions

 GKolabAgent ()
virtual ~GKolabAgent ()
virtual QStringList getAvailableActions () const
virtual QString getActionDescription (const QString &action) const
virtual void performAction (const QString &action, QStringList params)

Protected Slots

void connectToKolab ()
void socketConnected ()
void readSocketData ()
void interpretMessage ()
void socketError (QAbstractSocket::SocketError error)
bool sendMail (const QString &content)
 TODO implement (tricky, need to connect to SMTP first!
bool sendMail (const QString &to, const QString &subject, const QString &body)
 TODO implement (tricky, need to connect to SMTP first!

Protected Member Functions

bool isConnectedToKolab () const
int getNextCommandNumber ()

Protected Attributes

QTcpSocket Socket
int CommandCounter
QDomDocument KolabXml
bool ConnectInProgress
bool LoggedIn
QStringList ReadBuffer

Detailed Description

Integrated Kolab Groupware.

Author:
Raphael Langerhorst
The Kolab agent integrates the exernal kolab groupware system into the G System environment.

The architecture of Kolab integration is as follows: An element that contains the GKolabAgent (hereafter called the top-most kolab element) creates a subhierarchy of elements for the individual kolab.xml data packages and emails as well. These child elements won't be connected to the Kolab server, only the top-most kolab element since Cyrus is limited to one simulatneous TCP connection(!) If that restriction would not be the case the overal design would be even simpler.

The child elements have themselves various child elements: One child element that is always present will be connected to the top-most kolab element, in order to provide useful relations. The other child elements will depend on the actual kolab.xml data. For example Kolab Calendar events will have relations to other users and freebusy data.

Using the GObject::Connection is crucial to benefit from the general G System architecture.

The Kolab xml formats usually share a common base format that can also be taken advantage of by this Kolab agent in terms of a common child elements hierarchy.

Besides this generated element hierarchy other elements will be used to perform various useful tasks on the element hierarchy like building a calendar on a monthly and weekly basis. The general idea is to simplify common groupware tasks through such special agents and elements. Other special agents will be used to collect freebusy data for event scheduling, or create a calendar of all users by using the freebusy data.

It is important to recognize that within the G System environment the features and capabilities of the Kolab groupware server can be enhanced (like a global all-user calendar, see above).

In particular these agents will make it possible to write a highly simplified webinterface to the Kolab server.

It also might be a good idea to reference (with ID) such special elements within the top-most kolab element so they are easy to find and utilize for the user.

Infrastructure for sending mails:

Sending can be done from within this agent, directly. Composing emails should be done with child elements, each representing an email with additional child elements attached for parts of the mail, like recipient, subject, message body, attachements. Most of these child elements of the mail element are linked to various things within the G Universe. This way an attachment can be connected to a specific other element. Or the recipient can be linked to a different user element and such things.

This way the kolab element can collect multiple child elements that are composed emails and send them per request.

In a first simple implementation, the KolabAgent will accept emails directly through an action and send it (sendMail action).

Each element can have a /contact/ tag in the element data that contains things like email address of the element owner. If a sender or receiver child element of the mail element is connected to such an element, then this contact data is used.

Todo:
have a look at kdepim/kioslaves/imap4
Todo:
the IMAP connection needs to be shared, only 1 client for an IMAP server allowed at a time! use a static GKolabAgent::Socket attribute note 2006-10-21: this is not an issue, only the top-most element with a kolab agent will communicate with the server.
Todo:
sort out the issue of being a secondaryElement, otherwise there will be multiple connections (primary + many secondary) (Will there be really? Only when connect action is called!!)


Constructor & Destructor Documentation

GBE::GKolabAgent::GKolabAgent (  ) 

Constructor.

GBE::GKolabAgent::~GKolabAgent (  )  [virtual]

Virtual Destructor.


Member Function Documentation

void GBE::GKolabAgent::closeConnection (  )  [virtual, slot]

Closes the IMAP connection to the Kolab server.

void GBE::GKolabAgent::connectToKolab (  )  [protected, slot]

Connects to the Kolab IMAP server.

QString GBE::GKolabAgent::getActionDescription ( const QString &  action  )  const [virtual]

Needs to be reimplemented in a subclass.

Returns:
Informal description of given action and its parameters.
See also:
getAvailableActions, performAction

Reimplemented from GCS::GAgent.

QStringList GBE::GKolabAgent::getAvailableActions (  )  const [virtual]

By default this returns an empty list. It needs to be reimplemented in a subclass.

Note:
Please keep in sync with performAction.
Returns:
list of available actions for this agent
See also:
performAction, getActionDescription

Reimplemented from GCS::GAgent.

int GBE::GKolabAgent::getNextCommandNumber (  )  [protected]

Used to generate the next unique tag for an IMAP command.

Returns:
incremented CommandCounter.

void GBE::GKolabAgent::initKolabObject ( const QString &  objectpath  )  [virtual, slot]

Sets the actual kolab object to operate on.

This can be a folder or a particular email, for example /INBOX/Sent works on the Sent folder of your inbox.

By default (empty path), the inbox of the user is used.

void GBE::GKolabAgent::initKolabServerName ( const QString &  server  )  [virtual, slot]

Sets the fully qualified domain name of the Kolab server to which this agent should connect.

void GBE::GKolabAgent::initKolabUserName ( const QString &  username  )  [virtual, slot]

Sets the user name to connect with

void GBE::GKolabAgent::initKolabUserPassword ( const QString &  password  )  [virtual, slot]

Sets the password for the user.

void GBE::GKolabAgent::interpretMessage (  )  [protected, slot]

Interpretes the content of ReadBuffer. This is called as soon as the complete response is read.

See also:
readSocketData

bool GBE::GKolabAgent::isConnectedToKolab (  )  const [protected]

Returns:
true when the socket connection to the Kolab server is established and usable.
See also:
LoggedIn

void GBE::GKolabAgent::readSocketData (  )  [protected, slot]

Whenever data is available from the kolab server, it is interpreted here. When the response is complete, interpretMessage is called.

See also:
interpretMessage

bool GBE::GKolabAgent::sendMail ( const QString &  to,
const QString &  subject,
const QString &  body 
) [protected, slot]

TODO implement (tricky, need to connect to SMTP first!

Constructs a valid email with given parameters and sends it.

Parameters:
to the receiver of the mail
subject the subject line of the mail
body the actual message.

bool GBE::GKolabAgent::sendMail ( const QString &  content  )  [protected, slot]

TODO implement (tricky, need to connect to SMTP first!

Sends given email.

void GBE::GKolabAgent::socketConnected (  )  [protected, slot]

Slot used to detect socket connections. The login process is done here.

void GBE::GKolabAgent::socketError ( QAbstractSocket::SocketError  error  )  [protected, slot]

Slot used to detect and respond to socket errors.


Member Data Documentation

int GBE::GKolabAgent::CommandCounter [protected]

IMAP commands start with a tag that has a strict monotonic increasing number, like a1, a2, and so on. The CommandCounter provides this number and is increased before each use.

bool GBE::GKolabAgent::ConnectInProgress [protected]

Set to true while connecting to the kolab server is in progress. This is set to false as soon as the user is successfully logged in.

QDomDocument GBE::GKolabAgent::KolabXml [protected]

Contains the actual kolab xml data.

bool GBE::GKolabAgent::LoggedIn [protected]

Set to true when the user is logged in.

QStringList GBE::GKolabAgent::ReadBuffer [protected]

Contains all lines read so far. In case a response does not come in one complete TCP packet it might happen that it is split up. For this reason all lines are stored here until the response is complete, then it is interpreted.

QTcpSocket GBE::GKolabAgent::Socket [protected]

The socket for the Kolab IMAP connection.


The documentation for this class was generated from the following files:
Generated on Thu Nov 16 07:49:21 2006 for G System by  doxygen 1.4.7