Search in sources :

Example 1 with Prop

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());
    }
}
Also used : Prop(com.zimbra.soap.account.type.Prop) Element(com.zimbra.common.soap.Element) ZimletUserProperties(com.zimbra.cs.zimlet.ZimletUserProperties)

Example 2 with Prop

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;
    }
}
Also used : ServiceException(com.zimbra.common.service.ServiceException) Prop(com.zimbra.soap.account.type.Prop)

Example 3 with Prop

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);
}
Also used : Prop(com.zimbra.soap.account.type.Prop)

Aggregations

Prop (com.zimbra.soap.account.type.Prop)3 ServiceException (com.zimbra.common.service.ServiceException)1 Element (com.zimbra.common.soap.Element)1 ZimletUserProperties (com.zimbra.cs.zimlet.ZimletUserProperties)1