/**
   * Returns the state of the parameter map.
   *
   * <p>
   *
   * @param params the parameter map
   * @return the state of the list from the parameter map
   */
  protected CmsListState getState(Map<String, String> params) {

    CmsListState state = new CmsListState();
    try {
      state.setPage(Integer.parseInt(params.get(I_CmsListResourceCollector.PARAM_PAGE)));
    } catch (Throwable e) {
      // ignore
    }
    try {
      state.setOrder(CmsListOrderEnum.valueOf(params.get(I_CmsListResourceCollector.PARAM_ORDER)));
    } catch (Throwable e) {
      // ignore
    }
    try {
      state.setFilter(params.get(I_CmsListResourceCollector.PARAM_FILTER));
    } catch (Throwable e) {
      // ignore
    }
    try {
      state.setColumn(params.get(I_CmsListResourceCollector.PARAM_SORTBY));
    } catch (Throwable e) {
      // ignore
    }
    return state;
  }
  /**
   * Constructor, creates a new list collector.
   *
   * <p>
   *
   * @param wp the workplace object where the collector is used from
   */
  protected A_CmsListResourceCollector(A_CmsListExplorerDialog wp) {

    m_wp = wp;
    CmsListState state = (wp != null ? wp.getListStateForCollector() : new CmsListState());
    if (state.getPage() < 1) {
      state.setPage(1);
    }
    if (CmsStringUtil.isEmptyOrWhitespaceOnly(state.getColumn())) {
      state.setColumn(A_CmsListExplorerDialog.LIST_COLUMN_NAME);
    }
    if (state.getOrder() == null) {
      state.setOrder(CmsListOrderEnum.ORDER_ASCENDING);
    }
    if (state.getFilter() == null) {
      state.setFilter("");
    }
    m_collectorParameter =
        I_CmsListResourceCollector.PARAM_PAGE
            + I_CmsListResourceCollector.SEP_KEYVAL
            + state.getPage();
    m_collectorParameter +=
        I_CmsListResourceCollector.SEP_PARAM
            + I_CmsListResourceCollector.PARAM_SORTBY
            + I_CmsListResourceCollector.SEP_KEYVAL
            + state.getColumn();
    m_collectorParameter +=
        I_CmsListResourceCollector.SEP_PARAM
            + I_CmsListResourceCollector.PARAM_ORDER
            + I_CmsListResourceCollector.SEP_KEYVAL
            + state.getOrder();
    m_collectorParameter +=
        I_CmsListResourceCollector.SEP_PARAM
            + I_CmsListResourceCollector.PARAM_FILTER
            + I_CmsListResourceCollector.SEP_KEYVAL
            + state.getFilter();
  }