Skip to content

Commit

Permalink
Beta 11 interface sections
Browse files Browse the repository at this point in the history
  • Loading branch information
David Berneda committed May 20, 2016
1 parent bf5ebf7 commit 7b61119
Show file tree
Hide file tree
Showing 41 changed files with 2,858 additions and 803 deletions.
8 changes: 4 additions & 4 deletions src/delphi/BI.Dashboard.HTML.pas
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,11 @@ THTMLRender=class(TRender)
ItemSeparator='%----%';

var
Charts : TStringList;
Divs : TDivs;
FHTML : TStringList;
FMinify : Boolean;
FTitle : String;

IAnyGauge : Boolean;
IAnyMap : Boolean;

IBody : String;
IRadioCount,
IDivCount : Integer;
Expand Down Expand Up @@ -109,6 +105,10 @@ THTMLRender=class(TRender)
var
CSS: String;
SteemaSources:String;
Charts : TStringList;

IAnyGauge : Boolean;
IAnyMap : Boolean;

Constructor Create;
Destructor Destroy; override;
Expand Down
5 changes: 4 additions & 1 deletion src/delphi/BI.Data.pas
Original file line number Diff line number Diff line change
Expand Up @@ -515,10 +515,13 @@ TMemory=record
TDataInfo=class(TDataItem)
private
FData : TDataItem;

procedure Fill;
procedure SetData(const Value: TDataItem);
public
Constructor Create(const AData:TDataItem); overload;

property Data:TDataItem read FData;
property Data:TDataItem read FData write SetData;
end;

TIdentifiers=record
Expand Down
1 change: 0 additions & 1 deletion src/delphi/BI.DataSource.pas
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ TBISource=class

FOnError : TBIError;
FOnProgress : TBIProgress;

protected
IDefinition : TDataDefinition;

Expand Down
14 changes: 11 additions & 3 deletions src/delphi/BI.Persist.pas
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ TBaseDataImporter=class(TDataProvider)
property Data:TDataItem read GetData;
end;

TRefreshSettings=record
private
function Increment(const ADate:TDateTime):TDateTime;
public
Period : Integer;
Units : TRefreshUnit;
Enabled : Boolean;
end;

// Abstract class with all settings necessary to import a given data
TDataDefinitionKind=(Files,Database,Web,Unknown);

Expand All @@ -66,8 +75,7 @@ TDataDefinition=class(TBaseDataImporter)
protected
FStrings : TStrings;

RefreshPeriod : Integer;
RefreshUnit : TRefreshUnit;
Refresh : TRefreshSettings;

Volatile : Boolean; // When True, changes to Strings aren't saved

Expand Down Expand Up @@ -100,7 +108,7 @@ TDataDefinition=class(TBaseDataImporter)
class procedure Merge(const AData: TDataItem; const AItems:TDataArray); static;
function MultiLineText(const ATag:String):String;

function Title: String;
function Description: String;

function NextRefresh:TDateTime;
class procedure SetMasters(const AData:TDataItem; const Items:TStrings); static;
Expand Down
55 changes: 55 additions & 0 deletions src/delphi/BI.Query.pas
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{*********************************************}
{ TeeBI Software Library }
{ TBIQuery Component }
{ Copyright (c) 2015-2016 by Steema Software }
{ All Rights Reserved }
{*********************************************}
unit BI.Query;

interface
Expand All @@ -6,6 +12,25 @@ interface
System.Classes, BI.Data, BI.DataSource, BI.Summary, BI.Expression,
BI.Persist;

{
TBIQuery is a component capable of executing queries against TDataItem objects.
BIQuery.Items collection property contains the desired query output.
Each Item defines a data item (field or table) and an optional aggregation kind.
BIQuery automatically determines if the calculation must be done using
a TSummary class (because there is at least one item with aggregation),
or a TDataSelect class (a normal "select" query without any "Group By").
Items can also define expressions (ie: "sum(a+b)" or "Upper(ProductName)" ) and
can refer to data items from multiple databases or tables without the need to
specify the links between them (no "join" clauses).
The BIQuery Filter property can be set as a string (ie: City="London") or
as an expression object, and can also refer to any data item even it is not
included in the query output.
}

type
TDataCollectionItem=class(TCollectionItem)
private
Expand Down Expand Up @@ -61,19 +86,22 @@ TQueryItem=class(TDataCollectionItem)
IActive : Boolean;
IAggregate : TAggregate;
IDatePart : TDateTimePart;
IExpression : TExpression;

function CanChange:Boolean;
procedure DoRemove;
function GetAggregate: TAggregate;
function GetActive: Boolean;
function GetDatePart:TDateTimePart;
function GetExpression: TExpression;
function Query:TBIQuery;
function RealData:TDataItem;
procedure Recreate;
procedure SetStyle(const Value: TQueryItemStyle);
procedure SetActive(const Value: Boolean);
procedure SetAggregate(const Value: TAggregate);
procedure SetDatePart(const Value: TDateTimePart);
procedure SetExpression(const Value: TExpression);
procedure TryReconnect;
protected
procedure Changed; override;
Expand All @@ -89,6 +117,8 @@ TQueryItem=class(TDataCollectionItem)
function RealStyle:TQueryItemStyle;

function ToString:String; override;

property Expression:TExpression read GetExpression write SetExpression;
published
property Active:Boolean read GetActive write SetActive default True;
property Aggregate:TAggregate read GetAggregate write SetAggregate default TAggregate.Count;
Expand Down Expand Up @@ -136,6 +166,28 @@ TQueryRemove=class(TPersistent)
property Rows:Boolean read GetRows write SetRows default False;
end;

(* Pending
TQueryFilter=class(TPersistent)
private
FEnabled : Boolean;
FExpression : TLogicalExpression;
FText : String;
// Temporary during csLoading
IFilter : String;
public
Constructor Create;
Destructor Destroy; override;
procedure Assign(Source:TPersistent); override;
property Expression:TLogicalExpression read FExpression write SetExpression;
published
property Enabled:Boolean read FEnabled write SetEnabled default True;
property Text:String read FText write SetText;
end;
*)

TQueryStyle=(Unknown,Select,Summary);

{$IF CompilerVersion>=23}
Expand Down Expand Up @@ -186,6 +238,8 @@ TBIQuery=class(TBaseDataImporter)
procedure Notification(AComponent: TComponent;
Operation: TOperation); override;

procedure SetFilterExpression(const AFilter:TLogicalExpression);

property Select:TDataSelect read FSelect write SetSelect;
property Summary:TSummary read FSummary write SetSummary;
public
Expand All @@ -202,6 +256,7 @@ TBIQuery=class(TBaseDataImporter)
procedure Clear;

function IsEmpty:Boolean;
function MainData:TDataItem;

function Style:TQueryStyle;

Expand Down
4 changes: 4 additions & 0 deletions src/delphi/BI.Store.Component.pas
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ TComponentImporter=class(TBaseDataImporter)
FSource : TComponent;

IDataLink : TDataLink;
ILoading : Boolean;

procedure SetSource(const Value: TComponent);
class function TryFromStrings(const ASource:TComponent):TDataItem;
protected
function DoImport(const AComponent: TComponent):TDataItem; virtual;
procedure GetItems(const AData:TDataItem); override;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
procedure Load(const AData:TDataItem; const Children:Boolean); override;
class function StringsOf(const ASource:TComponent):TStrings; virtual;
Expand All @@ -37,6 +39,8 @@ TComponentImporter=class(TBaseDataImporter)
Constructor Create(AOwner:TComponent); override;
Destructor Destroy; override;

procedure Refresh;

class function DataOf(const AComponent:TComponent):TDataItem; virtual;
class function DataOfProvider(const AData:TDataItem):TDataItem; static;
class function From(const AOwner,AComponent:TComponent): TDataItem; overload; static;
Expand Down
5 changes: 3 additions & 2 deletions src/delphi/BI.Summary.pas
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ TSummary=class(TDataProvider)
procedure DoRemoveMissing(const Data:TDataItem);
procedure Fill;
procedure GetActive;
function GetData: TDataItem;
function GetHaving:TSummaryFilter;
function GetMainData: TDataItem;
procedure SetFilter(const Value: TExpression);
procedure SetHaving(const Value: TSummaryFilter);
protected
Expand Down Expand Up @@ -361,8 +361,9 @@ TSummary=class(TDataProvider)
function ToString:String; override;
function Valid:Boolean;

property MainData:TDataItem read GetMainData;

published
property Data:TDataItem read GetData;
property Description:String read FDescription write FDescription;
property Filter:TExpression read FFilter write SetFilter;
property Having:TSummaryFilter read GetHaving write SetHaving;
Expand Down
1 change: 1 addition & 0 deletions src/delphi/BI.UI.pas
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ TCommonUI=record
class procedure AddKinds(const AItems:TStrings); static;
class function BytesToString(const Bytes: Int64): String; static;
class function ToBooleanString(const Bool:Boolean):String; static;
class function UniqueName(const AComponent:TComponent):String; static;
end;

TCryptoClass=class of TCrypto;
Expand Down
5 changes: 3 additions & 2 deletions src/delphi/BI.Web.pas
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ TBIWebHistory=class(TDataItem)

TSteema=class(TBIWebClient)
public
class function Download(const Source,Dest:String):Boolean;
class function GetLatestVersion(out V: TBIWebServer.TVersion; out Error:String):Boolean;
class function CheckNewVersion(out AError:String):Boolean; static;
class function Download(const Source,Dest:String):Boolean; static;
class function GetLatestVersion(out V: TBIWebServer.TVersion; out Error:String):Boolean; static;
end;

TDelayHandlerWeb=class(TDataDelayProvider)
Expand Down
Loading

0 comments on commit 7b61119

Please sign in to comment.