45e6a6a8249d556cb220f523333c1433e185f9ba
[portal/sdk.git] /
1 /*
2  * ============LICENSE_START==========================================
3  * ONAP Portal SDK
4  * ===================================================================
5  * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6  * ===================================================================
7  *
8  * Unless otherwise specified, all software contained herein is licensed
9  * under the Apache License, Version 2.0 (the "License");
10  * you may not use this software except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *             http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  * Unless otherwise specified, all documentation contained herein is licensed
22  * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
23  * you may not use this documentation except in compliance with the License.
24  * You may obtain a copy of the License at
25  *
26  *             https://creativecommons.org/licenses/by/4.0/
27  *
28  * Unless required by applicable law or agreed to in writing, documentation
29  * distributed under the License is distributed on an "AS IS" BASIS,
30  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31  * See the License for the specific language governing permissions and
32  * limitations under the License.
33  *
34  * ============LICENSE_END============================================
35  *
36  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
37  */
38 package org.onap.portalsdk.analytics.model.search;
39
40 public class SearchResultColumn extends org.onap.portalsdk.analytics.RaptorObject {
41         private String columnId    = "";
42         private String columnTitle = "";
43
44         private String columnWidth = "";
45
46         private String alignment = "Left";
47
48         private String linkURL = null; // if not null => display link instead of
49                                                                         // text
50
51         private String linkTitle = null; // if img => hint, otherwise link
52                                                                                 // display text
53
54         private String linkForm = null; // if not null => displays input submit
55                                                                         // instead of link
56
57         private String linkConfirmMsg = null; // if not null => display conf. box
58                                                                                         // on link click
59
60         private String linkImg = null; // if not null => link shows image, not text
61
62         private String linkImgWidth = null; // optional
63
64         private String linkImgHeight = null; // optional
65
66         private boolean copyLink = false; // optional
67
68         private boolean editLink = false; // optional
69
70         private boolean deleteLink = false; // optional
71         
72         private boolean scheduleLink = false; // optional
73
74         public SearchResultColumn(String columnId, String columnTitle) {
75                 super();
76         setColumnId(columnId);
77                 setColumnTitle(columnTitle);
78         } // SearchResultColumn
79
80         public SearchResultColumn(String columnId, String columnTitle, String columnWidth, String alignment) {
81                 super();
82                  setColumnId(columnId);
83                 setColumnTitle(columnTitle);
84                 setColumnWidth(columnWidth);
85                 setAlignment(alignment);
86         } // SearchResultColumn
87
88         public SearchResultColumn(String columnId, String columnTitle, String columnWidth, String alignment,
89                         String linkURL, String linkTitle, String linkForm, String linkConfirmMsg,
90                         String linkImg) {
91                 super();
92                  setColumnId(columnId);
93                 setColumnTitle(columnTitle);
94                 setColumnWidth(columnWidth);
95                 setAlignment(alignment);
96                 setLinkURL(linkURL);
97                 setLinkTitle(linkTitle);
98                 setLinkForm(linkForm);
99                 setLinkConfirmMsg(linkConfirmMsg);
100                 setLinkImg(linkImg);
101         } // SearchResultColumn
102
103         public SearchResultColumn(String columnId, String columnTitle, String columnWidth, String alignment,
104                         String linkURL, String linkTitle, String linkForm, String linkConfirmMsg,
105                         String linkImg, String linkImgWidth, String linkImgHeight) {
106                 this(columnId, columnTitle, columnWidth, alignment, linkURL, linkTitle, linkForm,
107                                 linkConfirmMsg, linkImg);
108
109                 setLinkWidth(linkImgWidth);
110                 setLinkHeight(linkImgHeight);
111         } // SearchResultColumn
112
113         public SearchResultColumn(String columnId, String columnTitle, String columnWidth, String alignment,
114                         String linkURL, String linkTitle, String linkForm, String linkConfirmMsg,
115                         String linkImg, String linkImgWidth, String linkImgHeight, boolean copyLink,
116                         boolean editLink, boolean deleteLink) {
117                 this(columnId, columnTitle, columnWidth, alignment, linkURL, linkTitle, linkForm,
118                                 linkConfirmMsg, linkImg, linkImgWidth, linkImgHeight);
119
120                 setCopyLink(copyLink);
121                 setEditLink(editLink);
122                 setDeleteLink(deleteLink);
123         } // SearchResultColumn
124
125         public SearchResultColumn(String columnId, String columnTitle, String columnWidth, String alignment,
126                         String linkURL, String linkTitle, String linkForm, String linkConfirmMsg,
127                         String linkImg, String linkImgWidth, String linkImgHeight, boolean copyLink,
128                         boolean editLink, boolean deleteLink, boolean scheduleLink) {
129                 this(columnId, columnTitle, columnWidth, alignment, linkURL, linkTitle, linkForm,
130                                 linkConfirmMsg, linkImg, linkImgWidth, linkImgHeight);
131
132                 setCopyLink(copyLink);
133                 setEditLink(editLink);
134                 setDeleteLink(deleteLink);
135                 setScheduleLink(scheduleLink);
136         } // SearchResultColumn
137         
138         public String getColumnTitle() {
139                 return columnTitle;
140         }
141
142         public String getColumnWidth() {
143                 return columnWidth;
144         }
145
146         public String getAlignment() {
147                 return alignment;
148         }
149
150         public String getLinkURL() {
151                 return linkURL;
152         }
153
154         public String getLinkTitle() {
155                 return linkTitle;
156         }
157
158         public String getLinkForm() {
159                 return linkForm;
160         }
161
162         public String getLinkConfirmMsg() {
163                 return linkConfirmMsg;
164         }
165
166         public String getLinkImg() {
167                 return linkImg;
168         }
169
170         public String getLinkImgWidth() {
171                 return linkImgWidth;
172         }
173
174         public String getLinkImgHeight() {
175                 return linkImgHeight;
176         }
177
178         public boolean isCopyLink() {
179                 return copyLink;
180         }
181
182         public boolean isEditLink() {
183                 return editLink;
184         }
185
186         public boolean isDeleteLink() {
187                 return deleteLink;
188         }
189
190         public void setColumnTitle(String columnTitle) {
191                 this.columnTitle = nvl(columnTitle);
192         }
193
194         public void setColumnWidth(String columnWidth) {
195                 this.columnWidth = nvl(columnWidth);
196         }
197
198         public void setAlignment(String alignment) {
199                 this.alignment = alignment;
200         }
201
202         public void setLinkURL(String linkURL) {
203                 this.linkURL = linkURL;
204         }
205
206         public void setLinkTitle(String linkTitle) {
207                 this.linkTitle = linkTitle;
208         }
209
210         public void setLinkForm(String linkForm) {
211                 this.linkForm = linkForm;
212         }
213
214         public void setLinkConfirmMsg(String linkConfirmMsg) {
215                 this.linkConfirmMsg = linkConfirmMsg;
216         }
217
218         public void setLinkImg(String linkImg) {
219                 this.linkImg = linkImg;
220         }
221
222         public void setLinkWidth(String linkImgWidth) {
223                 this.linkImgWidth = linkImgWidth;
224         }
225
226         public void setLinkHeight(String linkImgHeight) {
227                 this.linkImgHeight = linkImgHeight;
228         }
229
230         public void setCopyLink(boolean copyLink) {
231                 this.copyLink = copyLink;
232         }
233
234         public void setEditLink(boolean editLink) {
235                 this.editLink = editLink;
236         }
237
238         public void setDeleteLink(boolean deleteLink) {
239                 this.deleteLink = deleteLink;
240         }
241
242         public String getColumnTitleHtml() {
243                 return (columnTitle.length() == 0) ? " " : columnTitle;
244         }
245
246         public String getColumnWidthHtml() {
247                 return (columnWidth.length() == 0) ? "" : (" width=" + columnWidth);
248         }
249
250         public String getLinkImgSizeHtml() {
251                 return ((nvl(linkImgWidth).length() > 0) ? " width=\"" + linkImgWidth + "\"" : "")
252                                 + ((nvl(linkImgHeight).length() > 0) ? " height=\"" + linkImgHeight + "\""
253                                                 : "");
254         }
255
256         public boolean isScheduleLink() {
257                 return scheduleLink;
258         }
259
260         public void setScheduleLink(boolean scheduleLink) {
261                 this.scheduleLink = scheduleLink;
262         }
263
264         public String getColumnId() {
265                 return columnId;
266         }
267
268         public void setColumnId(String columnId) {
269                 this.columnId = columnId;
270         }
271
272 } // SearchResultColumn