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