View Javadoc
1   /*
2    * Copyright 2012 The Kuali Foundation.
3    *
4    * Licensed under the Educational Community License, Version 1.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl1.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.ole.vnd.businessobject.inquiry;
17  
18  import java.util.List;
19  import java.util.Map;
20  
21  import org.kuali.ole.sys.businessobject.inquiry.KfsInquirableImpl;
22  import org.kuali.ole.vnd.businessobject.DebarredVendorMatch;
23  import org.kuali.ole.vnd.businessobject.VendorAlias;
24  import org.kuali.rice.krad.bo.BusinessObject;
25  
26  public class VendorExclusionInquirable extends KfsInquirableImpl {
27  
28      /**
29       * @see org.kuali.rice.kns.inquiry.KualiInquirableImpl#getBusinessObject(java.util.Map)
30       */
31      @SuppressWarnings("unchecked")
32      @Override
33      public BusinessObject getBusinessObject(Map fieldValues) {
34          DebarredVendorMatch match = (DebarredVendorMatch)super.getBusinessObject(fieldValues);
35          List<VendorAlias> vendorAliases = match.getVendorDetail().getVendorAliases();
36          StringBuffer concatenatedAliases = new StringBuffer();
37          for(VendorAlias alias : vendorAliases) {
38              concatenatedAliases.append(alias.getVendorAliasName());
39              concatenatedAliases.append("/n");
40          }
41          match.setConcatenatedAliases(concatenatedAliases.toString());
42          return match;
43      }
44  }