66bce17a721ece11bc8f0a0dc73b15750074f6f6
[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 <RangeAxisJSON> rangeAxisRemoveList;
134         
135         private ArrayList <ArrayList<Row>> wholeList;
136
137         private String primaryAxisLabel;
138         private String secondaryAxisLabel;
139         private String minRange;
140         private String maxRange;
141         //private int topMargin;
142         //private int bottomMargin;
143         //private int leftMargin;
144         //private int rightMargin;
145         
146         /*private boolean showMaxMin;
147         private boolean showLegend;
148         private boolean showControls;
149         private String topMargin;
150         private String bottomMargin;
151         private String leftMargin;
152         private String rightMargin;
153         private String subType;
154         private boolean stacked;
155         private boolean horizontalBar;
156         private boolean barRealTimeAxis;
157         private boolean barReduceXAxisLabels;
158         private boolean timeAxis;*/
159         
160         public String getReportID() {
161                 return reportID;
162         }
163         public void setReportID(String reportID) {
164                 this.reportID = reportID;
165         }
166         public String getReportName() {
167                 return reportName;
168         }
169         public void setReportName(String reportName) {
170                 this.reportName = reportName;
171         }
172         public String getReportDescr() {
173                 return reportDescr;
174         }
175         public void setReportDescr(String reportDescr) {
176                 this.reportDescr = reportDescr;
177         }
178         public String getReportTitle() {
179                 return reportTitle;
180         }
181         public void setReportTitle(String reportTitle) {
182                 this.reportTitle = reportTitle;
183         }
184         public String getReportSubTitle() {
185                 return reportSubTitle;
186         }
187         public void setReportSubTitle(String reportSubTitle) {
188                 this.reportSubTitle = reportSubTitle;
189         }
190         public ArrayList<FormFieldJSON> getFormFieldList() {
191                 return formFieldList;
192         }
193         public void setFormFieldList(ArrayList<FormFieldJSON> formFieldList) {
194                 this.formFieldList = formFieldList;
195         }
196         public String getFormfield_comments() {
197                 return formfield_comments;
198         }
199         public void setFormfield_comments(String formfield_comments) {
200                 this.formfield_comments = formfield_comments;
201         }
202         public int getTotalRows() {
203                 return totalRows;
204         }
205         public void setTotalRows(int totalRows) {
206                 this.totalRows = totalRows;
207         }
208         public String getChartSqlWhole() {
209                 return chartSqlWhole;
210         }
211         public void setChartSqlWhole(String chartSqlWhole) {
212                 this.chartSqlWhole = chartSqlWhole;
213         }
214         public boolean isChartAvailable() {
215                 return chartAvailable;
216         }
217         public void setChartAvailable(boolean chartAvailable) {
218                 this.chartAvailable = chartAvailable;
219         }
220         public String getWidth() {
221                 return width;
222         }
223         public void setWidth(String width) {
224                 this.width = width;
225         }
226         public String getHeight() {
227                 return height;
228         }
229         public void setHeight(String height) {
230                 this.height = height;
231         }
232         public boolean isAnimation() {
233                 return animation;
234         }
235         public void setAnimation(boolean animation) {
236                 this.animation = animation;
237         }
238         public String getRotateLabels() {
239                 return rotateLabels;
240         }
241         public void setRotateLabels(String rotateLabels) {
242                 this.rotateLabels = rotateLabels;
243         }
244         public boolean isStaggerLabels() {
245                 return staggerLabels;
246         }
247         public void setStaggerLabels(boolean staggerLabels) {
248                 this.staggerLabels = staggerLabels;
249         }
250         public boolean isShowTitle() {
251                 return showTitle;
252         }
253         public void setShowTitle(boolean showTitle) {
254                 this.showTitle = showTitle;
255         }       
256         /*public boolean isShowMaxMin() {
257                 return showMaxMin;
258         }
259         public void setShowMaxMin(boolean showMaxMin) {
260                 this.showMaxMin = showMaxMin;
261         }
262         public boolean isShowLegend() {
263                 return showLegend;
264         }
265         public void setShowLegend(boolean showLegend) {
266                 this.showLegend = showLegend;
267         }
268         public boolean isShowControls() {
269                 return showControls;
270         }
271         public void setShowControls(boolean showControls) {
272                 this.showControls = showControls;
273         }
274         public String getTopMargin() {
275                 return topMargin;
276         }
277         public void setTopMargin(String topMargin) {
278                 this.topMargin = topMargin;
279         }
280         public String getBottomMargin() {
281                 return bottomMargin;
282         }
283         public void setBottomMargin(String bottomMargin) {
284                 this.bottomMargin = bottomMargin;
285         }
286         public String getLeftMargin() {
287                 return leftMargin;
288         }
289         public void setLeftMargin(String leftMargin) {
290                 this.leftMargin = leftMargin;
291         }
292         public String getRightMargin() {
293                 return rightMargin;
294         }
295         public void setRightMargin(String rightMargin) {
296                 this.rightMargin = rightMargin;
297         }
298
299         public String getSubType() {
300                 return subType;
301         }
302         public void setSubType(String subType) {
303                 this.subType = subType;
304         }
305         public boolean isStacked() {
306                 return stacked;
307         }
308         public void setStacked(boolean stacked) {
309                 this.stacked = stacked;
310         }
311         public boolean isHorizontalBar() {
312                 return horizontalBar;
313         }
314         public void setHorizontalBar(boolean horizontalBar) {
315                 this.horizontalBar = horizontalBar;
316         }
317         public boolean isBarRealTimeAxis() {
318                 return barRealTimeAxis;
319         }
320         public void setBarRealTimeAxis(boolean barRealTimeAxis) {
321                 this.barRealTimeAxis = barRealTimeAxis;
322         }
323         public boolean isBarReduceXAxisLabels() {
324                 return barReduceXAxisLabels;
325         }
326         public void setBarReduceXAxisLabels(boolean barReduceXAxisLabels) {
327                 this.barReduceXAxisLabels = barReduceXAxisLabels;
328         }
329         public boolean isTimeAxis() {
330                 return timeAxis;
331         }
332         public void setTimeAxis(boolean timeAxis) {
333                 this.timeAxis = timeAxis;
334         }*/
335         public ChartTypeJSON getChartTypeJSON() {
336                 return chartTypeJSON;
337         }
338         public void setChartTypeJSON(ChartTypeJSON chartTypeJSON) {
339                 this.chartTypeJSON = chartTypeJSON;
340         }
341         public String getChartType() {
342                 return chartTypeJSON.getValue();
343         }       
344         public DomainAxisJSON getDomainAxisJSON() {
345                 return domainAxisJSON;
346         }
347         public void setDomainAxisJSON(DomainAxisJSON domainAxisJSON) {
348                 this.domainAxisJSON = domainAxisJSON;
349         }
350         public CategoryAxisJSON getCategoryAxisJSON() {
351                 return categoryAxisJSON;
352         }
353         public void setCategoryAxisJSON(CategoryAxisJSON categoryAxisJSON) {
354                 this.categoryAxisJSON = categoryAxisJSON;
355         }
356         public ArrayList<RangeAxisJSON> getRangeAxisList() {
357                 return rangeAxisList;
358         }
359         public void setRangeAxisList(ArrayList<RangeAxisJSON> rangeAxisList) {
360                 this.rangeAxisList = rangeAxisList;
361         }
362         public String getPrimaryAxisLabel() {
363                 return primaryAxisLabel;
364         }
365         public void setPrimaryAxisLabel(String primaryAxisLabel) {
366                 this.primaryAxisLabel = primaryAxisLabel;
367         }
368         public String getSecondaryAxisLabel() {
369                 return secondaryAxisLabel;
370         }
371         public void setSecondaryAxisLabel(String secondaryAxisLabel) {
372                 this.secondaryAxisLabel = secondaryAxisLabel;
373         }
374         public String getMinRange() {
375                 return minRange;
376         }
377         public void setMinRange(String minRange) {
378                 this.minRange = minRange;
379         }
380         public String getMaxRange() {
381                 return maxRange;
382         }
383         public void setMaxRange(String maxRange) {
384                 this.maxRange = maxRange;
385         }
386         /*public ArrayList<Row> getRowList() {
387                 return rowList;
388         }
389         public void setRowList(ArrayList<Row> rowList) {
390                 this.rowList = rowList;
391         }*/
392         
393         public ArrayList<ArrayList<Row>> getWholeList() {
394                 return wholeList;
395         }
396         public void setWholeList(ArrayList<ArrayList<Row>> wholeList) {
397                 this.wholeList = wholeList;
398         }       
399         //private ArrayList<ColumnHeader> reportDataColumns;
400         //private ArrayList<Map<String,Object>> reportDataRows;
401         public ArrayList<ChartColumnJSON> getChartColumnJSONList() {
402                 return chartColumnJSONList;
403         }
404         public void setChartColumnJSONList(ArrayList<ChartColumnJSON> chartColumnJSONList) {
405                 this.chartColumnJSONList = chartColumnJSONList;
406         }
407
408         public BarChartOptions getBarChartOptions() {
409                 return barChartOptions;
410         }
411         public void setBarChartOptions(BarChartOptions barChartOptions) {
412                 this.barChartOptions = barChartOptions;
413         }
414         public PieChartOptions getPieChartOptions() {
415                 return pieChartOptions;
416         }
417         public void setPieChartOptions(PieChartOptions pieChartOptions) {
418                 this.pieChartOptions = pieChartOptions;
419         }
420         public TimeSeriesChartOptions getTimeSeriesChartOptions() {
421                 return timeSeriesChartOptions;
422         }
423         public void setTimeSeriesChartOptions(TimeSeriesChartOptions timeSeriesChartOptions) {
424                 this.timeSeriesChartOptions = timeSeriesChartOptions;
425         }
426         public FlexTimeSeriesChartOptions getFlexTimeSeriesChartOptions() {
427                 return flexTimeSeriesChartOptions;
428         }
429         public void setFlexTimeSeriesChartOptions(FlexTimeSeriesChartOptions flexTimeSeriesChartOptions) {
430                 this.flexTimeSeriesChartOptions = flexTimeSeriesChartOptions;
431         }
432         public CommonChartOptions getCommonChartOptions() {
433                 return commonChartOptions;
434         }
435         public void setCommonChartOptions(CommonChartOptions commonChartOptions) {
436                 this.commonChartOptions = commonChartOptions;
437         }
438         
439         public String getDomainAxis() {
440                 if(getDomainAxisJSON() !=null)
441                         return getDomainAxisJSON().getValue();
442                 else
443                         return "";
444         }
445
446         public String getCategoryAxis() {
447                 if(getCategoryAxisJSON()!=null)
448                         return getCategoryAxisJSON().getValue();
449                 else
450                         return "";
451         }
452         public ArrayList<RangeAxisJSON> getRangeAxisRemoveList() {
453                 return rangeAxisRemoveList;
454         }
455         public void setRangeAxisRemoveList(ArrayList<RangeAxisJSON> rangeAxisRemoveList) {
456                 this.rangeAxisRemoveList = rangeAxisRemoveList;
457         }
458         
459         
460 }