View Single Post
  #6 (permalink)  
Old 03-17-2006, 07:38 AM
altimage altimage is offline
Active Member
 
Posts: 39
Default

Quote:
Originally Posted by schemers
For multi-value attrs (like zimbraMailForwardingAddress) you have a number of options:

- by default it replaces all of them. So calling ModifyAccount with:

Code:
<a n="zimbraMailForwardingAddress">v1</a>
<a n="zimbraMailForwardingAddress">v2</a>
will replace all existing values of zimbraMailForwardingAddress with the ones specified.

- you can explcitly and/remove a single value using a +/- in front of the attr name:

Code:
<a n="-zimbraMailForwardingAddress">v1</a>
<a n="+zimbraMailForwardingAddress">v2</a>
that will remove the "v1" value, and add a "v2" value. Any other values for that attribute will be left unchanged. If you use +/- in front of an attr name, you must you it in front of all values for that attr name in the same call.

- you can remove all values by setting a single instance to the value to "":

Code:
<a n="zimbraMailForwardingAddress"></a>
since "" means unset, and you haven't specified a +/-, it will delete all existing values.

For a while we only supported the first first and last forms, which is definitely a pain when you have a multi-valued attribute with a lot of values. Instead of making the protocol more complex, we decided to just add the +/- syntax in front of the attr name so it worked immediately with existing SOAP calls and also via "zmprov" and all the internal provisioning APIs.
Thank you! You have no idea how much that simplified everything for me XD.

The only question left to address is the user rights for modifying zimbraMailDeliveryAddress and then I'm good.
Reply With Quote