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