IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Deserialize LastSearchState

    Posted Fri June 10, 2011 12:40 AM

    Hello:

    In a Search Result Portlet I need to get the value entered in the keyword field in the search bar portlet (both portlet are wired correctly).

    From Portlet reference documentation:
    Last Search State (lastSearchState)
    Facilitates passing the search query value to the Search Result portlet when a user clicks Go
    in the Search Bar control. When a user clicks Go, the portlet serializes and converts the
    active search query object to a base64-encoded string, which is then set as the value of
    this property. If the property has no value, the portlet behaves as if there is no active
    search.

    The Query String value contains a base 64 serialized object. My question is how can I deserialize the object?

    thanks in advance.

    regards.


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS


  • 2.  RE: Deserialize LastSearchState

    Posted Fri June 10, 2011 05:19 PM

    Typically, if your search result page bean java class implements the ISearchPageBean interface and you have configured wiring between the searchbar and searchresult portlets, then the search query would normally have been deserialized automatically. In your search result portlet page bean, you could get the deserialized searchquery object from the provided getActiveSearchQuery API.

    See:
    http://techcommunity.softwareag.com/ecosystem/documentation/webmethods/wmsuites/wmsuite8-2_ga/My_webMethods/8-2-SP1_CAF_and_MWS_Java_API_Reference/com/webmethods/caf/faces/search/query/ISearchPageBean.html

    Or if you want to programatically deserialize it yourself, the search query factory has a method that can take the search state string and return the search query object.

    See:
    http://techcommunity.softwareag.com/ecosystem/documentation/webmethods/wmsuites/wmsuite8-2_ga/My_webMethods/8-2-SP1_CAF_and_MWS_Java_API_Reference/com/webmethods/caf/faces/search/query/ISearchQueryFactory.html


    #webMethods-BPMS
    #webMethods
    #MWS-CAF-Task-Engine


  • 3.  RE: Deserialize LastSearchState

    Posted Sat June 11, 2011 12:17 AM

    Thanks Eric.

    Another question: what method is executed in the search result portlet when I click the go button in the search result portlet?

    public String doSearch() {
    return getSearchBarControl().getControlBean().constructSearchQueryString();
    }
    

    I saw this methods configured in other task search bar portlet.

    I mean, I cannot understand the mechanism used to specify what method should execute in the search result portlet (refresh) when I click the go button in the search bar portlet.

    regards


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 4.  RE: Deserialize LastSearchState

    Posted Mon June 13, 2011 06:25 PM

    Ok, the last post was originated because initialize method was not refreshing the search result portlet. Looking in the forums I found that there is an issue and some member recomends to use:

    protected void beforeRenderResponse() {
    super.beforeRenderResponse();
    .
    .
    .

    I use it and I was able to refresh the search result table.

    Best regards.


    #webMethods-BPMS
    #MWS-CAF-Task-Engine
    #webMethods


  • 5.  RE: Deserialize LastSearchState

    Posted Mon June 13, 2011 07:21 PM

    Yes, that is right. The action is processed inside the SearchBar portlet which generates the serialized search state string. That string is then wired to the search result portlet which deserializes it back to the search query object when rendering the SearchResult portlet. If you need to detect when a new search query has been executed, you can use the isQueryChanged method from the SearchResult page bean.

    http://techcommunity.softwareag.com/ecosystem/documentation/webmethods/wmsuites/wmsuite8-2_ga/My_webMethods/8-2-SP1_CAF_and_MWS_Java_API_Reference/com/webmethods/caf/faces/bean/search/BaseSearchPageBean.html#isQueryChanged()


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS