8ec6bc19457c62cfa1b0ba8d8e6fdfa86f240ea8
[portal/sdk.git] /
1 /*-
2  * ================================================================================
3  * ECOMP Portal SDK
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ================================================================================
19  */
20 package org.openecomp.portalsdk.analytics.model.runtime;
21
22 import java.util.ArrayList;
23 import java.util.Map;
24
25 import org.openecomp.portalsdk.analytics.view.ColumnHeader;
26
27 class Row {
28         private String displayValue;
29         private String dataType;
30         private String colId;
31         //private boolean visible;
32         
33         
34         /*public boolean isVisible() {
35                 return visible;
36         }
37         public void setVisible(boolean visible) {
38                 this.visible = visible;
39         }*/
40         public String getDisplayValue() {
41                 return displayValue;
42         }
43         public void setDisplayValue(String displayValue) {
44                 this.displayValue = displayValue;
45         }
46         public String getDataType() {
47                 return dataType;
48         }
49         public void setDataType(String dataType) {
50                 this.dataType = dataType;
51         }
52         public String getColId() {
53                 return colId;
54         }
55         public void setColId(String colId) {
56                 this.colId = colId;
57         }
58         
59         
60 }
61 class IndexValueJSON {
62         private int index;
63         private String value;
64         private String title;
65         public int getIndex() {
66                 return index;
67         }
68         public void setIndex(int index) {
69                 this.index = index;
70         }
71         public String getValue() {
72                 return value;
73         }
74         public void setValue(String value) {
75                 this.value = value;
76         }
77         public String getTitle() {
78                 return title;
79         }
80         public void setTitle(String title) {
81                 this.title = title;
82         }
83         
84 }
85
86 class DomainAxisJSON            extends IndexValueJSON {}
87
88 class ChartColumnJSON           extends IndexValueJSON {}
89
90 class ChartTypeJSON             extends IndexValueJSON {}
91
92 class PieChartOptions {
93         
94 }
95
96 public class ChartJSON {
97         
98         private String reportID;
99         private String reportName;
100         private String reportDescr;
101         private String reportTitle;
102         private String reportSubTitle;
103         private ArrayList <FormFieldJSON> formFieldList;
104         private ArrayList <ChartColumnJSON> chartColumnJSONList;
105         private String formfield_comments;
106         private int totalRows;
107         private String chartSqlWhole;
108         private boolean chartAvailable;
109         private ChartTypeJSON chartTypeJSON;
110         private BarChartOptions barChartOptions;
111         private PieChartOptions pieChartOptions;
112         private TimeSeriesChartOptions timeSeriesChartOptions;
113         private FlexTimeSeriesChartOptions flexTimeSeriesChartOptions;
114         private CommonChartOptions commonChartOptions;
115         private String width;
116         private String height;
117         private boolean animation;
118         private String rotateLabels;
119         private boolean staggerLabels;
120         private boolean showTitle;
121         private DomainAxisJSON domainAxisJSON;
122         private CategoryAxisJSON categoryAxisJSON;
123         private boolean hasCategoryAxis;
124         
125         
126         public boolean isHasCategoryAxis() {
127                 return hasCategoryAxis;
128         }
129         public void setHasCategoryAxis(boolean hasCategoryAxis) {
130                 this.hasCategoryAxis = hasCategoryAxis;
131         }
132         private ArrayList <RangeAxisJSON> rangeAxisList;
133         private ArrayList <ArrayList<Row>> wholeList;
134
135         private String primaryAxisLabel;
136         private String secondaryAxisLabel;
137         private String minRange;
138         private String maxRange;
139         //private int topMargin;
140         //private int bottomMargin;
141         //private int leftMargin;
142         //private int rightMargin;
143         
144         /*private boolean showMaxMin;
145         private boolean showLegend;
146         private boolean showControls;
147         private String topMargin;
148         private String bottomMargin;
149         private String leftMargin;
150         private String rightMargin;
151         private String subType;
152         private boolean stacked;
153         private boolean horizontalBar;
154         private boolean barRealTimeAxis;
155         private boolean barReduceXAxisLabels;
156         private boolean timeAxis;*/
157         
158         public String getReportID() {
159                 return reportID;
160         }
161         public void setReportID(String reportID) {
162                 this.reportID = reportID;
163         }
164         public String getReportName() {
165                 return reportName;
166         }
167         public void setReportName(String reportName) {
168                 this.reportName = reportName;
169         }
170         public String getReportDescr() {
171                 return reportDescr;
172         }
173         public void setReportDescr(String reportDescr) {
174                 this.reportDescr = reportDescr;
175         }
176         public String getReportTitle() {
177                 return reportTitle;
178         }
179         public void setReportTitle(String reportTitle) {
180                 this.reportTitle = reportTitle;
181         }
182         public String getReportSubTitle() {
183                 return reportSubTitle;
184         }
185         public void setReportSubTitle(String reportSubTitle) {
186                 this.reportSubTitle = reportSubTitle;
187         }
188         public ArrayList<FormFieldJSON> getFormFieldList() {
189                 return formFieldList;
190         }
191         public void setFormFieldList(ArrayList<FormFieldJSON> formFieldList) {
192                 this.formFieldList = formFieldList;
193         }
194         public String getFormfield_comments() {
195                 return formfield_comments;
196         }
197         public void setFormfield_comments(String formfield_comments) {
198                 this.formfield_comments = formfield_comments;
199         }
200         public int getTotalRows() {
201                 return totalRows;
202         }
203         public void setTotalRows(int totalRows) {
204                 this.totalRows = totalRows;
205         }
206         public String getChartSqlWhole() {
207                 return chartSqlWhole;
208         }
209         public void setChartSqlWhole(String chartSqlWhole) {
210                 this.chartSqlWhole = chartSqlWhole;
211         }
212         public boolean isChartAvailable() {
213                 return chartAvailable;
214         }
215         public void setChartAvailable(boolean chartAvailable) {
216                 this.chartAvailable = chartAvailable;
217         }
218         public String getWidth() {
219                 return width;
220         }
221         public void setWidth(String width) {
222                 this.width = width;
223         }
224         public String getHeight() {
225                 return height;
226         }
227         public void setHeight(String height) {
228                 this.height = height;
229         }
230         public boolean isAnimation() {
231                 return animation;
232         }
233         public void setAnimation(boolean animation) {
234                 this.animation = animation;
235         }
236         public String getRotateLabels() {
237                 return rotateLabels;
238         }
239         public void setRotateLabels(String rotateLabels) {
240                 this.rotateLabels = rotateLabels;
241         }
242         public boolean isStaggerLabels() {
243                 return staggerLabels;
244         }
245         public void setStaggerLabels(boolean staggerLabels) {
246                 this.staggerLabels = staggerLabels;
247         }
248         public boolean isShowTitle() {
249                 return showTitle;
250         }
251         public void setShowTitle(boolean showTitle) {
252                 this.showTitle = showTitle;
253         }       
254         /*public boolean isShowMaxMin() {
255                 return showMaxMin;
256         }
257         public void setShowMaxMin(boolean showMaxMin) {
258                 this.showMaxMin = showMaxMin;
259         }
260         public boolean isShowLegend() {
261                 return showLegend;
262         }
263         public void setShowLegend(boolean showLegend) {
264                 this.showLegend = showLegend;
265         }
266         public boolean isShowControls() {
267                 return showControls;
268         }
269         public void setShowControls(boolean showControls) {
270                 this.showControls = showControls;
271         }
272         public String getTopMargin() {
273                 return topMargin;
274         }
275         public void setTopMargin(String topMargin) {
276                 this.topMargin = topMargin;
277         }
278         public String getBottomMargin() {
279                 return bottomMargin;
280         }
281         public void setBottomMargin(String bottomMargin) {
282                 this.bottomMargin = bottomMargin;
283         }
284         public String getLeftMargin() {
285                 return leftMargin;
286         }
287         public void setLeftMargin(String leftMargin) {
288                 this.leftMargin = leftMargin;
289         }
290         public String getRightMargin() {
291                 return rightMargin;
292         }
293         public void setRightMargin(String rightMargin) {
294                 this.rightMargin = rightMargin;
295         }
296
297         public String getSubType() {
298                 return subType;
299         }
300         public void setSubType(String subType) {
301                 this.subType = subType;
302         }
303         public boolean isStacked() {
304                 return stacked;
305         }
306         public void setStacked(boolean stacked) {
307                 this.stacked = stacked;
308         }
309         public boolean isHorizontalBar() {
310                 return horizontalBar;
311         }
312         public void setHorizontalBar(boolean horizontalBar) {
313                 this.horizontalBar = horizontalBar;
314         }
315         public boolean isBarRealTimeAxis() {
316                 return barRealTimeAxis;
317         }
318         public void setBarRealTimeAxis(boolean barRealTimeAxis) {
319                 this.barRealTimeAxis = barRealTimeAxis;
320         }
321         public boolean isBarReduceXAxisLabels() {
322                 return barReduceXAxisLabels;
323         }
324         public void setBarReduceXAxisLabels(boolean barReduceXAxisLabels) {
325                 this.barReduceXAxisLabels = barReduceXAxisLabels;
326         }
327         public boolean isTimeAxis() {
328                 return timeAxis;
329         }
330         public void setTimeAxis(boolean timeAxis) {
331                 this.timeAxis = timeAxis;
332         }*/
333         public ChartTypeJSON getChartTypeJSON() {
334                 return chartTypeJSON;
335         }
336         public void setChartTypeJSON(ChartTypeJSON chartTypeJSON) {
337                 this.chartTypeJSON = chartTypeJSON;
338         }
339         public String getChartType() {
340                 return chartTypeJSON.getValue();
341         }       
342         public DomainAxisJSON getDomainAxisJSON() {
343                 return domainAxisJSON;
344         }
345         public void setDomainAxisJSON(DomainAxisJSON domainAxisJSON) {
346                 this.domainAxisJSON = domainAxisJSON;
347         }
348         public CategoryAxisJSON getCategoryAxisJSON() {
349                 return categoryAxisJSON;
350         }
351         public void setCategoryAxisJSON(CategoryAxisJSON categoryAxisJSON) {
352                 this.categoryAxisJSON = categoryAxisJSON;
353         }
354         public ArrayList<RangeAxisJSON> getRangeAxisList() {
355                 return rangeAxisList;
356         }
357         public void setRangeAxisList(ArrayList<RangeAxisJSON> rangeAxisList) {
358                 this.rangeAxisList = rangeAxisList;
359         }
360         public String getPrimaryAxisLabel() {
361                 return primaryAxisLabel;
362         }
363         public void setPrimaryAxisLabel(String primaryAxisLabel) {
364                 this.primaryAxisLabel = primaryAxisLabel;
365         }
366         public String getSecondaryAxisLabel() {
367                 return secondaryAxisLabel;
368         }
369         public void setSecondaryAxisLabel(String secondaryAxisLabel) {
370                 this.secondaryAxisLabel = secondaryAxisLabel;
371         }
372         public String getMinRange() {
373                 return minRange;
374         }
375         public void setMinRange(String minRange) {
376                 this.minRange = minRange;
377         }
378         public String getMaxRange() {
379                 return maxRange;
380         }
381         public void setMaxRange(String maxRange) {
382                 this.maxRange = maxRange;
383         }
384         /*public ArrayList<Row> getRowList() {
385                 return rowList;
386         }
387         public void setRowList(ArrayList<Row> rowList) {
388                 this.rowList = rowList;
389         }*/
390         
391         public ArrayList<ArrayList<Row>> getWholeList() {
392                 return wholeList;
393         }
394         public void setWholeList(ArrayList<ArrayList<Row>> wholeList) {
395                 this.wholeList = wholeList;
396         }       
397         //private ArrayList<ColumnHeader> reportDataColumns;
398         //private ArrayList<Map<String,Object>> reportDataRows;
399         public ArrayList<ChartColumnJSON> getChartColumnJSONList() {
400                 return chartColumnJSONList;
401         }
402         public void setChartColumnJSONList(ArrayList<ChartColumnJSON> chartColumnJSONList) {
403                 this.chartColumnJSONList = chartColumnJSONList;
404         }
405
406         public BarChartOptions getBarChartOptions() {
407                 return barChartOptions;
408         }
409         public void setBarChartOptions(BarChartOptions barChartOptions) {
410                 this.barChartOptions = barChartOptions;
411         }
412         public PieChartOptions getPieChartOptions() {
413                 return pieChartOptions;
414         }
415         public void setPieChartOptions(PieChartOptions pieChartOptions) {
416                 this.pieChartOptions = pieChartOptions;
417         }
418         public TimeSeriesChartOptions getTimeSeriesChartOptions() {
419                 return timeSeriesChartOptions;
420         }
421         public void setTimeSeriesChartOptions(TimeSeriesChartOptions timeSeriesChartOptions) {
422                 this.timeSeriesChartOptions = timeSeriesChartOptions;
423         }
424         public FlexTimeSeriesChartOptions getFlexTimeSeriesChartOptions() {
425                 return flexTimeSeriesChartOptions;
426         }
427         public void setFlexTimeSeriesChartOptions(FlexTimeSeriesChartOptions flexTimeSeriesChartOptions) {
428                 this.flexTimeSeriesChartOptions = flexTimeSeriesChartOptions;
429         }
430         public CommonChartOptions getCommonChartOptions() {
431                 return commonChartOptions;
432         }
433         public void setCommonChartOptions(CommonChartOptions commonChartOptions) {
434                 this.commonChartOptions = commonChartOptions;
435         }
436         
437         public String getDomainAxis() {
438                 if(getDomainAxisJSON() !=null)
439                         return getDomainAxisJSON().getValue();
440                 else
441                         return "";
442         }
443
444         public String getCategoryAxis() {
445                 if(getCategoryAxisJSON()!=null)
446                         return getCategoryAxisJSON().getValue();
447                 else
448                         return "";
449         }
450         
451 }