Package org.jasig.portal.search

Examples of org.jasig.portal.search.SearchRequest


        when(clientHttpRequestFactory.createRequest(new URI("http://ajax.googleapis.com/ajax/services/search/web?q=news&v=1.0&userip=128.104.17.46&rsz=large&cx="), HttpMethod.GET)).thenReturn(clientHttpRequest);
        when(clientHttpResponse.getBody()).thenReturn(new ByteArrayInputStream(json.getBytes()));
        when(responseHttpHeaders.getContentLength()).thenReturn((long)json.length());
        when(portletRequest.getProperty("REMOTE_ADDR")).thenReturn("128.104.17.46");
       
        final SearchRequest query = new SearchRequest();
        query.setSearchTerms("news");
       
        final SearchResults results = googleSearchController.getSearchResults(portletRequest, query);

        assertNotNull(results);
        assertEquals(8, results.getSearchResult().size());
View Full Code Here


    @EventMapping(SearchConstants.SEARCH_REQUEST_QNAME_STRING)
    public void search2(EventRequest request, EventResponse response) {
       
        // get the search query object from the event
        Event event = request.getEvent();
        SearchRequest query = (SearchRequest) event.getValue();

        // search the portal's directory service for people matching the request
        final List<IPersonAttributes> people = searchDirectory(query.getSearchTerms(), request);

        if (people.size() > 0) {
            // transform the list of directory results into our generic search
            // response object
            final SearchResults results = new SearchResults();
            results.setQueryId(query.getQueryId());
            results.setWindowId(request.getWindowID());
           
            for (IPersonAttributes person : people) {
                final SearchResult result = new SearchResult();
                result.setTitle((String) person.getAttributeValue("displayName"));
View Full Code Here

TOP

Related Classes of org.jasig.portal.search.SearchRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.