Skip to content

Commit

Permalink
Merge pull request #45 from RevealBi/xmla-support
Browse files Browse the repository at this point in the history
added initial Xmla support
  • Loading branch information
brianlagunas authored May 2, 2024
2 parents 781e9b4 + 60089d6 commit 1520c15
Show file tree
Hide file tree
Showing 59 changed files with 1,651 additions and 1,454 deletions.
Binary file added e2e/Sandbox/Dashboards/Jason - AB Sales.rdash
Binary file not shown.
672 changes: 336 additions & 336 deletions e2e/Sandbox/Factories/ManufacturingDashboard.cs

Large diffs are not rendered by default.

384 changes: 192 additions & 192 deletions e2e/Sandbox/Factories/SalesDashboard.cs

Large diffs are not rendered by default.

196 changes: 99 additions & 97 deletions e2e/Sandbox/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,97 +1,99 @@
using Reveal.Sdk;
using Reveal.Sdk.Dom;
using Sandbox.Factories;
using Sandbox.Helpers;
using System;
using System.IO;
using System.Windows;

namespace Sandbox
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
static readonly string _dashboardFilePath = Path.Combine(Environment.CurrentDirectory, "Dashboards");

readonly string _readFilePath = Path.Combine(_dashboardFilePath, DashboardFileNames.Marketing);

readonly string _saveJsonToPath = Path.Combine(_dashboardFilePath, "MyDashboard.json");
readonly string _saveRdashToPath = Path.Combine(_dashboardFilePath, DashboardFileNames.MyDashboard);

public MainWindow()
{
InitializeComponent();

//RevealSdkSettings.EnableNewCharts = true;
RevealSdkSettings.AuthenticationProvider = new AuthenticationProvider();

_revealView.LinkedDashboardProvider = (string dashboardId, string linkTitle) =>
{
var path = Path.Combine(_dashboardFilePath, $"{dashboardId}.rdash");
if (File.Exists(path))
return new RVDashboard(path);

return null;
};

_revealView.DashboardSelectorRequested += RevealView_DashboardSelectorRequested;
}

private void RevealView_DashboardSelectorRequested(object sender, DashboardSelectorRequestedEventArgs e)
{
e.Callback("Campaigns");
}

private async void RevealView_SaveDashboard(object sender, DashboardSaveEventArgs e)
{
//var json = _revealView.Dashboard.ExportToJson();
var path = Path.Combine(Environment.CurrentDirectory, $"Dashboards/{e.Name}.rdash");
var data = await e.Serialize();
var json = _revealView.Dashboard.ExportToJson();
using (var output = File.Open(path, FileMode.Open))
{
output.Write(data, 0, data.Length);
}

e.SaveFinished();
}

private void Load_Dashboard(object sender, RoutedEventArgs e)
{
_revealView.Dashboard = new RVDashboard(_readFilePath);
}

private void Clear_Dashboard(object sender, RoutedEventArgs e)
{
_revealView.Dashboard = new RVDashboard();
}

private async void Read_Dashboard(object sender, RoutedEventArgs e)
{
var document = RdashDocument.Load(_readFilePath);
var json = document.ToJsonString();
_revealView.Dashboard = await RVDashboard.LoadFromJsonAsync(json);
}

private async void Create_Dashboard(object sender, RoutedEventArgs e)
{
//var document = MarketingDashboard.CreateDashboard();
//var document = SalesDashboard.CreateDashboard();
//var document = CampaignsDashboard.CreateDashboard();
//var document = HealthcareDashboard.CreateDashboard();
//var document = ManufacturingDashboard.CreateDashboard();
var document = CustomDashboard.CreateDashboard();
//var document = RestDataSourceDashboards.CreateDashboard();
//var document = SqlServerDataSourceDashboards.CreateDashboard();
//var document = DashboardLinkingDashboard.CreateDashboard();

//document.Save(_saveRdashToPath);

var json = document.ToJsonString();
//json.Save(_saveJsonToPath);
_revealView.Dashboard = await RVDashboard.LoadFromJsonAsync(json);
}
}
}
using Reveal.Sdk;
using Reveal.Sdk.Dom;
using Sandbox.Factories;
using Sandbox.Helpers;
using System;
using System.IO;
using System.Windows;

namespace Sandbox
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
static readonly string _dashboardFilePath = Path.Combine(Environment.CurrentDirectory, "Dashboards");

//readonly string _readFilePath = Path.Combine(_dashboardFilePath, DashboardFileNames.Marketing);
//readonly string _readFilePath = Path.Combine(_dashboardFilePath, "Jason - AB Sales.rdash");
readonly string _readFilePath = Path.Combine(_dashboardFilePath, "JB - New Infragistics Scorecard Test.rdash");

readonly string _saveJsonToPath = Path.Combine(_dashboardFilePath, "MyDashboard.json");
readonly string _saveRdashToPath = Path.Combine(_dashboardFilePath, DashboardFileNames.MyDashboard);

public MainWindow()
{
InitializeComponent();

//RevealSdkSettings.EnableNewCharts = true;
RevealSdkSettings.AuthenticationProvider = new AuthenticationProvider();

_revealView.LinkedDashboardProvider = (string dashboardId, string linkTitle) =>
{
var path = Path.Combine(_dashboardFilePath, $"{dashboardId}.rdash");
if (File.Exists(path))
return new RVDashboard(path);

return null;
};

_revealView.DashboardSelectorRequested += RevealView_DashboardSelectorRequested;
}

private void RevealView_DashboardSelectorRequested(object sender, DashboardSelectorRequestedEventArgs e)
{
e.Callback("Campaigns");
}

private async void RevealView_SaveDashboard(object sender, DashboardSaveEventArgs e)
{
//var json = _revealView.Dashboard.ExportToJson();
var path = Path.Combine(Environment.CurrentDirectory, $"Dashboards/{e.Name}.rdash");
var data = await e.Serialize();
var json = _revealView.Dashboard.ExportToJson();
using (var output = File.Open(path, FileMode.Open))
{
output.Write(data, 0, data.Length);
}

e.SaveFinished();
}

private void Load_Dashboard(object sender, RoutedEventArgs e)
{
_revealView.Dashboard = new RVDashboard(_readFilePath);
}

private void Clear_Dashboard(object sender, RoutedEventArgs e)
{
_revealView.Dashboard = new RVDashboard();
}

private async void Read_Dashboard(object sender, RoutedEventArgs e)
{
var document = RdashDocument.Load(_readFilePath);
var json = document.ToJsonString();
_revealView.Dashboard = await RVDashboard.LoadFromJsonAsync(json);
}

private async void Create_Dashboard(object sender, RoutedEventArgs e)
{
//var document = MarketingDashboard.CreateDashboard();
//var document = SalesDashboard.CreateDashboard();
//var document = CampaignsDashboard.CreateDashboard();
//var document = HealthcareDashboard.CreateDashboard();
//var document = ManufacturingDashboard.CreateDashboard();
var document = CustomDashboard.CreateDashboard();
//var document = RestDataSourceDashboards.CreateDashboard();
//var document = SqlServerDataSourceDashboards.CreateDashboard();
//var document = DashboardLinkingDashboard.CreateDashboard();

//document.Save(_saveRdashToPath);

var json = document.ToJsonString();
//json.Save(_saveJsonToPath);
_revealView.Dashboard = await RVDashboard.LoadFromJsonAsync(json);
}
}
}
3 changes: 3 additions & 0 deletions e2e/Sandbox/Sandbox.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
<None Update="Dashboards\Healthcare.rdash">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Dashboards\Jason - AB Sales.rdash">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Dashboards\Manufacturing.rdash">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
Loading

0 comments on commit 1520c15

Please sign in to comment.