View Single Post
  #4 (permalink)  
Old 06-23-2009, 01:06 AM
sysinit sysinit is offline
New Member
 
Posts: 3
Default

Hi!

I managed to sync only the default Contacts folder by adding three lines of code:

Code:
diff -uNr ru.korusconsulting.orig/src/java/ru/korusconsulting/connector/base/ZimbraPort.java ru.korusconsulting/src/java/ru/korusconsulting/connector/base/ZimbraPort.java
--- ru.korusconsulting.orig/src/java/ru/korusconsulting/connector/base/ZimbraPort.java  2008-04-24 11:42:30.000000000 +0200
+++ ru.korusconsulting/src/java/ru/korusconsulting/connector/base/ZimbraPort.java       2009-06-23 08:44:49.000000000 +0200
@@ -168,6 +168,7 @@
         Element contactsRequest = (Element) soapHelper.getBody(request).elements().get(0);^M
         {^M
             contactsRequest.addAttribute(ZConst.A_SYNC, "1");^M
+            contactsRequest.addAttribute(ZConst.A_FOLDER, folderHolder.getDefaultFolderId(FolderHolder.CONTACT));^M
         }^M
         Document response = sendRequest(request);^M
         Element body = soapHelper.getBody(response);^M
@@ -229,6 +230,7 @@
             }^M
             contactsRequest.add(cn);^M
             contactsRequest.addAttribute(ZConst.A_SYNC, "1");^M
+            contactsRequest.addAttribute(ZConst.A_FOLDER, folderHolder.getDefaultFolderId(FolderHolder.CONTACT));^M
         }^M
 ^M
         Document response = sendRequest(request);^M
@@ -335,6 +337,7 @@
             }^M
             contactsRequest.add(attr);^M
             contactsRequest.addAttribute(ZConst.A_SYNC, "1");^M
+            contactsRequest.addAttribute(ZConst.A_FOLDER, folderHolder.getDefaultFolderId(FolderHolder.CONTACT));^M
         }^M
 ^M
         Document response = sendRequest(request);^M
I think it wouldn't be too hard for the author to add an option to the management interface enabling users to restrict synchronisation to the default contacts folder...

@ the author: Incredible work! Thank you very much for this excellent piece of software!

Regards,
Daniel
Reply With Quote