diff options
author | Sivaiah Nallagatla <snallagatla@novell.com> | 2003-12-16 13:11:15 +0000 |
---|---|---|
committer | Sivaiah Nallagatla <siva@src.gnome.org> | 2003-12-16 13:11:15 +0000 |
commit | 8a5b45ae8ef963cce9d0cd305e7671d11e7d629b (patch) | |
tree | fcadc19feccefbdc98b076cb6ea2605f218d82d6 | |
parent | bc819a1cfd88336756afd4db3d03e76560b1c7d2 (diff) | |
download | evolution-data-server-8a5b45ae8ef963cce9d0cd305e7671d11e7d629b.tar.gz |
backends/groupwise/e-gw-connection.h backends/groupwise/e-gw-connection.c
2003-12-16 Sivaiah Nallagatla <snallagatla@novell.com>
* backends/groupwise/e-gw-connection.h
* backends/groupwise/e-gw-connection.c (e_gw_connection_new,
e_gw_connection_get_user_email)
* backends/groupwise/e-cal-backend-groupwise.c (e_cal_backend_groupwise_get_ldap_attribute,
e_cal_backend_groupwise_get_cal_address, e_cal_backend_groupwise_is_read_only,
e_cal_backend_groupwise_get_alarm_email_address, e_cal_backend_groupwise_get_static_capabilities
e_cal_backend_groupwise_open ): added implementation for all the apis listed above
* backends/groupwise/TODO : updated TODO 2.3 is done
-rw-r--r-- | calendar/ChangeLog | 10 | ||||
-rw-r--r-- | calendar/backends/groupwise/TODO | 2 | ||||
-rw-r--r-- | calendar/backends/groupwise/e-cal-backend-groupwise.c | 44 | ||||
-rw-r--r-- | calendar/backends/groupwise/e-gw-connection.c | 20 | ||||
-rw-r--r-- | calendar/backends/groupwise/e-gw-connection.h | 2 | ||||
-rw-r--r-- | servers/groupwise/e-gw-connection.c | 20 | ||||
-rw-r--r-- | servers/groupwise/e-gw-connection.h | 2 |
7 files changed, 83 insertions, 17 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index dea8f129d..dbfef51f9 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,13 @@ +2003-12-16 Sivaiah Nallagatla <snallagatla@novell.com> + + * backends/groupwise/e-gw-connection.h + * backends/groupwise/e-gw-connection.c (e_gw_connection_new, + e_gw_connection_get_user_email) + * backends/groupwise/e-cal-backend-groupwise.c (e_cal_backend_groupwise_get_ldap_attribute, + e_cal_backend_groupwise_get_cal_address, e_cal_backend_groupwise_is_read_only, + e_cal_backend_groupwise_get_alarm_email_address, e_cal_backend_groupwise_get_static_capabilities + e_cal_backend_groupwise_open ): added implementation for all the apis listed above + 2003-12-15 JP Rosevear <jpr@ximian.com> * libecal/e-cal-listener.c (e_cal_listener_class_init): fix the diff --git a/calendar/backends/groupwise/TODO b/calendar/backends/groupwise/TODO index 573e2bfc6..f50101857 100644 --- a/calendar/backends/groupwise/TODO +++ b/calendar/backends/groupwise/TODO @@ -43,7 +43,7 @@ Step 2 - Basic functionality The server should have a list of available timezones, if not, we can use libical's built-in timezones. - 2.3 Retrieve information about connection: when loging to the server, we get, in + 2.3 Retrieve information about connection -> done : when loging to the server, we get, in the loginResponse response, some information about the user being connected. From that we can retrieve some information needed to implement the following backend methods: diff --git a/calendar/backends/groupwise/e-cal-backend-groupwise.c b/calendar/backends/groupwise/e-cal-backend-groupwise.c index 88b01c2ba..b265496a3 100644 --- a/calendar/backends/groupwise/e-cal-backend-groupwise.c +++ b/calendar/backends/groupwise/e-cal-backend-groupwise.c @@ -35,6 +35,8 @@ struct _ECalBackendGroupwisePrivate { EGwConnection *cnc; ECalBackendCache *cache; + gboolean read_only; + char *uri; }; static void e_cal_backend_groupwise_dispose (GObject *object); @@ -88,7 +90,6 @@ e_cal_backend_groupwise_finalize (GObject *object) (* G_OBJECT_CLASS (parent_class)->finalize) (object); } - /* Calendar backend methods */ @@ -96,38 +97,55 @@ e_cal_backend_groupwise_finalize (GObject *object) static ECalBackendSyncStatus e_cal_backend_groupwise_is_read_only (ECalBackendSync *backend, EDataCal *cal, gboolean *read_only) { - /* FIXME */ - *read_only = TRUE; + ECalBackendGroupwise *cbgw; + + cbgw = E_CAL_BACKEND_GROUPWISE(backend); + *read_only = cbgw->priv->read_only; return GNOME_Evolution_Calendar_Success; } -/* Get_email_address handler for the file backend */ +/*return email address of the person who opened the calender */ static ECalBackendSyncStatus e_cal_backend_groupwise_get_cal_address (ECalBackendSync *backend, EDataCal *cal, char **address) { - /* FIXME */ + ECalBackendGroupwise *cbgw; + + cbgw = E_CAL_BACKEND_GROUPWISE(backend); + *address = g_strdup (e_gw_connection_get_user_email (cbgw->priv->cnc)); + return GNOME_Evolution_Calendar_Success; } static ECalBackendSyncStatus e_cal_backend_groupwise_get_ldap_attribute (ECalBackendSync *backend, EDataCal *cal, char **attribute) { - /* FIXME */ + /* ldap attribute is specific to Sun ONE connector to get free busy information*/ + /* retun NULL here as group wise backend know how to get free busy information */ + + *attribute = NULL; + return GNOME_Evolution_Calendar_Success; } static ECalBackendSyncStatus e_cal_backend_groupwise_get_alarm_email_address (ECalBackendSync *backend, EDataCal *cal, char **address) { - /* FIXME */ + /*group wise does not support email based alarms */ + + *address = NULL; + return GNOME_Evolution_Calendar_Success; } static ECalBackendSyncStatus e_cal_backend_groupwise_get_static_capabilities (ECalBackendSync *backend, EDataCal *cal, char **capabilities) { - /* FIXME */ + *capabilities = g_strdup (CAL_STATIC_CAPABILITY_NO_EMAIL_ALARMS "," \ + CAL_STATIC_CAPABILITY_REMOVE_ALARMS "," \ + CAL_STATIC_CAPABILITY_NO_THISANDPRIOR "," \ + CAL_STATIC_CAPABILITY_NO_THISANDFUTURE); + return GNOME_Evolution_Calendar_Success; } @@ -157,6 +175,7 @@ e_cal_backend_groupwise_open (ECalBackendSync *backend, EDataCal *cal, gboolean GnomeVFSURI *vuri; char *real_uri; EGwConnectionStatus status; + ECalBackendSyncStatus result; cbgw = E_CAL_BACKEND_GROUPWISE (backend); priv = cbgw->priv; @@ -187,10 +206,15 @@ e_cal_backend_groupwise_open (ECalBackendSync *backend, EDataCal *cal, gboolean gnome_vfs_uri_unref (vuri); g_free (real_uri); - + + /* As of now we are assuming that logged in user has write rights to calender */ + /* we need to read actual rights from server when we implement proxy user access */ + cbgw->priv->read_only = FALSE; + if (E_IS_GW_CONNECTION (priv->cnc)) return GNOME_Evolution_Calendar_Success; - + + /* free memory */ g_object_unref (priv->cnc); priv->cnc = NULL; diff --git a/calendar/backends/groupwise/e-gw-connection.c b/calendar/backends/groupwise/e-gw-connection.c index 4df5fa47d..74b5f88b3 100644 --- a/calendar/backends/groupwise/e-gw-connection.c +++ b/calendar/backends/groupwise/e-gw-connection.c @@ -39,6 +39,7 @@ struct _EGwConnectionPrivate { char *username; char *password; char *session_id; + char *email; }; static EGwConnectionStatus @@ -226,7 +227,8 @@ e_gw_connection_new (const char *uri, const char *username, const char *password SoupSoapParameter *param; EGwConnectionStatus status; char *hash_key; - + const char *param_value; + /* search the connection in our hash table */ if (loaded_connections != NULL) { hash_key = g_strdup_printf ("%s:%s@%s", @@ -273,12 +275,15 @@ e_gw_connection_new (const char *uri, const char *username, const char *password g_object_unref (cnc); return NULL; } - + cnc->priv->uri = g_strdup (uri); cnc->priv->username = g_strdup (username); cnc->priv->password = g_strdup (password); cnc->priv->session_id = g_strdup (soup_soap_parameter_get_string_value (param)); - + param = soup_soap_response_get_first_parameter_by_name (response, "email"); + param_value = soup_soap_parameter_get_string_value (param); + cnc->priv->email = g_strdup (param_value); + /* add the connection to the loaded_connections hash table */ hash_key = g_strdup_printf ("%s:%s@%s", cnc->priv->username ? cnc->priv->username : "", @@ -322,3 +327,12 @@ e_gw_connection_logout (EGwConnection *cnc) return E_GW_CONNECTION_STATUS_OK; } + +const char* +e_gw_connection_get_user_email (EGwConnection *cnc) +{ + g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), NULL); + + return (const char*) cnc->priv->email; + +} diff --git a/calendar/backends/groupwise/e-gw-connection.h b/calendar/backends/groupwise/e-gw-connection.h index 2955c7941..ace08fa42 100644 --- a/calendar/backends/groupwise/e-gw-connection.h +++ b/calendar/backends/groupwise/e-gw-connection.h @@ -63,6 +63,8 @@ SoupSoapResponse *e_gw_connection_send_message (EGwConnection *cnc, SoupSoapMe EGwConnectionStatus e_gw_connection_logout (EGwConnection *cnc); +const char *e_gw_connection_get_user_email (EGwConnection *cnc); + G_END_DECLS #endif diff --git a/servers/groupwise/e-gw-connection.c b/servers/groupwise/e-gw-connection.c index 4df5fa47d..74b5f88b3 100644 --- a/servers/groupwise/e-gw-connection.c +++ b/servers/groupwise/e-gw-connection.c @@ -39,6 +39,7 @@ struct _EGwConnectionPrivate { char *username; char *password; char *session_id; + char *email; }; static EGwConnectionStatus @@ -226,7 +227,8 @@ e_gw_connection_new (const char *uri, const char *username, const char *password SoupSoapParameter *param; EGwConnectionStatus status; char *hash_key; - + const char *param_value; + /* search the connection in our hash table */ if (loaded_connections != NULL) { hash_key = g_strdup_printf ("%s:%s@%s", @@ -273,12 +275,15 @@ e_gw_connection_new (const char *uri, const char *username, const char *password g_object_unref (cnc); return NULL; } - + cnc->priv->uri = g_strdup (uri); cnc->priv->username = g_strdup (username); cnc->priv->password = g_strdup (password); cnc->priv->session_id = g_strdup (soup_soap_parameter_get_string_value (param)); - + param = soup_soap_response_get_first_parameter_by_name (response, "email"); + param_value = soup_soap_parameter_get_string_value (param); + cnc->priv->email = g_strdup (param_value); + /* add the connection to the loaded_connections hash table */ hash_key = g_strdup_printf ("%s:%s@%s", cnc->priv->username ? cnc->priv->username : "", @@ -322,3 +327,12 @@ e_gw_connection_logout (EGwConnection *cnc) return E_GW_CONNECTION_STATUS_OK; } + +const char* +e_gw_connection_get_user_email (EGwConnection *cnc) +{ + g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), NULL); + + return (const char*) cnc->priv->email; + +} diff --git a/servers/groupwise/e-gw-connection.h b/servers/groupwise/e-gw-connection.h index 2955c7941..ace08fa42 100644 --- a/servers/groupwise/e-gw-connection.h +++ b/servers/groupwise/e-gw-connection.h @@ -63,6 +63,8 @@ SoupSoapResponse *e_gw_connection_send_message (EGwConnection *cnc, SoupSoapMe EGwConnectionStatus e_gw_connection_logout (EGwConnection *cnc); +const char *e_gw_connection_get_user_email (EGwConnection *cnc); + G_END_DECLS #endif |