summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/sdk-analytics/src/main/java/org/openecomp/portalsdk/analytics/view/DataValue.java
blob: 605cb22669fb22f23efac88ad43fd2b4919c71d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
/*-
 * ================================================================================
 * eCOMP Portal SDK
 * ================================================================================
 * Copyright (C) 2017 AT&T Intellectual Property
 * ================================================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ================================================================================
 */
package org.openecomp.portalsdk.analytics.view;

public class DataValue extends org.openecomp.portalsdk.analytics.RaptorObject {
	private String displayValue = "";

	private String displayCalculatedValue = "";

	private String drillDownURL = null;
	
	private boolean drillDowninPoPUp = false;
	
	private String indentation = "";

	private String alignment = "Left";

	private boolean visible = true;
	
	private boolean hidden = false;

	private boolean bold = false;

	private HtmlFormatter cellFormatter = null;

	private HtmlFormatter rowFormatter = null;
	
	private String formatId = null;
	
	private boolean cellFormat = false;
    
    private String colId = null;
    
    private String displayTotal = null;
    
    private String colName = null;
    
 	private String displayName = null;    

    private String nowrap = "False";
    
    private String hyperlinkURL = "";
    
    private String displayType = "";
    
    private String actionImg = "";
    

	public String getColName() {
    
        return colName;
    }

    
    public void setColName(String colName) {
    
        this.colName = colName;
    }

    public DataValue() {
		super();
	}

	public String getFormatId() {
		return formatId;
	}


	public void setFormatId(String formatId) {
		this.formatId = formatId;
	}

	public void setCellFormat(boolean b) {
		cellFormat = b;
	}
	public boolean isCellFormat() {
		return cellFormat;
	}

	public String getDisplayValue() {
		return displayValue;
	}

	public String getDrillDownURL() {
		return drillDownURL;
	}

	public String getAlignment() {
		return alignment;
	}

	public boolean isVisible() {
		return visible;
	}

	public boolean isBold() {
		return bold;
	}

	public HtmlFormatter getCellFormatter() {
		return cellFormatter;
	}

	public HtmlFormatter getRowFormatter() {
		return rowFormatter;
	}

	public void setDisplayValue(String displayValue) {
		this.displayValue = nvl(displayValue);
	}

	public void setDrillDownURL(String drillDownURL) {
		this.drillDownURL = drillDownURL;
	}

	public void setAlignment(String alignment) {
		this.alignment = alignment;
	}

	public void setVisible(boolean visible) {
		this.visible = visible;
	}

	public void setBold(boolean bold) {
		this.bold = bold;
	}

	public void setCellFormatter(HtmlFormatter cellFormatter) {
		this.cellFormatter = cellFormatter;
	}

	public void setRowFormatter(HtmlFormatter rowFormatter) {
		this.rowFormatter = rowFormatter;
	}

	private String getFormattedValue(String value) {
		value = nvl(value.trim()).length()<=0 ? "&nbsp":value;
		if (cellFormatter != null)
			return cellFormatter.formatValue(value);
		else if (rowFormatter != null)
			return rowFormatter.formatValue(value);
		else
			return value;
	} // getFormattedValue

	private String getFormattedLink(String value) {
		if (cellFormatter != null)
			return cellFormatter.formatLink(value, drillDownURL, isDrillDowninPoPUp());
		else if (rowFormatter != null)
			return rowFormatter.formatLink(value, drillDownURL, isDrillDowninPoPUp());
		else {
			if(!isDrillDowninPoPUp()) {
				return "<a href=\"" + drillDownURL + "\">" + value + "</a>";
			} else {
				return "<a href=\"#\"  onClick=\"showDrillDownInPopup('" + drillDownURL + "&noFormFields=Y&isEmbedded=Y&show_back_btn=N"+ "')\">" + value + "</a>";
			}
			
		}
	} // getFormattedValue

	private String getValueHtml() {
		return (nvl(displayValue).trim().length() == 0) ? "&nbsp;" : displayValue;
	}

	public String getDisplayValueHtml() {
		return getFormattedValue(getValueHtml());
	}

	public String getDisplayValueLinkHtml() {
		if (nvl(drillDownURL).length() == 0)
			return getDisplayValueHtml();
		else
			return getFormattedLink(getValueHtml());
		// return getFormattedValue("<a
		// href=\""+drillDownURL+"\">"+getValueHtml()+"</a>");
	} // getDisplayValueLinkHtml

	public String getAlignmentHtml() {
		if (cellFormatter != null && cellFormatter.getAlignment().length() > 0)
			return " align=" + cellFormatter.getAlignment();
		else if (rowFormatter != null && rowFormatter.getAlignment().length() > 0)
			return " align=" + rowFormatter.getAlignment();
		else
			return (alignment.length() == 0) ? "" : (" align=" + alignment);
	} // getAlignmentHtml

	public String getBgColorHtml() {
		if (cellFormatter != null && cellFormatter.getBgColor().length() > 0)
			return " bgcolor=" + cellFormatter.getBgColor();
		else if (rowFormatter != null && rowFormatter.getBgColor().length() > 0)
			return " bgcolor=" + rowFormatter.getBgColor();
		else
			return "";
	} // getBgColorHtml

    
    public String getColId() {
    
        return colId;
    }

    
    public void setColId(String colId) {
    
        this.colId = colId;
    }

    
    public String getDisplayTotal() {
    
        return displayTotal;
    }

    
    public void setDisplayTotal(String displayTotal) {
    
        this.displayTotal = displayTotal;
    }


    
    public String getDisplayName() {
    
        return displayName;
    }


    
    public void setDisplayName(String displayName) {
    
        this.displayName = displayName;
    }


	public boolean isHidden() {
		return hidden;
	}


	public void setHidden(boolean hidden) {
		this.hidden = hidden;
	}

   public String getNowrap() {
		return nowrap;
	}


	public void setNowrap(String nowrap) {
		this.nowrap = nowrap;
	}

	public boolean isDrillDowninPoPUp() {
		return drillDowninPoPUp;
	}


	public void setDrillDowninPoPUp(boolean drillDowninPoPUp) {
		this.drillDowninPoPUp = drillDowninPoPUp;
	}


	/**
	 * @return the displayCalculatedValue
	 */
	public String getDisplayCalculatedValue() {
		return displayCalculatedValue;
	}


	/**
	 * @param displayCalculatedValue the displayCalculatedValue to set
	 */
	public void setDisplayCalculatedValue(String displayCalculatedValue) {
		this.displayCalculatedValue = displayCalculatedValue;
	}


	/**
	 * @return the indentation
	 */
	public String getIndentation() {
		return indentation;
	}


	/**
	 * @param indentation the indentation to set
	 */
	public void setIndentation(String indentation) {
		this.indentation = indentation;
	}
	

	/**
	 * @return the hyperlinkURL
	 */
	public String getHyperlinkURL() {
		return hyperlinkURL;
	}


	/**
	 * @param hyperlinkURL the hyperlinkURL to set
	 */
	public void setHyperlinkURL(String hyperlinkURL) {
		this.hyperlinkURL = hyperlinkURL;
	}


	/**
	 * @return the displayType
	 */
	public String getDisplayType() {
		return displayType;
	}


	/**
	 * @param displayType the displayType to set
	 */
	public void setDisplayType(String displayType) {
		this.displayType = displayType;
	}


	/**
	 * @return the actionImg
	 */
	public String getActionImg() {
		return actionImg;
	}


	/**
	 * @param actionImg the actionImg to set
	 */
	public void setActionImg(String actionImg) {
		this.actionImg = actionImg;
	}
	
} // DataValue