### ONAP Distributions
+Version 2.5.0
+- PORTAL-314 Fixed Bug for chart not showing up and for remote connection map bug (sql.properties).
+- PORTAL-314 Fixed Bug due to test java in analytics section.
+- PORTAL-314 Remote DB logic is added to enhance RAPTOR to pull content from different DB as well as Different DB TYPE
+
+
Version 1.4.0
- PORTAL-19 Rename Java package base to org.onap
- PORTAL-72 Address Sonar Scan code issues
setWholeSQL(reportSQL);
if(nvl(reportSQL).length()>0)
reportSQL = generateSQL(userId, request);
-
- if (reportSQL.toUpperCase().indexOf("ORDER BY ") < 0) {
+ if (nvl(reportSQL).toUpperCase().indexOf("ORDER BY ") < 0) {
StringBuffer sortBy = null;
- if (reportSQL.toUpperCase().indexOf("GROUP BY ") < 0)
+ if (nvl(reportSQL).toUpperCase().indexOf("GROUP BY ") < 0)
if (getDataSourceList().getDataSource().size() > 0) {
DataSourceType dst = (DataSourceType) getDataSourceList().getDataSource()
.get(0);
} // while
}
} // if
- if (reportSQL.trim().toUpperCase().startsWith("SELECT")) {
+ if (nvl(reportSQL).trim().toUpperCase().startsWith("SELECT")) {
//if (!(dbType.equals("DAYTONA") && reportSQL.trim().toUpperCase().startsWith("SELECT")))
// reportSQL += " ORDER BY " + ((sortBy == null) ? "1" : sortBy.toString());
}
}
-
StringBuffer colNames = new StringBuffer();
StringBuffer colExtraIdNames = new StringBuffer();
StringBuffer colExtraDateNames = new StringBuffer();
+ if(getDBType()!=null && getDBType().equals(AppConstants.ORACLE)) {
+ colNames.append("rownum rnum");
+ }
if(getColumnNamesFromReportSQL) {
DataSet ds = ConnectionUtils.getDataSet(reportSQL, dbInfo);
partSql = partSql+ " LIMIT "+ String.valueOf(startRow)+" , "+ String.valueOf(endRow);
} else if(getDBType().equals(AppConstants.ORACLE)) {
reportSQL = reportSQL.replace(" AS ", " ");
- partSql = "where rownum >= "+ String.valueOf(startRow)+" and rownum <= "+(Integer.parseInt(String.valueOf(startRow)) + Integer.parseInt(String.valueOf(endRow)));
+ partSql = "where rnum >= "+ String.valueOf(startRow)+" and rnum <= "+(Integer.parseInt(String.valueOf(startRow)) + Integer.parseInt(String.valueOf(endRow)));
} else if(getDBType().equals(AppConstants.POSTGRESQL)) {
partSql = partSql + " LIMIT "+ String.valueOf(endRow)+" , "+ String.valueOf(startRow);//limit [pageSize] offset [startRow]
}
private String dbInfo;
private String formHelpText;
private Integer pageSize;
+ private List<IdNameBooleanJSON> dbInfoList = null;
private List<IdNameBooleanJSON> displayArea = null;
private Boolean hideFormFieldsAfterRun;
private Integer maxRowsInExcelCSVDownload;
this.repDefType = repDefType;
}
-
+ public List<IdNameBooleanJSON> getDbInfoList() {
+ return dbInfoList;
+ }
+
+ public void setDbInfoList(List<IdNameBooleanJSON> dbInfoList) {
+ this.dbInfoList = dbInfoList;
+ }
}
DataColumnType dct = (DataColumnType) reportCols.get(c);
DataValue dv = new DataValue();
dr.addDataValue(dv);
- dv.setDisplayValue(ds.getString(r, c));
+ dv.setDisplayValue(ds.getString(r, ds.getColumnIndex(dct.getColId())));
dv.setColName(dct.getColName());
dv.setColId(dct.getColId());
dv.setNowrap(nvl(dct.getNowrap(),"null").equals("false")?"null":nvl(dct.getNowrap(),"null"));
public Connection getRemoteConnection(String dbKey) {
- return raptorAdapter.getConnection(dbKey);
+ try {
+ org.onap.portalsdk.analytics.util.RemDbInfo remDbInfo = new org.onap.portalsdk.analytics.util.RemDbInfo();
+ return remDbInfo.getDBConnection(dbKey);
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ return null;
+ }
}
public void clearConnection(Connection conn) {
import org.onap.portalsdk.analytics.model.runtime.ReportRuntime;
import org.onap.portalsdk.analytics.system.AppUtils;
import org.onap.portalsdk.analytics.system.ConnectionUtils;
+import org.onap.portalsdk.analytics.system.DbUtils;
import org.onap.portalsdk.analytics.system.Globals;
import org.onap.portalsdk.analytics.util.AppConstants;
import org.onap.portalsdk.analytics.util.DataSet;
// }
if (rdef != null) {
+ String dbInfo = definitionJSON.getDbInfo();
+ rdef.setDBInfo(dbInfo);
+ //save dbType
+ String schemaSql = Globals.getRemoteDbSchemaSqlWithWhereClause();
+ schemaSql = schemaSql.replace("[schema_id]", dbInfo);
+ String dbType = null;
+ DataSet ds = null;
+ try {
+ ds = DbUtils.executeQuery(schemaSql);
+
+ String prefix = "", desc = "";
+
+ for (int i = 0; i < ds.getRowCount(); i++) {
+ dbType = ds.getItem(i, 2);
+ }
+ }
+ catch (Exception e) {}
+ rdef.setDBType(dbType);
String reportName = definitionJSON.getReportName();
String errorString = "";
if (AppUtils.nvl(reportName).length() <= 0)
if (pathVariables.containsKey("id")) {
id = pathVariables.get("id");
}
+
String detailId = "";
if (pathVariables.containsKey("detailId")) {
detailId = pathVariables.get("detailId");
wizardJSON.setReportTitle((rdef != null) ? rdef.getReportTitle() : "");
wizardJSON.setReportSubTitle((rdef != null) ? rdef.getReportSubTitle() : "");
+
+ String schemaSql = Globals.getRemoteDbSchemaSql();
+ DataSet ds = null;
+ ArrayList<IdNameBooleanJSON> dbInfoList = new ArrayList<IdNameBooleanJSON>();
+ try {
+ ds = DbUtils.executeQuery(schemaSql);
+
+ String prefix = "", desc = "";
+
+ for (int i = 0; i < ds.getRowCount(); i++) {
+ IdNameBooleanJSON dBNameJSON = new IdNameBooleanJSON();
+ dBNameJSON.setId(ds.getItem(i, 0));
+ dBNameJSON.setName(ds.getItem(i, 0));
+ dBNameJSON.setSelected(false);
+ dbInfoList.add(dBNameJSON);
+ }
+ }
+ catch (Exception e) {}
+ wizardJSON.setDbInfoList(dbInfoList);
+
/*Robert add*/
wizardJSON.setOneTimeRec((rdef != null) ? rdef.getIsOneTimeScheduleAllowed() : "false");
wizardJSON.setHourlyRec((rdef != null) ? rdef.getIsHourlyScheduleAllowed() : "false");
try {
response.setContentType("application/json");
- ds = ConnectionUtils.getDataSet(sql, "local", true);
+ ds = ConnectionUtils.getDataSet(sql, rdef.getDBInfo(), true);
QueryResultJSON queryResultJSON = new QueryResultJSON();
queryResultJSON.setQuery(queryJSON.getQuery());
*/
package org.onap.portalsdk.analytics.util;
+import java.sql.Connection;
import java.util.HashMap;
+import javax.servlet.ServletContext;
+
import org.onap.portalsdk.analytics.system.DbUtils;
import org.onap.portalsdk.analytics.system.Globals;
+import org.onap.portalsdk.analytics.system.fusion.adapter.RaptorAdapter;
+import org.onap.portalsdk.analytics.system.fusion.adapter.SpringContext;
+
+import com.mchange.v2.c3p0.ComboPooledDataSource;
public class RemDbInfo {
private HashMap remDbMap = null;
private HashMap remDbTypeMap = null;
+ private HashMap remDbConnectionMap = null;
public RemDbInfo() throws Exception {
if (remDbMap == null) {
load();
}
}
+
+ private RaptorAdapter raptorAdapter;
+
+
+ public void initializeDbUtils(ServletContext servletContext) {
+ raptorAdapter = (RaptorAdapter)SpringContext.getApplicationContext().getBean("raptorAdapter");
+ } // initializeDbUtils
public void load() throws Exception {
remDbMap = new HashMap();
remDbTypeMap = new HashMap();
+ remDbConnectionMap = new HashMap();
try {
//String query = " SELECT a.SCHEMA_ID, a.SCHEMA_DESC, DATASOURCE_TYPE, rownum id FROM SCHEMA_INFO a " +
// " where schema_id = 'local' union " +
Globals.getDbUtils();
ds = DbUtils.executeQuery(query);
- String prefix = "", desc = "", dbType = "";
+ String prefix = "", desc = "", dbType = "", connectionUrl = "", username = "", password = "", driver_class = "";
if(ds.getRowCount() > 0) {
for (int i = 0; i < ds.getRowCount(); i++) {
- prefix = ds.getItem(i, 0);
- desc = ds.getItem(i, 1);
- dbType = ds.getItem(i, 2);
+ prefix = ds.getItem(i, 0);
+ desc = ds.getItem(i, 1);
+ dbType = ds.getItem(i, 2);
+ connectionUrl = ds.getItem(i, 3);
+ username = ds.getItem(i, 4);
+ password = ds.getItem(i, 5);
+ driver_class = ds.getItem(i, 6);
+
+ ComboPooledDataSource cpds = new ComboPooledDataSource();
+ cpds.setDriverClass( driver_class ); //loads the jdbc driver
+ cpds.setJdbcUrl( connectionUrl);
+ cpds.setUser(username);
+ cpds.setPassword(password);
+
+
+
remDbMap.put(prefix, desc);
remDbTypeMap.put(prefix, dbType);
+ remDbConnectionMap.put(prefix, cpds);
}
} else {
remDbMap.put("local", "local");
remDbTypeMap.put("local", Globals.getDBType());
+ remDbConnectionMap.put("local", raptorAdapter.getConnection());
}
}
catch (Exception e) {}
return "";
}
+
+ public Connection getDBConnection(String prefix) {
+ if ((remDbConnectionMap != null) && (remDbConnectionMap.containsKey(prefix))) {
+ try {
+ return ((ComboPooledDataSource) remDbConnectionMap.get(prefix)).getConnection();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ return null;
+ }
+ }
+
+ return null;
+ }
public HashMap getDbHash() {
return remDbMap;
Mockito.when(rsmd.getColumnCount()).thenReturn(1);
Mockito.when(rs.getMetaData()).thenReturn(rsmd);
DataSet datset = PowerMockito.mock(DataSet.class);
- Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null);
+ Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null);
Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset);
Mockito.when(Globals.getNewScheduleData()).thenReturn("test");
CustomReportType customReportType = new CustomReportType();
Mockito.when(rs.getMetaData()).thenReturn(rsmd);
DataSet datset = PowerMockito.mock(DataSet.class);
// datset = new DataSet(rs);
- Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null);
+ Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null);
Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset);
Mockito.when(Globals.getNewScheduleData()).thenReturn("test");
CustomReportType customReportType = new CustomReportType();
Mockito.when(rs.getMetaData()).thenReturn(rsmd);
DataSet datset = PowerMockito.mock(DataSet.class);
// datset = new DataSet(rs);
- Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null);
+ Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null);
Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset);
Mockito.when(Globals.getNewScheduleData()).thenReturn("test");
CustomReportType customReportType = new CustomReportType();
Mockito.when(rs.getMetaData()).thenReturn(rsmd);
DataSet datset = PowerMockito.mock(DataSet.class);
// datset = new DataSet(rs);
- Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null);
+ Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null);
Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset);
Mockito.when(Globals.getNewScheduleData()).thenReturn("test");
CustomReportType customReportType = new CustomReportType();
Mockito.when(rs.getMetaData()).thenReturn(rsmd);
DataSet datset = PowerMockito.mock(DataSet.class);
// datset = new DataSet(rs);
- Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null);
+ Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null);
Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset);
Mockito.when(Globals.getNewScheduleData()).thenReturn("test");
CustomReportType customReportType = new CustomReportType();
Mockito.when(rsmd.getColumnCount()).thenReturn(1);
Mockito.when(rs.getMetaData()).thenReturn(rsmd);
DataSet datset = PowerMockito.mock(DataSet.class);
- Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null);
+ Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null);
Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset);
Mockito.when(Globals.getNewScheduleData()).thenReturn("test");
CustomReportType customReportType = new CustomReportType();
Mockito.when(rsmd.getColumnCount()).thenReturn(1);
Mockito.when(rs.getMetaData()).thenReturn(rsmd);
DataSet datset = PowerMockito.mock(DataSet.class);
- Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null);
+ Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null);
Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset);
Mockito.when(Globals.getNewScheduleData()).thenReturn("test");
CustomReportType customReportType = new CustomReportType();
PowerMockito.mockStatic(DbUtils.class);
Mockito.when(Globals.getReportUserAccess()).thenReturn("test");
DataSet datset = PowerMockito.mock(DataSet.class);
- Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null);
+ Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null);
Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset);
CustomReportType customReportType = new CustomReportType();
customReportType.setReportType("test");
Mockito.when(rsmd.getColumnCount()).thenReturn(1);
Mockito.when(rs.getMetaData()).thenReturn(rsmd);
DataSet datset = PowerMockito.mock(DataSet.class);
- Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null);
+ Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null);
Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset);
Mockito.when(Globals.getNewScheduleData()).thenReturn("test");
CustomReportType customReportType = new CustomReportType();
Mockito.when(rsmd.getColumnCount()).thenReturn(1);
Mockito.when(rs.getMetaData()).thenReturn(rsmd);
DataSet datset = PowerMockito.mock(DataSet.class);
- Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null);
+ Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null);
Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset);
Mockito.when(Globals.getNewScheduleData()).thenReturn("test");
CustomReportType customReportType = new CustomReportType();
Mockito.when(rsmd.getColumnCount()).thenReturn(1);
Mockito.when(rs.getMetaData()).thenReturn(rsmd);
DataSet datset = PowerMockito.mock(DataSet.class);
- Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null);
+ Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null);
Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset);
Mockito.when(Globals.getNewScheduleData()).thenReturn("test");
CustomReportType customReportType = new CustomReportType();
Mockito.when(rsmd.getColumnCount()).thenReturn(1);
Mockito.when(rs.getMetaData()).thenReturn(rsmd);
DataSet datset = PowerMockito.mock(DataSet.class);
- Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null);
+ Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null);
Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset);
Mockito.when(Globals.getNewScheduleData()).thenReturn("test");
CustomReportType customReportType = new CustomReportType();
Mockito.when(rsmd.getColumnCount()).thenReturn(1);
Mockito.when(rs.getMetaData()).thenReturn(rsmd);
DataSet datset = PowerMockito.mock(DataSet.class);
- Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null);
+ Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null);
Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset);
Mockito.when(Globals.getNewScheduleData()).thenReturn("test");
CustomReportType customReportType = new CustomReportType();
Mockito.when(rsmd.getColumnCount()).thenReturn(1);
Mockito.when(rs.getMetaData()).thenReturn(rsmd);
DataSet datset = PowerMockito.mock(DataSet.class);
- Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null);
+ Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null);
Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset);
Mockito.when(Globals.getNewScheduleData()).thenReturn("test");
CustomReportType customReportType = new CustomReportType();
Mockito.when(rsmd.getColumnCount()).thenReturn(1);
Mockito.when(rs.getMetaData()).thenReturn(rsmd);
DataSet datset = PowerMockito.mock(DataSet.class);
- Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null);
+ Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null);
Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset);
Mockito.when(Globals.getNewScheduleData()).thenReturn("test");
CustomReportType customReportType = new CustomReportType();
Mockito.when(rsmd.getColumnCount()).thenReturn(1);
Mockito.when(rs.getMetaData()).thenReturn(rsmd);
DataSet datset = PowerMockito.mock(DataSet.class);
- Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null);
+ Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null);
Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset);
Mockito.when(Globals.getNewScheduleData()).thenReturn("test");
CustomReportType customReportType = new CustomReportType();
Mockito.when(rsmd.getColumnCount()).thenReturn(1);
Mockito.when(rs.getMetaData()).thenReturn(rsmd);
DataSet datset = PowerMockito.mock(DataSet.class);
- Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null);
+ Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null);
Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset);
Mockito.when(Globals.getNewScheduleData()).thenReturn("test");
CustomReportType customReportType = new CustomReportType();
Mockito.when(rsmd.getColumnCount()).thenReturn(1);
Mockito.when(rs.getMetaData()).thenReturn(rsmd);
DataSet datset = PowerMockito.mock(DataSet.class);
- Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null);
+ Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null);
Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset);
Mockito.when(Globals.getNewScheduleData()).thenReturn("test");
CustomReportType customReportType = new CustomReportType();
Mockito.when(rsmd.getColumnCount()).thenReturn(1);
Mockito.when(rs.getMetaData()).thenReturn(rsmd);
DataSet datset = PowerMockito.mock(DataSet.class);
- Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyInt())).thenReturn(null);
+ Mockito.when(datset.getString(Matchers.anyInt(), Matchers.anyString())).thenReturn(null);
Mockito.when(DbUtils.executeQuery(Matchers.anyString())).thenReturn(datset);
Mockito.when(Globals.getNewScheduleData()).thenReturn("test");
CustomReportType customReportType = new CustomReportType();
public void retrieveDataForGivenQuery2Test() throws Exception
{
QueryJSON queryJSON = new QueryJSON();
- queryJSON.setQuery("select");
+ queryJSON.setQuery("test");
ServletContext servletContext = PowerMockito.mock(ServletContext.class);
Mockito.when(mockedRequest.getSession().getServletContext()).thenReturn(servletContext);
ReportDefinition rdf1 = PowerMockito.mock(ReportDefinition.class);
assertEquals(raptorControllerAsync.nvl("test"),"test");
assertEquals(raptorControllerAsync.nvl("","default"),"default");
assertEquals(raptorControllerAsync.nvl("test","default"),"test");
-
-
+
raptorControllerAsync.retrieveDataForGivenQuery(false, queryJSON, mockedRequest, mockedResponse);
}
import org.owasp.esapi.Encoder;
import org.owasp.esapi.codecs.Codec;
import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
@PrepareForTest({ AppConstants.class, Globals.class, AppUtils.class, DataCache.class, DbUtils.class, DataSet.class,
ReportLoader.class, ReportRuntime.class, Utils.class, ESAPI.class, Codec.class, SecurityCodecUtil.class,
ConnectionUtils.class, XSSFilter.class, ReportDefinition.class, UserUtils.class, ReportWrapper.class })
+@PowerMockIgnore("javax.management.*")
public class ReportWrapperTest {
MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
}
-}
\ No newline at end of file
+}
load.custom.report.xml = SELECT cr.report_xml FROM cr_report cr WHERE rep_id=?
# need to copy to oracle
-load.remoteDB.schema = SELECT 'local' SCHEMA_ID, 'local' SCHEMA_DESC, null DATASOURCE_TYPE FROM dual union SELECT a.SCHEMA_ID, a.SCHEMA_DESC, DATASOURCE_TYPE FROM SCHEMA_INFO a where schema_id <> 'local' order by schema_id
-load.remoteDB.schema.where = SELECT a.SCHEMA_ID, a.SCHEMA_DESC, DATASOURCE_TYPE FROM SCHEMA_INFO a where schema_id = '[schema_id]'
+load.remoteDB.schema = SELECT 'local' SCHEMA_ID, 'local' SCHEMA_DESC, null DATASOURCE_TYPE, null CONNECTION_URL, null USER_NAME, null PASS, null DRIVER_CLASS FROM dual union SELECT a.SCHEMA_ID, a.SCHEMA_DESC, DATASOURCE_TYPE, CONNECTION_URL, USER_NAME, PASSWORD, DRIVER_CLASS FROM SCHEMA_INFO a where schema_id <> 'local' order by schema_id
+load.remoteDB.schema.where = SELECT a.SCHEMA_ID, a.SCHEMA_DESC, DATASOURCE_TYPE, CONNECTION_URL, USER_NAME, PASSWORD, DRIVER_CLASS FROM SCHEMA_INFO a where schema_id = '[schema_id]'
#formfield rendering
formfield.id.name.sql.prefix=SELECT id, name FROM (
}
else
$scope.reportData.reportHeading = $scope.reportData.reportName;
- if(!$scope.urlParams.hideChart && $scope.reportData.chartAvailable && $scope.reportData.totalRows>1){
- // console.log('raptor.htm?action=chart.run&'+convertQueryString($scope.urlParams));
+ if( ($scope.urlParams.hideChart === undefined || $scope.urlParams.hideChart) && $scope.reportData.chartAvailable && $scope.reportData.totalRows>=1){
+ //console.log('raptor.htm?action=chart.run&'+convertQueryString($scope.urlParams));
$http.get('raptor.htm?action=chart.run&'+convertQueryString($scope.urlParams)).then(
function(response){
$scope.showChart = true;
//console.log(stacktraceFP + " " + $scope.reportData.errormessage);
}
if(!pagination) {
- if(!$scope.urlParams.hideChart && $scope.reportData.chartAvailable && $scope.reportData.totalRows>1){
+ if( ($scope.urlParams.hideChart === undefined || $scope.urlParams.hideChart) && $scope.reportData.chartAvailable && $scope.reportData.totalRows>=1){
// console.log('raptor.htm?action=chart.run&c_master='+$scope.urlParams.c_master+'&'+formFieldsUrl+'display_content=Y&r_page='+(paginationOptions.pageNumber-1));
$http.get('raptor.htm?action=chart.run&c_master='+$scope.urlParams.c_master+'&'+formFieldsUrl+'display_content=Y&r_page='+(paginationOptions.pageNumber-1)).then(
function(response) {
$scope.gridOptions = {
pageNumber: 1,
+ useExternalPagination: true,
sort : null,
paginationPageSizes: [5],
paginationPageSize: 5,
{name:'HidePdf', selected:false}
]
+/* $scope.definitionData.dbSrcOptions=[
+ {text:'local', value:'local', selected:true},
+ {text:'e911dev_leto07', value:'e911dev_leto07', selected:false},
+ ]*/
+
$scope.pageSizeValues=['10','25','50','100','500'];
$scope.pageSizeOptions =[];
+ $scope.dbSrcOptions =[];
$scope.maxRowValues = ['500','1000','2000','3000','4000','5000','10000','15000','20000','25000','30000','35000','40000','45000','50000','65000']
$scope.maxRowOptions =[];
$scope.frozenColValues = ['0','1','2','3','4'];
/******create*****/
if(!$scope.isEdit){
$scope.definitionData.reportType = 'Linear';
- $scope.definitionData.dbInfo = 'Local';
+ //$scope.definitionData.dbInfo = 'Local';
+ //$scope.definitionData.dbSrcOptions = ['Local'];
}
/****end create***/
raptorReportFactory.getDefinitionByReportId(id).then(function(data){
$scope.showLoader=false;
$scope.definitionData = data;
+ $scope.definitionData.dbSrc=data.dbInfo;
+ $scope.definitionData.dbSrcOptions = data.dbInfoList;
+ console.log($scope.definitionData.dbSrcOptions[0].name);
+
$scope.showLoader = false;
for(x in data.displayOptions){
if(data.displayOptions[x].name=='HideFormFields')
}
$scope.constructureDefDropDown = function(){
+
for(i in $scope.pageSizeValues){
var v = {
value :$scope.pageSizeValues[i],
$scope.constructDef = function(){
var data =Object.assign({}, $scope.definitionData);
+ if($scope.definitionData.dbSrc){
+ console.log("Hello World ", $scope.definitionData.dbSrc);
+ data.dbInfo = $scope.definitionData.dbSrc;
+ }
for(x in $scope.definitionData.displayOptions){
if($scope.definitionData.displayOptions[x].name=='HideFormFields')
data.displayOptions[x].selected = $scope.displayOptions.hideFormFields
<div ng-if="showGrid">
<div id="grid1" ui-grid="gridOptions" ui-grid-pagination
ui-grid-pinning ui-grid-resize-columns class="grid"
- style="height: {{gridHeight">
+ style="height: {{gridHeight}}">
<div class="no-rows" ng-show="!gridOptions.data.length">
<div class="msg">
<span>{{reportData.message}}</span>
<div class="form-row" >
<label for="textinputID-2a">Report Description</label>
<div class="field-group">
- <textarea b2b-reset b2b-reset-textarea ng-model="definitionData.reportDescr" ng-disabled="disabled" ng-trim="false" placeholder="{{placeholderText}}" rows="{{textAreaRows}}" maxlength="{{textAreaMaxlength}}" class="span12" id="textareaID1Tooltip1" ng-focus='showTooltip1=true' ng-blur='showTooltip1=false' aria-describedby="textareaID1TooltipContent1"></textarea>
+ <textarea b2b-reset b2b-reset-textarea ng-model="definitionData.reportDescr" ng-disabled="false" ng-trim="false" placeholder="{{placeholderText}}" rows="{{textAreaRows}}" maxlength="{{textAreaMaxlength}}" class="span12" id="textareaID1Tooltip1" ng-focus='showTooltip1=true' ng-blur='showTooltip1=false' aria-describedby="textareaID1TooltipContent1"></textarea>
</div>
</div>
<div class="form-row" >
<label for="textinputID-2a">Report Type</label>
<div class="field-group">
- <input id="reportType" ddh-reset="" class="span12" type="text" data-ng-model="definitionData.reportType" ng-disabled="true">
+ <input id="reportType" ddh-reset="" class="span12" type="text" data-ng-model="definitionData.reportType" ng-disabled="false">
</div>
</div>
<div class="form-row" >
- <label for="textinputID-2a">Data Source</label>
- <div class="field-group">
- <input id="dataSrc" ddh-reset="" class="span12" type="text" data-ng-model="definitionData.dbInfo" ng-disabled="true">
- </div>
+ <label for="selectInputID-2a">Data Source</label>
+ <select id="dataSrc" name="dataSrc" b2b-dropdown placeholder-text="Select DBSource" ng-model="definitionData.dbSrc">
+ <option b2b-dropdown-list option-repeat="d in definitionData.dbSrcOptions" value="{{d.id}}">{{d.name}}</option>
+ </select>
+<!-- <div class="field-group"> -->
+<!-- <input id="dataSrc" ddh-reset="" class="span12" type="text" data-ng-model="definitionData.dbInfo" ng-disabled="true"> -->
+<!-- </div> -->
</div>
<div class="form-row" >
<label for="textinputID-2a">Form Help Text</label>
<!-- <button class="btn btn-alt btn-small" type="button" ng-click="next()" ng-show="$scope.isEdit" >Next</button>
--> </div>
-</div>
\ No newline at end of file
+</div>