/*
* ============LICENSE_START==========================================
* ONAP Portal SDK
* ===================================================================
* Copyright © 2017 AT&T Intellectual Property. All rights reserved.
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
* under the Apache License, Version 2.0 (the "License");
* you may not use this software 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.
*
* Unless otherwise specified, all documentation contained herein is licensed
* under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
* https://creativecommons.org/licenses/by/4.0/
*
* Unless required by applicable law or agreed to in writing, documentation
* 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.
*
* ============LICENSE_END============================================
*
*
*/
package org.onap.portalsdk.analytics.model.search;
import org.onap.portalsdk.analytics.util.AppConstants;
public class SearchResultField extends org.onap.portalsdk.analytics.RaptorObject {
private String columnId;
private String displayValue = "";
private String alignment = "Left";
private String drillDownLink = null;
private String drillDownImage = null;
private String confirmationText = null;
private boolean isAuthorized = false;
public boolean isAuthorized() {
return isAuthorized;
}
public void setAuthorized(boolean isAuthorized) {
this.isAuthorized = isAuthorized;
}
public String getConfirmationText() {
return confirmationText;
}
public void setConfirmationText(String confirmationText) {
this.confirmationText = confirmationText;
}
public String getDrillDownImage() {
return drillDownImage;
}
public void setDrillDownImage(String drillDownImage) {
this.drillDownImage = drillDownImage;
}
public SearchResultField() {
}
public SearchResultField(String displayValue, String linkIdValue,
SearchResultColumn column, boolean isAuthorized) {
super();
if (!isAuthorized)
return;
setColumnId(column.getColumnId());
setDisplayValue(displayValue);
setAlignment(column.getAlignment());
setAuthorized(isAuthorized);
if(column.getColumnId().equals("edit")) {
setDrillDownLink("report#/report_wizard/"+linkIdValue);
setDrillDownImage(column.getLinkImg());
setConfirmationText(null);
} else if(column.getColumnId().equals("copy")) {
setDrillDownLink("report#/report_wizard/copy/"+linkIdValue);
setDrillDownImage(column.getLinkImg());
setConfirmationText(column.getLinkConfirmMsg());
} else if(column.getColumnId().equals("delete")) {
setDrillDownLink("raptor.htm?action=report.delete&c_master="+linkIdValue);
setDrillDownImage(column.getLinkImg());
setConfirmationText(column.getLinkConfirmMsg());
} else if(column.getColumnId().equals("schedule")) {
setDrillDownLink("report_wizard.htm?action=report.schedule.report.submit_wmenu&c_master="+linkIdValue+"&refresh=Y");
setDrillDownImage(column.getLinkImg());
setConfirmationText(null);
} else if(column.getColumnId().equals("run")) {
setDrillDownLink("raptor.htm?action=report.run.container&c_master="+linkIdValue+"&refresh=Y");
setDrillDownImage(column.getLinkImg());
setConfirmationText(null);
} else {
if (column.getLinkURL() != null) {
StringBuffer sb = new StringBuffer();
if (column.getLinkForm() == null) {
sb.append("");
if (column.getLinkImg() != null) {
sb.append("");
} else
sb.append(column.getLinkTitle());
sb.append("");
} else {
sb.append("");
} // else
setDrillDownLink(sb.toString());
} // if
}
} // SearchResultField
public String getDisplayValue() {
return displayValue;
}
public String getAlignment() {
return alignment;
}
public String getDrillDownLink() {
return drillDownLink;
}
public void setDisplayValue(String displayValue) {
this.displayValue = nvl(displayValue);
}
public void setAlignment(String alignment) {
this.alignment = alignment;
}
public void setDrillDownLink(String drillDownLink) {
this.drillDownLink = drillDownLink;
}
public String getTooltipValue() {
return (displayValue.length() == 0) ? " " : displayValue;
}
public String getColumnId() {
return columnId;
}
public void setColumnId(String columnId) {
this.columnId = columnId;
}
} // SearchResultField