-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #146 from RevealBi/data-soruce/oracle
Update Oracle Datasource
- Loading branch information
Showing
11 changed files
with
277 additions
and
3 deletions.
There are no files selected for viewing
70 changes: 70 additions & 0 deletions
70
e2e/Sandbox/DashboardCreators/OracleDataSourceDashboard.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using Reveal.Sdk.Data.MySql; | ||
using Reveal.Sdk.Dom; | ||
using Reveal.Sdk.Dom.Data; | ||
using Reveal.Sdk.Dom.Filters; | ||
using Reveal.Sdk.Dom.Visualizations; | ||
using Sandbox.DashboardFactories; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using static Antlr4.Runtime.Atn.SemanticContext; | ||
|
||
namespace Sandbox.DashboardCreators | ||
{ | ||
public class OracleDataSourceDashboard : IDashboardCreator | ||
{ | ||
public string Name => "Oracle Data Source"; | ||
|
||
public RdashDocument CreateDashboard() | ||
{ | ||
var oracleDataSource = new OracleDataSource | ||
{ | ||
Id = "oracleSIDId", | ||
Title = "Oracle SID DS", | ||
Subtitle = "Oracle SID Datasource", | ||
Host = "revealdb01.infragistics.local", | ||
Database = "HR", | ||
SID = "orcl", | ||
Port = 1521 | ||
}; | ||
|
||
var oracleDataSourceItem = new OracleDataSourceItem("employees report to ID", oracleDataSource) | ||
{ | ||
Id = "oracleSIDDSItemId", | ||
Title = "Oracle SID DSItem", | ||
Database = "HR", | ||
Table = "EMPLOYEES", | ||
Fields = new List<IField> | ||
{ | ||
new NumberField("MANAGER_ID"), | ||
new NumberField("EMPLOYEE_ID"), | ||
} | ||
}; | ||
|
||
var document = new RdashDocument() | ||
{ | ||
Title = "Oracle", | ||
Description = "Example for Oracle", | ||
UseAutoLayout = false, | ||
}; | ||
|
||
var dateFilter = new DashboardDateFilter("My Date Filter"); | ||
document.Filters.Add(dateFilter); | ||
|
||
document.Visualizations.Add(CreateEmployeeReportColumnVisualization(oracleDataSourceItem)); | ||
|
||
return document; | ||
} | ||
|
||
private static Visualization CreateEmployeeReportColumnVisualization(DataSourceItem dsi, params DashboardFilter[] filters) | ||
{ | ||
return new ColumnChartVisualization("Employees report", dsi) | ||
.SetLabel("MANAGER_ID") | ||
.SetValue("EMPLOYEE_ID") | ||
.ConnectDashboardFilters(filters) | ||
.SetPosition(20, 11); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
src/Reveal.Sdk.Dom/Data/DataSourceItems/OracleDataSourceItem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
namespace Reveal.Sdk.Dom.Data | ||
{ | ||
internal class OracleDataSourceItem : ProcedureDataSourceItem | ||
public class OracleDataSourceItem : ProcedureDataSourceItem | ||
{ | ||
public OracleDataSourceItem(string title, DataSource dataSource) : | ||
base(title, dataSource) | ||
{ } | ||
|
||
protected override DataSource CreateDataSourceInstance(DataSource dataSource) | ||
{ | ||
return Create<OracleDataSource>(dataSource); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ public enum DataSourceType | |
REST, | ||
MicrosoftSqlServer, | ||
MySql, | ||
Oracle, | ||
PostgreSQL, | ||
} | ||
} |