d39ad4a92fc79f44f7460a39d611dc6ddb5f0082
[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 import org.onap.portalsdk.analytics.util.*;
41
42 public class SearchResultColumn extends org.onap.portalsdk.analytics.RaptorObject {
43         private String columnId    = "";
44         private String columnTitle = "";
45
46         private String columnWidth = "";
47
48         private String alignment = "Left";
49
50         private String linkURL = null; // if not null => display link instead of
51                                                                         // text
52
53         private String linkTitle = null; // if img => hint, otherwise link
54                                                                                 // display text
55
56         private String linkForm = null; // if not null => displays input submit
57                                                                         // instead of link
58
59         private String linkConfirmMsg = null; // if not null => display conf. box
60                                                                                         // on link click
61
62         private String linkImg = null; // if not null => link shows image, not text
63
64         private String linkImgWidth = null; // optional
65
66         private String linkImgHeight = null; // optional
67
68         private boolean copyLink = false; // optional
69
70         private boolean editLink = false; // optional
71
72         private boolean deleteLink = false; // optional
73         
74         private boolean scheduleLink = false; // optional
75
76         public SearchResultColumn(String columnId, String columnTitle) {
77                 super();
78         setColumnId(columnId);
79                 setColumnTitle(columnTitle);
80         } // SearchResultColumn
81
82         public SearchResultColumn(String columnId, String columnTitle, String columnWidth, String alignment) {
83                 super();
84                  setColumnId(columnId);
85                 setColumnTitle(columnTitle);
86                 setColumnWidth(columnWidth);
87                 setAlignment(alignment);
88         } // SearchResultColumn
89
90         public SearchResultColumn(String columnId, String columnTitle, String columnWidth, String alignment,
91                         String linkURL, String linkTitle, String linkForm, String linkConfirmMsg,
92                         String linkImg) {
93                 super();
94                  setColumnId(columnId);
95                 setColumnTitle(columnTitle);
96                 setColumnWidth(columnWidth);
97                 setAlignment(alignment);
98                 setLinkURL(linkURL);
99                 setLinkTitle(linkTitle);
100                 setLinkForm(linkForm);
101                 setLinkConfirmMsg(linkConfirmMsg);
102                 setLinkImg(linkImg);
103         } // SearchResultColumn
104
105         public SearchResultColumn(String columnId, String columnTitle, String columnWidth, String alignment,
106                         String linkURL, String linkTitle, String linkForm, String linkConfirmMsg,
107                         String linkImg, String linkImgWidth, String linkImgHeight) {
108                 this(columnId, columnTitle, columnWidth, alignment, linkURL, linkTitle, linkForm,
109                                 linkConfirmMsg, linkImg);
110
111                 setLinkWidth(linkImgWidth);
112                 setLinkHeight(linkImgHeight);
113         } // SearchResultColumn
114
115         public SearchResultColumn(String columnId, String columnTitle, String columnWidth, String alignment,
116                         String linkURL, String linkTitle, String linkForm, String linkConfirmMsg,
117                         String linkImg, String linkImgWidth, String linkImgHeight, boolean copyLink,
118                         boolean editLink, boolean deleteLink) {
119                 this(columnId, columnTitle, columnWidth, alignment, linkURL, linkTitle, linkForm,
120                                 linkConfirmMsg, linkImg, linkImgWidth, linkImgHeight);
121
122                 setCopyLink(copyLink);
123                 setEditLink(editLink);
124                 setDeleteLink(deleteLink);
125         } // SearchResultColumn
126
127         public SearchResultColumn(String columnId, String columnTitle, String columnWidth, String alignment,
128                         String linkURL, String linkTitle, String linkForm, String linkConfirmMsg,
129                         String linkImg, String linkImgWidth, String linkImgHeight, boolean copyLink,
130                         boolean editLink, boolean deleteLink, boolean scheduleLink) {
131                 this(columnId, columnTitle, columnWidth, alignment, linkURL, linkTitle, linkForm,
132                                 linkConfirmMsg, linkImg, linkImgWidth, linkImgHeight);
133
134                 setCopyLink(copyLink);
135                 setEditLink(editLink);
136                 setDeleteLink(deleteLink);
137                 setScheduleLink(scheduleLink);
138         } // SearchResultColumn
139         
140         public String getColumnTitle() {
141                 return columnTitle;
142         }
143
144         public String getColumnWidth() {
145                 return columnWidth;
146         }
147
148         public String getAlignment() {
149                 return alignment;
150         }
151
152         public String getLinkURL() {
153                 return linkURL;
154         }
155
156         public String getLinkTitle() {
157                 return linkTitle;
158         }
159
160         public String getLinkForm() {
161                 return linkForm;
162         }
163
164         public String getLinkConfirmMsg() {
165                 return linkConfirmMsg;
166         }
167
168         public String getLinkImg() {
169                 return linkImg;
170         }
171
172         public String getLinkImgWidth() {
173                 return linkImgWidth;
174         }
175
176         public String getLinkImgHeight() {
177                 return linkImgHeight;
178         }
179
180         public boolean isCopyLink() {
181                 return copyLink;
182         }
183
184         public boolean isEditLink() {
185                 return editLink;
186         }
187
188         public boolean isDeleteLink() {
189                 return deleteLink;
190         }
191
192         public void setColumnTitle(String columnTitle) {
193                 this.columnTitle = nvl(columnTitle);
194         }
195
196         public void setColumnWidth(String columnWidth) {
197                 this.columnWidth = nvl(columnWidth);
198         }
199
200         public void setAlignment(String alignment) {
201                 this.alignment = alignment;
202         }
203
204         public void setLinkURL(String linkURL) {
205                 this.linkURL = linkURL;
206         }
207
208         public void setLinkTitle(String linkTitle) {
209                 this.linkTitle = linkTitle;
210         }
211
212         public void setLinkForm(String linkForm) {
213                 this.linkForm = linkForm;
214         }
215
216         public void setLinkConfirmMsg(String linkConfirmMsg) {
217                 this.linkConfirmMsg = linkConfirmMsg;
218         }
219
220         public void setLinkImg(String linkImg) {
221                 this.linkImg = linkImg;
222         }
223
224         public void setLinkWidth(String linkImgWidth) {
225                 this.linkImgWidth = linkImgWidth;
226         }
227
228         public void setLinkHeight(String linkImgHeight) {
229                 this.linkImgHeight = linkImgHeight;
230         }
231
232         public void setCopyLink(boolean copyLink) {
233                 this.copyLink = copyLink;
234         }
235
236         public void setEditLink(boolean editLink) {
237                 this.editLink = editLink;
238         }
239
240         public void setDeleteLink(boolean deleteLink) {
241                 this.deleteLink = deleteLink;
242         }
243
244         public String getColumnTitleHtml() {
245                 return (columnTitle.length() == 0) ? " " : columnTitle;
246         }
247
248         public String getColumnWidthHtml() {
249                 return (columnWidth.length() == 0) ? "" : (" width=" + columnWidth);
250         }
251
252         public String getLinkImgSizeHtml() {
253                 return ((nvl(linkImgWidth).length() > 0) ? " width=\"" + linkImgWidth + "\"" : "")
254                                 + ((nvl(linkImgHeight).length() > 0) ? " height=\"" + linkImgHeight + "\""
255                                                 : "");
256         }
257
258         public boolean isScheduleLink() {
259                 return scheduleLink;
260         }
261
262         public void setScheduleLink(boolean scheduleLink) {
263                 this.scheduleLink = scheduleLink;
264         }
265
266         public String getColumnId() {
267                 return columnId;
268         }
269
270         public void setColumnId(String columnId) {
271                 this.columnId = columnId;
272         }
273
274 } // SearchResultColumn