[evolution-patches] support for renaming folders and share folder notification



hi,
the attached patch provides support for renaming folders (soap
provider). This patch also provides support for shared folder
notification.

regards,
partha
Index: e-gw-item.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/groupwise/e-gw-item.c,v
retrieving revision 1.51
diff -u -r1.51 e-gw-item.c
--- e-gw-item.c	6 Jan 2005 05:17:04 -0000	1.51
+++ e-gw-item.c	6 Jan 2005 05:59:19 -0000
@@ -1379,7 +1379,7 @@
 {
 	EGwItem *item;
         char *item_type;
-	SoupSoapParameter *subparam, *child, *category_param, *attachment_param;
+	SoupSoapParameter *subparam, *child, *category_param, *attachment_param, *notification_param ;
 	gboolean is_group_item = TRUE;
 	GList *user_email = NULL;
 	
@@ -1447,6 +1447,11 @@
 			subparam = soup_soap_parameter_get_first_child_by_name (changes, "update");
 	}
 	else subparam = param; /* The item is a complete one, not a delta  */
+	/*If its a notification - reset type*/
+	notification_param = soup_soap_parameter_get_first_child_by_name (param,"notification") ;
+	if (notification_param) {
+			item->priv->item_type = E_GW_ITEM_TYPE_NOTIFICATION;
+	}
 	
 	/* now add all properties to the private structure */
 	for (child = soup_soap_parameter_get_first_child (subparam);
@@ -1537,7 +1542,6 @@
 					organizer->email = soup_soap_parameter_get_string_value (subparam);
 				e_gw_item_set_organizer (item, organizer);
 			}
-
 		} else if (!g_ascii_strcasecmp (name, "dueDate")) {
 			char *formatted_date; 
 			value = soup_soap_parameter_get_string_value (child);
@@ -2562,7 +2566,6 @@
 			soup_soap_message_add_attribute (msg, "length", "0", NULL, NULL);
 			soup_soap_message_write_string (msg, "");
 		}
-
 		soup_soap_message_end_element (msg);
 
 		/*attachments*/
Index: e-gw-item.h
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/groupwise/e-gw-item.h,v
retrieving revision 1.24
diff -u -r1.24 e-gw-item.h
--- e-gw-item.h	6 Jan 2005 05:17:04 -0000	1.24
+++ e-gw-item.h	6 Jan 2005 05:59:19 -0000
@@ -48,6 +48,7 @@
 	E_GW_ITEM_TYPE_ORGANISATION,
 	E_GW_ITEM_TYPE_RESOURCE,
 	E_GW_ITEM_TYPE_CATEGORY,
+	E_GW_ITEM_TYPE_NOTIFICATION, 
 	E_GW_ITEM_TYPE_UNKNOWN
 	
 } EGwItemType;
Index: e-gw-connection.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/groupwise/e-gw-connection.c,v
retrieving revision 1.90
diff -u -r1.90 e-gw-connection.c
--- e-gw-connection.c	3 Jan 2005 13:20:20 -0000	1.90
+++ e-gw-connection.c	6 Jan 2005 05:59:20 -0000
@@ -2094,6 +2094,88 @@
 	return status;
 }
 
+EGwConnectionStatus
+e_gw_connection_add_items (EGwConnection *cnc, const char *container, GList *item_ids)
+{
+	SoupSoapMessage *msg;
+	SoupSoapResponse *response;
+	EGwConnectionStatus status;
+
+	g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_CONNECTION);
+	g_return_val_if_fail (item_ids != NULL, E_GW_CONNECTION_STATUS_INVALID_OBJECT);
+
+	/* build the SOAP message */
+	msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "addItemsRequest");
+
+	if (container && *container)
+		e_gw_message_write_string_parameter (msg, "container", NULL, container);
+	
+	soup_soap_message_start_element (msg, "items", NULL, NULL);
+	for (; item_ids != NULL; item_ids = g_list_next (item_ids))
+		e_gw_message_write_string_parameter (msg, "item", NULL, item_ids->data);
+	soup_soap_message_end_element (msg);
+
+	e_gw_message_write_footer (msg);
+
+	/* send message to server */
+	response = e_gw_connection_send_message (cnc, msg);
+	if (!response) {
+		g_object_unref (msg);
+		return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+	}
+
+	status = e_gw_connection_parse_response_status (response);
+	if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
+		reauthenticate (cnc);
+	/* free memory */
+	g_object_unref (response);
+	g_object_unref (msg);
+
+	return status;
+}
+
+EGwConnectionStatus 
+e_gw_connection_rename_folder (EGwConnection *cnc, const char *id ,const char *new_name)
+{
+	SoupSoapMessage *msg;
+        SoupSoapResponse *response;
+        EGwConnectionStatus status;
+	
+	g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
+
+	/* build the SOAP message */
+        msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "modifyItemRequest");
+        if (!msg) {
+                g_warning (G_STRLOC ": Could not build SOAP message");
+                return E_GW_CONNECTION_STATUS_UNKNOWN;
+        }
+
+	e_gw_message_write_string_parameter (msg, "id", NULL, id);
+
+	soup_soap_message_start_element (msg, "updates", NULL, NULL);
+	soup_soap_message_start_element (msg, "update", NULL, NULL);
+	e_gw_message_write_string_parameter (msg, "name", NULL, new_name);
+	soup_soap_message_end_element (msg) ;
+	soup_soap_message_end_element (msg) ;
+	
+	e_gw_message_write_footer (msg);
+
+	/* send message to server */
+	response = e_gw_connection_send_message (cnc, msg);
+	if (!response) {
+		g_object_unref (msg);
+		return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+	}
+
+	status = e_gw_connection_parse_response_status (response);
+	if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
+		reauthenticate (cnc);
+	g_object_unref (msg);
+	g_object_unref (response);
+
+	return status;
+		
+}
 EGwConnectionStatus 
 e_gw_connection_share_folder(EGwConnection *cnc, gchar *id, GList *new_list, const char *sub, const char *mesg ,int flag) 
 {
Index: e-gw-connection.h
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/groupwise/e-gw-connection.h,v
retrieving revision 1.40
diff -u -r1.40 e-gw-connection.h
--- e-gw-connection.h	3 Jan 2005 13:20:20 -0000	1.40
+++ e-gw-connection.h	6 Jan 2005 05:59:20 -0000
@@ -119,6 +119,8 @@
 EGwConnectionStatus e_gw_connection_create_folder(EGwConnection *cnc, const char *parent_name,const char *folder_name, char **container_id) ;
 EGwConnectionStatus e_gw_connection_get_attachment (EGwConnection *cnc, const char *id, int offset, int length, const char **attachment, int *attach_lenght) ;
 EGwConnectionStatus e_gw_connection_add_item (EGwConnection *cnc, const char *container, const char *id) ;
+EGwConnectionStatus e_gw_connection_add_items (EGwConnection *cnc, const char *container, GList *item_ids) ;
+EGwConnectionStatus e_gw_connection_rename_folder (EGwConnection *cnc, const char *id ,const char *new_name) ;
 EGwConnectionStatus e_gw_connection_share_folder (EGwConnection *cnc, gchar *id, GList *new_list, const char *sub, const char *mesg ,int flag); 
 
 
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/groupwise/ChangeLog,v
retrieving revision 1.82
diff -u -r1.82 ChangeLog
--- ChangeLog	6 Jan 2005 05:17:04 -0000	1.82
+++ ChangeLog	6 Jan 2005 05:59:20 -0000
@@ -1,5 +1,15 @@
 2005-01-06  Parthasarathi Susarla <sparthasarathi novell com>
 
+	* e-gw-item.[ch]: 
+	  (e_gw_item_new_from_soap_parameter): new item type for notifcation
+	  of shared folder
+	* e-gw-connection.[ch]:
+	  (e_gw_connection_add_items),
+	  (e_gw_connection_rename_folder): support for renaming of folders
+
+	  
+2005-01-06  Parthasarathi Susarla <sparthasarathi novell com>
+
        * e-gw-item.[ch]: support for attachments for soap mailer
          (free_attach),
          (e_gw_item_set_attach_id_list),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]