View Javadoc
1   package org.kuali.ole.select.keyvalue;
2   
3   import org.apache.commons.lang.StringUtils;
4   import org.kuali.ole.select.bo.OLEEResourceChangeDashBoard;
5   import org.kuali.ole.select.form.OLEEResourceChangeDashboardForm;
6   import org.kuali.ole.select.gokb.OleGokbReview;
7   import org.kuali.rice.core.api.util.ConcreteKeyValue;
8   import org.kuali.rice.core.api.util.KeyValue;
9   import org.kuali.rice.krad.uif.control.UifKeyValuesFinderBase;
10  import org.kuali.rice.krad.uif.view.ViewModel;
11  
12  import java.util.ArrayList;
13  import java.util.List;
14  
15  /**
16   * Created by srirams on 29/9/14.
17   */
18  public class OLEEResourceKeyValueFinder extends UifKeyValuesFinderBase {
19  
20      @Override
21      public List getKeyValues(ViewModel viewModel) {
22          List<KeyValue> keyValues = new ArrayList<KeyValue>();
23          OLEEResourceChangeDashboardForm eResourceChangeDashboardForm = (OLEEResourceChangeDashboardForm) viewModel;
24          List<OleGokbReview> oleGokbReviews = eResourceChangeDashboardForm.getOleGokbReviewList();
25          for (OleGokbReview oleGokbReview : oleGokbReviews) {
26              String eresource = oleGokbReview.getOleERSIdentifier();
27              if (StringUtils.isNotEmpty(eresource))
28                  keyValues.add(new ConcreteKeyValue(eresource, eresource));
29          }
30          keyValues.add(new ConcreteKeyValue("", ""));
31          return keyValues;
32      }
33  
34  }