Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small tweaks to support RDASH generation using XMLA sources and blending #56

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Reveal.Sdk.Dom/Data/DataSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public string Id

[JsonProperty]
[JsonConverter(typeof(StringEnumConverter))]
internal DataSourceProvider Provider { get; set; }
public DataSourceProvider Provider { get; set; } //needs to be public to enable serialization of custom datasources

[JsonProperty("Description")]
public string Title { get; set; }
Expand All @@ -40,7 +40,7 @@ public string DefaultRefreshRate
}

[JsonProperty]
internal Dictionary<string, object> Properties { get; set; }
public Dictionary<string, object> Properties { get; set; } //needs to be public to enable serialization of custom datasources

public override bool Equals(object obj)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ namespace Reveal.Sdk.Dom.Visualizations
{
public abstract class DataDefinitionBase : SchemaType, IDataDefinition
{
//need set to be public to support custom DSIs provided from Slingshot
[JsonProperty]
public DataSourceItem DataSourceItem { get; internal set; }
public DataSourceItem DataSourceItem { get; set; }

/// <inheritdoc/>
[JsonProperty("Expiration")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Reveal.Sdk.Dom.Visualizations
{
public sealed class TabularDataDefinition : DataDefinitionBase
public sealed class TabularDataDefinition : DataDefinitionBase, ITabularDataDefinitionInternal
{
public TabularDataDefinition()
{
Expand All @@ -32,11 +32,12 @@ public TabularDataDefinition()
internal SummarizationSpec SummarizationSpec { get; set; }

//used when joining tables from multiple data sources
[JsonProperty]
internal List<AdditionalTable> AdditionalTables { get; set; } = new List<AdditionalTable>();
[JsonProperty("AdditionalTables")]
List<AdditionalTable> ITabularDataDefinitionInternal.AdditionalTables { get; set; } = new List<AdditionalTable>();

//not sure what this is for yet
[JsonProperty]
internal List<ServiceAdditionalTable> ServiceAdditionalTables { get; set; } = new List<ServiceAdditionalTable>();

}
}
18 changes: 18 additions & 0 deletions src/Reveal.Sdk.Dom/Visualizations/Interfaces/IAliasInternal.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Newtonsoft.Json;
using Reveal.Sdk.Dom.Core.Serialization.Converters;
using Reveal.Sdk.Dom.Data;
using System.Collections.Generic;

namespace Reveal.Sdk.Dom.Visualizations
{
//Temporary interface to access the TableAlias property for blending support
[JsonConverter(typeof(DataSpecConverter))]
public interface IAliasInternal
{
//used when joining data from multiple sources
[JsonProperty("TableAlias")]
public string TableAlias { get; set; }


}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Newtonsoft.Json;
using Reveal.Sdk.Dom.Core.Serialization.Converters;
using Reveal.Sdk.Dom.Data;
using System.Collections.Generic;

namespace Reveal.Sdk.Dom.Visualizations
{
//Temporary interface to access the AdditionalTables property for blending support
[JsonConverter(typeof(DataSpecConverter))]
public interface ITabularDataDefinitionInternal
{
/// <summary>
/// Gets or sets the additional tables.
/// </summary>
[JsonProperty("AdditionalTables")]
public List<AdditionalTable> AdditionalTables { get; internal set; }


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace Reveal.Sdk.Dom.Visualizations
{
internal sealed class AdditionalTable
public sealed class AdditionalTable
{
public string Alias { get; set; }
public string Alias { get; set; }

[JsonProperty("DataSpec")]
public DataDefinitionBase DataDefinition { get; set; } //todo: convert to interface

Expand Down
6 changes: 3 additions & 3 deletions src/Reveal.Sdk.Dom/Visualizations/Primitives/FieldBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Reveal.Sdk.Dom.Visualizations
{
public abstract class FieldBase<TFilter> : IField, IFieldDataType
public abstract class FieldBase<TFilter> : IField, IFieldDataType, IAliasInternal
where TFilter : IFilter
{
private string _fieldLabel;
Expand Down Expand Up @@ -56,7 +56,7 @@ public string FieldLabel
internal Dictionary<string, object> Properties { get; set; } = new Dictionary<string, object>();

//used when joining data from multiple sources
[JsonProperty]
internal string TableAlias { get; set; }
[JsonProperty("TableAlias")]
string IAliasInternal.TableAlias { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Reveal.Sdk.Dom.Visualizations
{
internal sealed class JoinCondition
public sealed class JoinCondition
{
public string LeftFieldName { get; set; }
public string RightFieldName { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Reveal.Sdk.Dom.Core.Constants;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Reveal.Sdk.Dom.Core.Constants;

namespace Reveal.Sdk.Dom.Visualizations
{
Expand All @@ -15,5 +17,9 @@ public TabularColumn(string fieldName)
/// Gets or sets the field name.
/// </summary>
public string FieldName { get; set; }


[JsonConverter(typeof(StringEnumConverter))]
public SortingType Sorting { get; set; } = SortingType.None;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public XmlaDimensionElement() { }
public string UniqueName { get; set; }
public string Caption { get; set; }
public string UserCaption { get; set; }
public string DefaultHierarchy { get; set; }
public string DimensionUniqueName { get; set; }
[JsonConverter(typeof(StringEnumConverter))]
public XmlaDimensionType DimensionType { get; set; } = XmlaDimensionType.Regular;
Expand Down
Loading