From ad2d7d08693ccb514d51e15505541bc55051a871 Mon Sep 17 00:00:00 2001 From: Sudarshan Kumar Date: Mon, 2 Nov 2020 16:53:33 +0530 Subject: Portal-Raptor Fixes Portal-Raptor Fixes - Not able to save report SQL Tab Info Issue-ID: PORTAL-1036 Change-Id: Ic55b1ec35782d54a27186e8f2d9e17d809413d8c Signed-off-by: Sudarshan Kumar --- .../onap/portalsdk/analytics/model/base/ReportSecurity.java | 8 +++++++- .../analytics/model/definition/ReportDefinition.java | 9 +++++++++ .../analytics/system/fusion/web/RaptorControllerAsync.java | 11 +++++++++++ .../org/onap/portalsdk/analytics/xmlobj/DataColumnList.java | 9 +++++++-- .../org/onap/portalsdk/analytics/xmlobj/DataColumnType.java | 10 ++++++++-- .../org/onap/portalsdk/analytics/xmlobj/DataSourceList.java | 9 +++++++-- .../org/onap/portalsdk/analytics/xmlobj/DataSourceType.java | 10 ++++++++-- 7 files changed, 57 insertions(+), 9 deletions(-) diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/ReportSecurity.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/ReportSecurity.java index 5da6c563..8104acdc 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/ReportSecurity.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/ReportSecurity.java @@ -37,6 +37,7 @@ */ package org.onap.portalsdk.analytics.model.base; +import java.io.Serializable; import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; @@ -55,7 +56,12 @@ import org.onap.portalsdk.analytics.util.DataSet; import org.onap.portalsdk.analytics.util.Utils; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; -public class ReportSecurity extends org.onap.portalsdk.analytics.RaptorObject { +public class ReportSecurity extends org.onap.portalsdk.analytics.RaptorObject implements Serializable{ + + /** + * + */ + private static final long serialVersionUID = 1L; private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ReportSecurity.class); diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/definition/ReportDefinition.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/definition/ReportDefinition.java index 8b1cc8cb..343862b6 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/definition/ReportDefinition.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/definition/ReportDefinition.java @@ -274,6 +274,7 @@ public class ReportDefinition extends ReportWrapper implements Serializable { } // canPersistCrossTabReport private boolean canPersistReport() { + String reportType = getReportType(); return getReportType().equals(AppConstants.RT_CROSSTAB) ? canPersistCrossTabReport() : (getReportType().equals(AppConstants.RT_LINEAR)? canPersistLinearReport() :(getReportType().equals(AppConstants.RT_HIVE)? canPersistLinearReport() @@ -307,6 +308,14 @@ public class ReportDefinition extends ReportWrapper implements Serializable { } DataSet ds = DbUtils.executeQuery(connection,sql); setReportID(ds.getString(0, 0)); + + //Start - Added new code + ReportDefinition rdef = (ReportDefinition) request.getSession().getAttribute(AppConstants.SI_REPORT_DEFINITION); + if(rdef != null) { + rdef.setReportID(ds.getString(0, 0)); + } + request.getSession().setAttribute(AppConstants.SI_REPORT_DEFINITION, rdef); + //End - Added new code reportSecurity.reportCreate(reportID, userID, isPublic()); ReportLoader.createCustomReportRec(connection, this, reportXML); diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/fusion/web/RaptorControllerAsync.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/fusion/web/RaptorControllerAsync.java index a62129f8..5912929b 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/fusion/web/RaptorControllerAsync.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/system/fusion/web/RaptorControllerAsync.java @@ -958,6 +958,9 @@ public class RaptorControllerAsync extends RestrictedBaseController { rdef.setIsMonthlyScheduleAllowed(definitionJSON.getMonthlyRec().equals("true")?"Y":"N"); } } + //Start - Added new code + request.getSession().setAttribute(AppConstants.SI_REPORT_DEFINITION, rdef); + //End - Added new code if (id.equals("Create")) { rdef.persistReport(request); } else @@ -1547,6 +1550,8 @@ public class RaptorControllerAsync extends RestrictedBaseController { request.getSession().setAttribute(AppConstants.SI_REPORT_DEFINITION, rdef); } else if (rdef == null) { rdef = (new ReportHandler()).loadReportDefinition(request, id); + String session_id = request.getSession().getId(); + Object obj = request.getAttributeNames(); request.getSession().setAttribute(AppConstants.SI_REPORT_DEFINITION, rdef); } @@ -1661,6 +1666,10 @@ public class RaptorControllerAsync extends RestrictedBaseController { ObjectMapper mapper = new ObjectMapper(); mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + + String session_id = request.getSession().getId(); + Object obj = request.getAttributeNames(); + ReportDefinition report_def = (ReportDefinition) request.getSession().getAttribute(AppConstants.SI_REPORT_DEFINITION); return wizardJSON; @@ -1679,6 +1688,8 @@ public class RaptorControllerAsync extends RestrictedBaseController { Globals.initializeSystem(servletContext); } + String session_id = request.getSession().getId(); + Object obj = request.getAttributeNames(); ReportDefinition rdef = (ReportDefinition) request.getSession().getAttribute(AppConstants.SI_REPORT_DEFINITION); if (rdef == null) { ErrorJSONRuntime errorJSONRuntime = new ErrorJSONRuntime(); diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DataColumnList.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DataColumnList.java index 4d9ba5d9..810c2e53 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DataColumnList.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DataColumnList.java @@ -45,6 +45,7 @@ package org.onap.portalsdk.analytics.xmlobj; +import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -77,9 +78,13 @@ import javax.xml.bind.annotation.XmlType; @XmlType(name = "DataColumnList", propOrder = { "dataColumn" }) -public class DataColumnList { +public class DataColumnList implements Serializable{ - @XmlElement(required = true) + /** + * + */ + private static final long serialVersionUID = 1L; + @XmlElement(required = true) protected List dataColumn; /** diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DataColumnType.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DataColumnType.java index eb2fa53c..167aa490 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DataColumnType.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DataColumnType.java @@ -45,6 +45,8 @@ package org.onap.portalsdk.analytics.xmlobj; +import java.io.Serializable; + import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; @@ -176,9 +178,13 @@ import javax.xml.bind.annotation.XmlType; "colspan", "dataMiningCol" }) -public class DataColumnType { +public class DataColumnType implements Serializable{ - @XmlElement(required = true) + /** + * + */ + private static final long serialVersionUID = 1L; + @XmlElement(required = true) protected String tableId; @XmlElement(required = true) protected String dbColName; diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DataSourceList.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DataSourceList.java index ac69dbd2..228c632c 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DataSourceList.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DataSourceList.java @@ -44,6 +44,7 @@ package org.onap.portalsdk.analytics.xmlobj; +import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -75,9 +76,13 @@ import javax.xml.bind.annotation.XmlType; @XmlType(name = "DataSourceList", propOrder = { "dataSource" }) -public class DataSourceList { +public class DataSourceList implements Serializable{ - protected List dataSource; + /** + * + */ + private static final long serialVersionUID = 1L; + protected List dataSource; /** * Gets the value of the dataSource property. diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DataSourceType.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DataSourceType.java index 505fee0a..3ff8a552 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DataSourceType.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DataSourceType.java @@ -45,6 +45,8 @@ package org.onap.portalsdk.analytics.xmlobj; +import java.io.Serializable; + import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; @@ -88,9 +90,13 @@ import javax.xml.bind.annotation.XmlType; "comment", "dataColumnList" }) -public class DataSourceType { +public class DataSourceType implements Serializable{ - @XmlElement(required = true) + /** + * + */ + private static final long serialVersionUID = 1L; + @XmlElement(required = true) protected String tableName; @XmlElement(required = true) protected String tablePK; -- cgit 1.2.3-korg