/**
   * /** Check if the given group exists
   *
   * @param ddManager
   * @param sName
   * @return true if a group with the given name
   * @throws AdminException
   */
  public boolean isGroupExist(DomainDriverManager ddManager, String sName) throws AdminException {
    try {
      ddManager.getOrganizationSchema();

      // build GroupRow to search
      GroupRow searchedGroup = new GroupRow();
      searchedGroup.specificId = null;
      searchedGroup.name = sName;
      searchedGroup.description = null;

      // search for group
      GroupRow[] group = ddManager.getOrganization().group.getAllMatchingGroups(searchedGroup);

      return (group.length > 0);
    } catch (Exception e) {
      throw new AdminException(
          "GroupManager.isGroupExist",
          SilverpeasException.ERROR,
          "admin.EX_ERR_IS_GROUP_EXIST",
          "group name: '" + sName + "'",
          e);
    } finally {
      ddManager.releaseOrganizationSchema();
    }
  }
  /** Convert Group to GroupRow */
  private GroupRow group2GroupRow(Group group) {
    GroupRow gr = new GroupRow();
    gr.id = idAsInt(group.getId());
    gr.specificId = group.getSpecificId();
    gr.domainId = idAsInt(group.getDomainId());
    gr.superGroupId = idAsInt(group.getSuperGroupId());
    gr.name = group.getName();
    gr.description = group.getDescription();
    gr.rule = group.getRule();

    return gr;
  }