Coverage Report - org.kuali.student.core.assembly.data.LookupMetadata
 
Classes in this File Line Coverage Branch Coverage Complexity
LookupMetadata
59%
37/62
16%
1/6
1.125
LookupMetadata$Usage
100%
2/2
N/A
1.125
LookupMetadata$Widget
100%
2/2
N/A
1.125
LookupMetadata$WidgetOption
0%
0/2
N/A
1.125
 
 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.assembly.data;
 17  
 
 18  
 import java.io.Serializable;
 19  
 import java.util.ArrayList;
 20  
 import java.util.List;
 21  
 import java.util.Map;
 22  
 
 23  21
 public class LookupMetadata implements Serializable {
 24  
 
 25  
     private static final long serialVersionUID = 1L;
 26  
     
 27  
     private String id;                                //unique ID of this lookup
 28  
     private String searchTypeId;    //id of search type defined in search xml
 29  
     private String name;                        //name of this search
 30  
     private String desc;
 31  
     private String title;                   //advanced search window title
 32  
 
 33  
     private List<LookupParamMetadata> params;
 34  
     
 35  
     private List<LookupResultMetadata> results;
 36  
     
 37  
     private LookupQosMetadata qosMetadata;
 38  
     
 39  
     private String searchParamIdKey;
 40  
     
 41  
     private String resultReturnKey;
 42  
     
 43  
     private String resultDisplayKey;
 44  
     
 45  
     private String resultSortKey;
 46  
 
 47  
     // how a search criteria will be used. ADVANCED_CUSTOM is shown on both advanced
 48  
         // and custom screens of the advanced search lightbox
 49  
     //TODO is DEFAULT needed? it has 0 references
 50  21
     public enum Usage {
 51  2
         DEFAULT, ADVANCED, CUSTOM, ADVANCED_CUSTOM
 52  
     }
 53  
 
 54  
     private Usage usage;
 55  
     
 56  
     //TODO BUTTON has 0 references. Is it needed?
 57  19
     public enum Widget {
 58  1
         NO_WIDGET, SUGGEST_BOX, ADVANCED_LIGHTBOX, DROP_DOWN, BUTTON, CHECKBOX_LIST, RADIO
 59  
     }
 60  
     private Widget widget;    
 61  
 
 62  21
     public enum WidgetOption {
 63  0
         ADVANCED_LIGHTBOX_PREVIEW_MODE, ADVANCED_LIGHTBOX_ACTION_LABEL
 64  
     }
 65  
     
 66  
     private Map<WidgetOption, String> widgetOptions;
 67  
     
 68  
     public Map<WidgetOption, String> getWidgetOptions() {
 69  2
         return widgetOptions;
 70  
     }
 71  
     
 72  
     public void setWidgetOptions(Map<WidgetOption, String> widgetOptions) {
 73  0
         this.widgetOptions = widgetOptions;
 74  0
     }
 75  
     
 76  
     public String getWidgetOptionValue(WidgetOption widgetOption) {
 77  0
         if (widgetOptions == null) return null;
 78  0
         return widgetOptions.get(widgetOption);
 79  
     }
 80  
 
 81  
     public String getName() {
 82  2
         return name;
 83  
     }
 84  
 
 85  
     public void setName(String name) {
 86  21
         this.name = name;
 87  21
     }
 88  
 
 89  
     public String getDesc() {
 90  0
         return desc;
 91  
     }
 92  
 
 93  
     public void setDesc(String desc) {
 94  21
         this.desc = desc;
 95  21
     }
 96  
 
 97  
     public String getTitle() {
 98  0
                 return title;
 99  
         }
 100  
 
 101  
         public void setTitle(String title) {
 102  10
                 this.title = title;
 103  10
         }
 104  
     
 105  
     public List<LookupParamMetadata> getParams() {
 106  4
         if (params == null) {
 107  0
             params = new ArrayList<LookupParamMetadata>();
 108  
         }
 109  4
         return params;
 110  
     }
 111  
 
 112  
     public void setParams(List<LookupParamMetadata> params) {
 113  18
         this.params = params;
 114  18
     }
 115  
 
 116  
     public List<LookupResultMetadata> getResults() {
 117  0
         if (results == null) {
 118  0
             results = new ArrayList<LookupResultMetadata>();
 119  
         }
 120  0
         return results;
 121  
     }
 122  
 
 123  
     public void setResults(List<LookupResultMetadata> results) {
 124  21
         this.results = results;
 125  21
     }
 126  
 
 127  
     public String getSearchTypeId() {
 128  6
         return searchTypeId;
 129  
     }
 130  
 
 131  
     public void setSearchTypeId(String searchTypeId) {
 132  21
         this.searchTypeId = searchTypeId;
 133  21
     }
 134  
 
 135  
     public String getResultReturnKey() {
 136  0
         return resultReturnKey;
 137  
     }
 138  
 
 139  
     public void setResultReturnKey(String resultReturnKey) {
 140  21
         this.resultReturnKey = resultReturnKey;
 141  21
     }
 142  
 
 143  
     public String getResultDisplayKey() {
 144  0
         return resultDisplayKey;
 145  
     }
 146  
 
 147  
     public void setResultDisplayKey(String resultDisplayKey) {
 148  21
         this.resultDisplayKey = resultDisplayKey;
 149  21
     }
 150  
 
 151  
     public String getResultSortKey() {
 152  0
         return resultSortKey;
 153  
     }
 154  
 
 155  
     public void setResultSortKey(String resultSortKey) {
 156  21
         this.resultSortKey = resultSortKey;
 157  21
     }
 158  
 
 159  
     public LookupQosMetadata getQosMetadata() {
 160  0
         return qosMetadata;
 161  
     }
 162  
 
 163  
     public void setQosMetadata(LookupQosMetadata qosMetadata) {
 164  10
         this.qosMetadata = qosMetadata;
 165  10
     }
 166  
 
 167  
         public String getSearchParamIdKey() {
 168  0
                 return searchParamIdKey;
 169  
         }
 170  
 
 171  
         public void setSearchParamIdKey(String searchParamIdKey) {
 172  10
                 this.searchParamIdKey = searchParamIdKey;
 173  10
         }
 174  
     
 175  
     public String getId() {
 176  2
         return id;
 177  
     }
 178  
 
 179  
     public void setId(String id) {
 180  21
         this.id = id;
 181  21
     }
 182  
 
 183  
     /**
 184  
     * @deprecated not used so eventually want to remove
 185  
     */
 186  
     public Usage getUsage() {
 187  0
         return usage;
 188  
     }
 189  
 
 190  
     /**
 191  
     * @deprecated not used so eventually want to remove
 192  
     */
 193  
     public void setUsage(Usage usage) {
 194  21
         this.usage = usage;
 195  21
     }
 196  
     
 197  
     public Widget getWidget() {
 198  4
                 return widget;
 199  
         }
 200  
 
 201  
         public void setWidget(Widget widget) {
 202  10
                 this.widget = widget;
 203  10
         }
 204  
 
 205  
     public String toString(){
 206  0
         StringBuffer sb = new StringBuffer();
 207  0
         sb.append(id);
 208  0
         sb.append(",");        
 209  0
         sb.append(searchTypeId);
 210  0
         sb.append(",");
 211  0
         sb.append(name);
 212  0
         sb.append(",");
 213  0
         sb.append(desc);
 214  0
         return sb.toString();
 215  
     }
 216  
 }