Coverage Report - org.kuali.student.core.personsearch.service.impl.PersonSearchServiceImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
PersonSearchServiceImpl
0%
0/31
0%
0/4
1.833
 
 1  
 /**
 2  
  * Copyright 2010 The Kuali Foundation Licensed under the
 3  
  * Educational Community License, Version 2.0 (the "License"); you may
 4  
  * not use this file except in compliance with the License. You may
 5  
  * obtain a copy of the License at
 6  
  *
 7  
  * http://www.osedu.org/licenses/ECL-2.0
 8  
  *
 9  
  * Unless required by applicable law or agreed to in writing,
 10  
  * software distributed under the License is distributed on an "AS IS"
 11  
  * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 12  
  * or implied. See the License for the specific language governing
 13  
  * permissions and limitations under the License.
 14  
  */
 15  
 
 16  
 package org.kuali.student.core.personsearch.service.impl;
 17  
 
 18  
 import java.util.ArrayList;
 19  
 import java.util.HashMap;
 20  
 import java.util.List;
 21  
 import java.util.Map;
 22  
 
 23  
 import javax.jws.WebService;
 24  
 
 25  
 import org.apache.log4j.Logger;
 26  
 import org.kuali.rice.kim.api.identity.IdentityService;
 27  
 import org.kuali.student.common.exceptions.DoesNotExistException;
 28  
 import org.kuali.student.common.exceptions.InvalidParameterException;
 29  
 import org.kuali.student.common.exceptions.MissingParameterException;
 30  
 import org.kuali.student.common.exceptions.OperationFailedException;
 31  
 import org.kuali.student.common.search.dto.SearchCriteriaTypeInfo;
 32  
 import org.kuali.student.common.search.dto.SearchRequest;
 33  
 import org.kuali.student.common.search.dto.SearchResult;
 34  
 import org.kuali.student.common.search.dto.SearchResultTypeInfo;
 35  
 import org.kuali.student.common.search.dto.SearchTypeInfo;
 36  
 import org.kuali.student.common.search.service.SearchService;
 37  
 /**
 38  
  * Proxy Search service to the rice PersonService that adds primitive support for the search() and searchForResult()
 39  
  * search methods.
 40  
  *
 41  
  * @author Kuali Rice Team (kuali-rice@googlegroups.com)
 42  
  *
 43  
  */
 44  
 @WebService(endpointInterface = "org.kuali.student.common.search.service.SearchService", name = "PersonSearchService", serviceName = "PersonSearchService", portName = "PersonSearchService", targetNamespace = "http://student.kuali.org/wsdl/personsearch")
 45  
 public class PersonSearchServiceImpl implements SearchService {
 46  0
     protected static final Logger LOG = Logger.getLogger(PersonSearchServiceImpl.class);
 47  
 
 48  
     private IdentityService identityService;
 49  
 
 50  
     public static final String PERSON_ENTITY_TYPE = "PERSON";
 51  
 
 52  0
     static final public Map<String,String> PERSON_CRITERIA = new HashMap<String,String>();
 53  
 
 54  0
     static final public Map<String, SearchOperation> searchOperations = new HashMap<String, SearchOperation>();
 55  
     
 56  
     static {
 57  0
         PERSON_CRITERIA.put("entityTypes.active", "Y");
 58  0
         PERSON_CRITERIA.put("principals.active", "Y");
 59  0
         PERSON_CRITERIA.put("active", "Y");
 60  0
         PERSON_CRITERIA.put("entityTypes.entityTypeCode", "PERSON|SYSTEM");
 61  0
         searchOperations.put(QuickViewByGivenName.SEARCH_TYPE, new QuickViewByGivenName());
 62  0
     }
 63  
 
 64  
 
 65  0
     public PersonSearchServiceImpl() {
 66  0
     }
 67  
 
 68  
     /**
 69  
      * Return the list of searches we recognize
 70  
      *
 71  
      * @see org.kuali.student.common.search.service.SearchService#getSearchTypes()
 72  
      */
 73  
     @Override
 74  
     public List<SearchTypeInfo> getSearchTypes() throws OperationFailedException {
 75  0
         final List<SearchTypeInfo> searchTypes =  new ArrayList<SearchTypeInfo>(searchOperations.size());
 76  0
         for (String searchKey : searchOperations.keySet()) {
 77  0
             SearchOperation so = searchOperations.get (searchKey);
 78  0
             searchTypes.add(so.getType ());
 79  0
         }
 80  0
         return searchTypes;
 81  
     }
 82  
 
 83  
 
 84  
     @Override
 85  
     public SearchResult search(SearchRequest searchRequest) {
 86  0
         final SearchOperation search = searchOperations.get(searchRequest.getSearchKey());
 87  0
         if (search != null) {
 88  0
             return search.search(identityService, searchRequest);
 89  
         }
 90  0
         return new SearchResult();
 91  
     }
 92  
 
 93  
 
 94  
     /**
 95  
      * This overridden method ...
 96  
      *
 97  
      * @see org.kuali.student.common.search.service.SearchService#getSearchCriteriaType(java.lang.String)
 98  
      */
 99  
     @Override
 100  
     public SearchCriteriaTypeInfo getSearchCriteriaType(String searchCriteriaTypeKey) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException {
 101  0
        throw new RuntimeException("Not implemented yet");
 102  
     }
 103  
 
 104  
     /**
 105  
      * This overridden method ...
 106  
      *
 107  
      * @see org.kuali.student.common.search.service.SearchService#getSearchCriteriaTypes()
 108  
      */
 109  
     @Override
 110  
     public List<SearchCriteriaTypeInfo> getSearchCriteriaTypes() throws OperationFailedException {
 111  0
         throw new RuntimeException("Not implemented yet");
 112  
     }
 113  
 
 114  
     /**
 115  
      * This overridden method ...
 116  
      *
 117  
      * @see org.kuali.student.common.search.service.SearchService#getSearchResultType(java.lang.String)
 118  
      */
 119  
     @Override
 120  
     public SearchResultTypeInfo getSearchResultType(String searchResultTypeKey) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException {
 121  0
         throw new RuntimeException("Not implemented yet");
 122  
     }
 123  
 
 124  
     /**
 125  
      * This overridden method ...
 126  
      *
 127  
      * @see org.kuali.student.common.search.service.SearchService#getSearchResultTypes()
 128  
      */
 129  
     @Override
 130  
     public List<SearchResultTypeInfo> getSearchResultTypes() throws OperationFailedException {
 131  0
         throw new RuntimeException("Not implemented yet");
 132  
     }
 133  
 
 134  
     /**
 135  
      * This overridden method ...
 136  
      *
 137  
      * @see org.kuali.student.common.search.service.SearchService#getSearchType(java.lang.String)
 138  
      */
 139  
     @Override
 140  
     public SearchTypeInfo getSearchType(String searchTypeKey) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException {
 141  0
         throw new RuntimeException("Not implemented yet");
 142  
     }
 143  
 
 144  
     /**
 145  
      * This overridden method ...
 146  
      *
 147  
      * @see org.kuali.student.common.search.service.SearchService#getSearchTypesByCriteria(java.lang.String)
 148  
      */
 149  
     @Override
 150  
     public List<SearchTypeInfo> getSearchTypesByCriteria(String searchCriteriaTypeKey) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException {
 151  0
         throw new RuntimeException("Not implemented yet");
 152  
     }
 153  
 
 154  
     @Override
 155  
     public List<SearchTypeInfo> getSearchTypesByResult(String searchResultTypeKey) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException {
 156  0
         throw new RuntimeException("Not implemented yet");
 157  
     }
 158  
 
 159  
     //
 160  
 
 161  
     public IdentityService getIdentityService() {
 162  0
         return identityService;
 163  
     }
 164  
     public void setIdentityService(IdentityService identityService) {
 165  0
         this.identityService = identityService;
 166  0
     }
 167  
 
 168  
 }