2 Replies Latest reply: Nov 9, 2012 9:27 AM by mtbdgr RSS

    Editing Advanced Search Options of document.

    mtbdgr
      Hi!

      I want to edit advanced search options of meta data fields in my custom component, in particular, i want to set Is Filtered option to True. But, i don't see any services in The Services Reference Guide for it. There is GET_ADVANCED_SEARCH_OPTIONS, UPDATE_ADVANCED_SEARCH_OPTIONS, but there is not something like SETADVANCED_SEARCH_OPTIONS... Maybe, someone can advise me how to solve this issue?

      Thank you.
        • 1. Re: Editing Advanced Search Options of document.
          970471
          You should be able to use UPDATE_ADVANCED_SEARCH_OPTIONS.

          binder.putLocal("IdcService", "GET_ADVANCED_SEARCH_OPTIONS");
          binder = executeService(binder, "sysadmin");

          //binder.putLocal("isZoneQuickSearch", "0");

          // Do extra logic here to set the value for column advOptions for each row.

          binder.putLocal("IdcService", "UPDATE_ADVANCED_SEARCH_OPTIONS");
          executeService(binder, "sysadmin");

          Jonathan
          http://jonathanhult.com
          • 2. Re: Editing Advanced Search Options of document.
            mtbdgr
            Hi, again!


            Jonathan Hult, thank you for your answer! It's help me, but not completelly. I want to change the option IsInSearchResultFilterCategory for a specific field. I tried to do something like that:

            DataBinder binder = getBinder();
            binder.putLocal("IdcService", "GET_ADVANCED_SEARCH_OPTIONS");

            DataBinder resp = getResponse(binder).getResponseAsBinder();

            List<DataObject> rows = resp.getResultSet("SearchFieldOptions").getRows();
            for (int i = 0; i < rows.size(); i++) {
                 if (rows.get(i).containsValue(paramValue)) {
                      rows.get(i).put("IsInSearchResultFilterCategory", "true");
                 }
            }
            resp.putLocal("IdcService", "UPDATE_ADVANCED_SEARCH_OPTIONS");
            getResponse(resp);

            I watched trough debug - the variable for IsInSearchResultFilterCategory was changed in the resp.getResultSet("SearchFieldOptions").getRows().get(i), but after finished of that function, in the Advanced Search Design was the old value. There was not true.

            Maybe, anyone see, where is the error?

            Edited by: mtbdgr on 09.11.2012 7:26