2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6 * ===================================================================
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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.
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
26 * https://creativecommons.org/licenses/by/4.0/
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.
34 * ============LICENSE_END============================================
36 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
38 package org.onap.portalsdk.analytics.model.search;
40 import org.onap.portalsdk.analytics.util.*;
42 public class SearchResultColumn extends org.onap.portalsdk.analytics.RaptorObject {
43 private String columnId = "";
44 private String columnTitle = "";
46 private String columnWidth = "";
48 private String alignment = "Left";
50 private String linkURL = null; // if not null => display link instead of
53 private String linkTitle = null; // if img => hint, otherwise link
56 private String linkForm = null; // if not null => displays input submit
59 private String linkConfirmMsg = null; // if not null => display conf. box
62 private String linkImg = null; // if not null => link shows image, not text
64 private String linkImgWidth = null; // optional
66 private String linkImgHeight = null; // optional
68 private boolean copyLink = false; // optional
70 private boolean editLink = false; // optional
72 private boolean deleteLink = false; // optional
74 private boolean scheduleLink = false; // optional
76 public SearchResultColumn(String columnId, String columnTitle) {
78 setColumnId(columnId);
79 setColumnTitle(columnTitle);
80 } // SearchResultColumn
82 public SearchResultColumn(String columnId, String columnTitle, String columnWidth, String alignment) {
84 setColumnId(columnId);
85 setColumnTitle(columnTitle);
86 setColumnWidth(columnWidth);
87 setAlignment(alignment);
88 } // SearchResultColumn
90 public SearchResultColumn(String columnId, String columnTitle, String columnWidth, String alignment,
91 String linkURL, String linkTitle, String linkForm, String linkConfirmMsg,
94 setColumnId(columnId);
95 setColumnTitle(columnTitle);
96 setColumnWidth(columnWidth);
97 setAlignment(alignment);
99 setLinkTitle(linkTitle);
100 setLinkForm(linkForm);
101 setLinkConfirmMsg(linkConfirmMsg);
103 } // SearchResultColumn
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);
111 setLinkWidth(linkImgWidth);
112 setLinkHeight(linkImgHeight);
113 } // SearchResultColumn
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);
122 setCopyLink(copyLink);
123 setEditLink(editLink);
124 setDeleteLink(deleteLink);
125 } // SearchResultColumn
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);
134 setCopyLink(copyLink);
135 setEditLink(editLink);
136 setDeleteLink(deleteLink);
137 setScheduleLink(scheduleLink);
138 } // SearchResultColumn
140 public String getColumnTitle() {
144 public String getColumnWidth() {
148 public String getAlignment() {
152 public String getLinkURL() {
156 public String getLinkTitle() {
160 public String getLinkForm() {
164 public String getLinkConfirmMsg() {
165 return linkConfirmMsg;
168 public String getLinkImg() {
172 public String getLinkImgWidth() {
176 public String getLinkImgHeight() {
177 return linkImgHeight;
180 public boolean isCopyLink() {
184 public boolean isEditLink() {
188 public boolean isDeleteLink() {
192 public void setColumnTitle(String columnTitle) {
193 this.columnTitle = nvl(columnTitle);
196 public void setColumnWidth(String columnWidth) {
197 this.columnWidth = nvl(columnWidth);
200 public void setAlignment(String alignment) {
201 this.alignment = alignment;
204 public void setLinkURL(String linkURL) {
205 this.linkURL = linkURL;
208 public void setLinkTitle(String linkTitle) {
209 this.linkTitle = linkTitle;
212 public void setLinkForm(String linkForm) {
213 this.linkForm = linkForm;
216 public void setLinkConfirmMsg(String linkConfirmMsg) {
217 this.linkConfirmMsg = linkConfirmMsg;
220 public void setLinkImg(String linkImg) {
221 this.linkImg = linkImg;
224 public void setLinkWidth(String linkImgWidth) {
225 this.linkImgWidth = linkImgWidth;
228 public void setLinkHeight(String linkImgHeight) {
229 this.linkImgHeight = linkImgHeight;
232 public void setCopyLink(boolean copyLink) {
233 this.copyLink = copyLink;
236 public void setEditLink(boolean editLink) {
237 this.editLink = editLink;
240 public void setDeleteLink(boolean deleteLink) {
241 this.deleteLink = deleteLink;
244 public String getColumnTitleHtml() {
245 return (columnTitle.length() == 0) ? " " : columnTitle;
248 public String getColumnWidthHtml() {
249 return (columnWidth.length() == 0) ? "" : (" width=" + columnWidth);
252 public String getLinkImgSizeHtml() {
253 return ((nvl(linkImgWidth).length() > 0) ? " width=\"" + linkImgWidth + "\"" : "")
254 + ((nvl(linkImgHeight).length() > 0) ? " height=\"" + linkImgHeight + "\""
258 public boolean isScheduleLink() {
262 public void setScheduleLink(boolean scheduleLink) {
263 this.scheduleLink = scheduleLink;
266 public String getColumnId() {
270 public void setColumnId(String columnId) {
271 this.columnId = columnId;
274 } // SearchResultColumn