use of com.zimbra.soap.account.type.Prop in project zm-mailbox by Zimbra.
the class GetInfo method doProperties.
private static void doProperties(Element response, Account acct) {
ZimletUserProperties zp = ZimletUserProperties.getProperties(acct);
Set<? extends Prop> props = zp.getAllProperties();
for (Prop prop : props) {
Element elem = response.addElement(AccountConstants.E_PROPERTY);
elem.addAttribute(AccountConstants.A_ZIMLET, prop.getZimlet());
elem.addAttribute(AccountConstants.A_NAME, prop.getName());
elem.setText(prop.getValue());
}
}
use of com.zimbra.soap.account.type.Prop in project zm-mailbox by Zimbra.
the class ZimletUserProperties method saveProperties.
public synchronized void saveProperties(Account account) throws ServiceException {
String[] props = new String[properties.size()];
int index = 0;
for (Prop prop : properties) {
props[index++] = prop.getSerialization();
}
try {
Provisioning.getInstance().modifyAttrs(account, Collections.singletonMap(Provisioning.A_zimbraZimletUserProperties, props));
} catch (ServiceException se) {
CACHE.invalidate(account.getId());
throw se;
}
}
use of com.zimbra.soap.account.type.Prop in project zm-mailbox by Zimbra.
the class ZimletUserProperties method setProperty.
public synchronized void setProperty(String zimlet, String key, String value) {
Prop newProp = new Prop(zimlet, key, value);
for (Prop prop : properties) {
if (prop.matches(newProp)) {
prop.replace(newProp);
return;
}
}
properties.add(newProp);
}
Aggregations