/**
   * Returns all allowed document types for a given space
   *
   * @param nSpaceId The space Id
   * @return Allowed documents types as a ReferenceList
   */
  public ReferenceList getAllowedDocumentTypes(int nSpaceId) {
    ReferenceList list = new ReferenceList();
    DAOUtil daoUtil = new DAOUtil(SQL_QUERY_SELECT_SPACE_DOCUMENT_TYPE);
    daoUtil.setInt(1, nSpaceId);
    daoUtil.executeQuery();

    while (daoUtil.next()) {
      list.addItem(daoUtil.getString(1), daoUtil.getString(2));
    }

    daoUtil.free();

    return list;
  }
  /**
   * Load the list of documentSpaces
   *
   * @param locale The locale
   * @return The Collection of the DocumentSpaces
   */
  public ReferenceList getViewTypeList(Locale locale) {
    ReferenceList list = new ReferenceList();
    DAOUtil daoUtil = new DAOUtil(SQL_QUERY_SELECTALL_VIEWTYPE);
    daoUtil.executeQuery();

    while (daoUtil.next()) {
      String strCodeView = daoUtil.getString(1);
      String strViewNameKey = daoUtil.getString(2);
      list.addItem(strCodeView, I18nService.getLocalizedString(strViewNameKey, locale));
    }

    daoUtil.free();

    return list;
  }
  /**
   * Gets a list of icons available or space customization
   *
   * @return A list of icons
   */
  public ReferenceList getIconsList() {
    ReferenceList list = new ReferenceList();
    DAOUtil daoUtil = new DAOUtil(SQL_QUERY_SELECTALL_ICONS);
    daoUtil.executeQuery();

    while (daoUtil.next()) {
      int nIconId = daoUtil.getInt(1);
      String strIconUrl = daoUtil.getString(2);
      list.addItem(nIconId, strIconUrl);
    }

    daoUtil.free();

    return list;
  }
  /**
   * Load the list of documentSpaces
   *
   * @return The Collection of the DocumentSpaces
   */
  public ReferenceList getDocumentSpaceList() {
    ReferenceList list = new ReferenceList();
    DAOUtil daoUtil = new DAOUtil(SQL_QUERY_SELECTALL);
    daoUtil.executeQuery();

    while (daoUtil.next()) {
      DocumentSpace space = new DocumentSpace();
      space.setId(daoUtil.getInt(1));
      space.setName(daoUtil.getString(3));

      list.addItem(space.getId(), space.getName());
    }

    daoUtil.free();

    return list;
  }