Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-10-2008, 02:41 PM
Junior Member
 
Posts: 9
Default Updating Contact in Java

Code:
LmcCreateContactRequest contactRequest = new LmcCreateContactRequest();
contactRequest.setSession(session);
LmcContact contact = new LmcContact();
LmcContactAttr attrs[] = new LmcContactAttr[16];
contact.setAttrs(attrs);
contactRequest.setContact(contact);
contactRequest.invoke(serverURL);
The above will create a contact which is what I want it to do. How do you update an already existing contact? I tried contact.setID(id); which I assumed would update the contact with that id. However, it just creates a duplicate contact with a different id.
Reply With Quote
  #2 (permalink)  
Old 03-10-2008, 10:33 PM
Zimbra Employee
 
Posts: 1,434
Default

You'd be much better served to use ZMailbox.modifyContact().
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
  #3 (permalink)  
Old 03-12-2008, 01:53 PM
Junior Member
 
Posts: 9
Default

I am sure this is rookie overlooking something. In the constructor:
Code:
new ZMailbox(new Options(String account, AccountBy accountBy, String password, String uri)
What is the AccountBy and how do I instantiate it? Also, if you know where there is some examples of its use that would be helpful?
Reply With Quote
  #4 (permalink)  
Old 03-12-2008, 02:54 PM
Zimbra Employee
 
Posts: 1,434
Default

ZMailboxUtil.java is the source for the zmmailbox program. It exercises most of the fuctionality of the ZMailbox class.
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
  #5 (permalink)  
Old 03-12-2008, 04:56 PM
ljm ljm is offline
Project Contributor
 
Posts: 81
Default

Check out soap.txt for a description of account by="" and it should give you an idea of how it works:
http://files.zimbra.com/blog/soap-tmp/soap.txt
(This might not be the normative url for soap.txt but it works at the moment.)
__________________
Zindus - contact sync for Thunderbird and Zimbra
Reply With Quote
  #6 (permalink)  
Old 03-14-2008, 01:55 PM
Junior Member
 
Posts: 9
Talking

Thanks for your help. Everything is working perfectly!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.