コード例 #1
0
ファイル: BUG_58514.java プロジェクト: TaNhoSy/zimbra-mirror
  private void upgradeZimbraContactHiddenAttributes(Entry entry) throws ServiceException {
    final String attrName = Provisioning.A_zimbraContactHiddenAttributes;
    final String SMIMECertificate = "SMIMECertificate";

    String curValue = entry.getAttr(attrName, false);

    if (curValue == null || !curValue.contains(SMIMECertificate)) {
      return;
    }

    String[] hiddenAttrs = curValue.split(",");

    StringBuilder sb = new StringBuilder();
    boolean first = true;
    for (String hiddenAttr : hiddenAttrs) {
      if (!hiddenAttr.equals(SMIMECertificate)) {
        if (!first) {
          sb.append(",");
        } else {
          first = false;
        }
        sb.append(hiddenAttr);
      }
    }

    printer.println(
        "Upgrading " + TargetType.getTargetType(entry).getPrettyName() + " " + entry.getLabel());
    printer.println("    Current value of " + attrName + ": " + curValue);
    printer.println("    New value of " + attrName + ": " + sb.toString());

    Map<String, Object> attrs = new HashMap<String, Object>();
    attrs.put(attrName, sb.toString());
    modifyAttrs(entry, attrs);
  }
コード例 #2
0
ファイル: TargetType.java プロジェクト: koem/Zimbra
 static AttributeClass getAttributeClass(Entry target) throws ServiceException {
   return TargetType.getTargetType(target).getAttributeClass();
 }
コード例 #3
0
ファイル: TargetType.java プロジェクト: koem/Zimbra
 public static boolean canBeInheritedFrom(Entry target) throws ServiceException {
   TargetType targetType = TargetType.getTargetType(target);
   return !targetType.subTargetTypes().isEmpty();
 }