View Javadoc

1   package org.kuali.student.r2.common.service.impl;
2   
3   import org.kuali.student.r2.common.dto.ContextInfo;
4   import org.kuali.student.r2.common.exceptions.*;
5   import org.kuali.student.r2.core.search.dto.SearchRequestInfo;
6   import org.kuali.student.r2.core.search.dto.SearchResultCellInfo;
7   import org.kuali.student.r2.core.search.dto.SearchResultInfo;
8   import org.kuali.student.r2.core.search.dto.SearchResultRowInfo;
9   import org.kuali.student.r2.core.search.service.SearchService;
10  import org.kuali.student.r2.core.class1.type.dto.TypeInfo;
11  
12  import javax.jws.WebParam;
13  import java.util.ArrayList;
14  import java.util.List;
15  
16  public class MockSearchDispatcher implements SearchService {
17  
18      @Override
19      public List<TypeInfo> getSearchTypes(@WebParam(name = "contextInfo") ContextInfo contextInfo) throws InvalidParameterException, MissingParameterException, OperationFailedException {
20          return null;  //To change body of implemented methods use File | Settings | File Templates.
21      }
22  
23      @Override
24      public TypeInfo getSearchType(@WebParam(name = "searchTypeKey") String searchTypeKey, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException {
25          return null;  //To change body of implemented methods use File | Settings | File Templates.
26      }
27  
28  
29      @Override
30      public SearchResultInfo search(SearchRequestInfo searchRequestInfo, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws MissingParameterException, OperationFailedException, PermissionDeniedException {
31          SearchResultInfo result = new SearchResultInfo();
32          List<SearchResultRowInfo> rows = new ArrayList();
33          SearchResultRowInfo row = new SearchResultRowInfo();
34          rows.add(row);
35          SearchResultCellInfo cell = new SearchResultCellInfo();
36          cell.setKey("mockKey");
37          cell.setValue("mockValue");
38          List<SearchResultCellInfo> cells = new ArrayList();
39          cells.add(cell);
40          row.setCells(cells);
41          result.setRows(rows);
42          //  System.out.println ("Generating mock search result for " + searchRequest.getSearchKey ());
43          return result;
44      }
45  }