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