Guides/Fusion.md
... ...
@@ -1,159 +0,0 @@
1
-#Izenda Fusion Driver
2
-
3
-[[_TOC_]]
4
-
5
-##How the Izenda Fusion Driver works
6
-
7
-The Izenda Fusion Driver composes data sources from several connections (data providers) into a single data source. This is very similar to how [[SSAS|http://technet.microsoft.com/en-us/library/ms175609(v=sql.90).aspx]] works, but using Fusion you can aggregate data not only from MSSQL databases but from very different data sources. For example, you can get data from the [[OData|Guides/OData]] data provider (i.e. without a direct connection to the database). All you need to do is set up the data sources' connections and you will be able to work with aggregated data as a single data source.
8
-
9
-![Izenda Fusion Driver Schematic](http://wiki.izenda.us/Guides/Developer-Links-and-Guides/fusion_driver_schematic.png)
10
-**Figure 1:** Schematics of how the Fusion Driver interacts with different datasources
11
-
12
-![Fusion Driver Using Multiple DataSources](http://wiki.izenda.us/Guides/Developer-Links-and-Guides/custom_fusion_driver.png)
13
-**Figure 2:** The driver works directly with your datasources and provides Izenda AdHoc with complete information about tables, fields of tables, data types, etc.
14
-
15
-##Configuring the Izenda Fusion Driver
16
-
17
-Configuring the Izenda Fusion Driver is almost the same as configuring the Izenda Driver with single connection. The main differences are:
18
-
19
-* Allows you to set up more then one data source end point
20
-* Allows you to set up database constraints separately for each connection
21
-* Needs to use additional connection strings for the AdHoc table if your reports are stored in your database
22
-
23
-Configuring the Izenda Fusion Driver consists of several steps:
24
-
25
-###1. Create the Fusion Driver
26
-
27
-At first you should create FusionDriver object and set up it as default driver for the Izenda AdHoc. Here is example how to do it in C#:
28
-
29
-```csharp
30
-FusionDriver fusionDriver = new FusionDriver();
31
-AdHocContext.Driver = fusionDriver;
32
-```
33
-
34
-###2. Add connections to the driver
35
-
36
-Now you can add connections to the data sources end points. The end point could be a direct connection to the MSSQL database or it can be an OData connection to the MSSQL or Oracle database.
37
-
38
-####a) Adding a connection to the local MSSQL database.
39
-
40
-You should specify the connection nickname in first parameter, the connection type of MSSQL in the second parameter, and the connection string in the last parameter:
41
-
42
-```csharp
43
-fusionDriver.AddConnection("SqlNW", FusionConnectionType.MsSql, "server=(local);database=Northwind;Trusted_Connection=True;");
44
-```
45
-
46
-####b) Adding a connection to the OData provider.
47
-
48
-You should specify the connection nickname in first parameter, the connection type of OData in the second parameter, and the link to the OData end point in the last parameter:
49
-
50
-```csharp
51
-fusionDriver.AddConnection("OrclNW", FusionConnectionType.OData, "http://www.providerdomain.com/provider_endpoint.aspx");
52
-```
53
-
54
-###3. Set up additional settings
55
-
56
-The Izenda Fusion Driver has several additional settings:
57
-
58
-####a) VisibleDataSources
59
-
60
-This is setup the same way as for a single connection. Only data sources with the specified names will be available:
61
-
62
-```csharp
63
-fusionDriver.VisibleDataSources = new string[] { "Orders", "Customers", "Order Details" };
64
-```
65
-
66
-####b) Constraints
67
-
68
-This is setup the same as for single connection except that you are able to specify separate constraints for each connection by using connection nicknames. Note that you can use wildcard characters to set up constraints:
69
-
70
-```csharp
71
-fusionDriver.AddConstraint("SqlNW/Order.Id", "SqlNW/*.OrderID");
72
-fusionDriver.RemoveConstraint("OrclNW/Account.Id", "OrclNW/User.AccountID");
73
-```
74
-
75
-####c) ReportingConnectionString
76
-
77
-If reports are stored in the database you should specify connection string to that database. Note that in addition to this, you should also use FusionAdHocConfig instead of DatabaseAdHocConfig. The following example sets up the connection string to the database using the reports table. If you store reports in the file system then skip this step(use FileSystemAdHocConfig if you do this).
78
-
79
-```csharp
80
-((FusionAdHocConfig)AdHocSettings.AdHocConfig).ReportingConnectionString = "server=(local);database=Reports;Trusted_Connection=True;";
81
-```
82
-
83
-####d) Set up cache
84
-
85
-Getting data from several data source providers may take a lot of time and resources when many connections are added. This will result in a slow connection to the providers due to large amount of data being transferred, etc. That’s why the cache is enabled by default for the Izenda Fusion Driver. By default, cache expiration time is set to 12PM on Saturday. This means that every Saturday, the cache will be cleared and all data will be requested from the providers during the next session.
86
-
87
-You can configure the cache yourself by using the following properties and methods:
88
-
89
-* **DataCacheExpiration:** Sets the date for cache expiration. All data in the cache older than the specified date will be cleared (removed from the cache). For example, if you want to clear all data more than two days old, you should set: ``fusionDriver.DataCacheExpiration = DateTime.Now.AddDays(-2);``
90
-* **CacheAllReports method:** Adds all available reports to the cache: ``fusionDriver.CacheAllReports();``
91
-* **CacheReport method:** Adds a single report with the specified name to the cache: ``fusionDriver.CacheReport(string reportFullName);``
92
-
93
-##Sample use
94
-
95
-Below is a full example of how to set up and configure the Izenda Fusion Driver with several connections and reports stored in your database:
96
-
97
-```csharp
98
-<%@ Application Language="C#" %>
99
-<%@ Import Namespace="System.Data"%>
100
-<%@ Import Namespace="Izenda.AdHoc.Database"%>
101
-<%@ Import Namespace="Izenda.AdHoc" %>
102
-<%@ Import Namespace="System.Configuration" %>
103
-
104
-<script runat="server">
105
- void Session_Start(object sender, EventArgs e)
106
- {
107
- // Set license key. Note: "+FUSION" must be in license key
108
- AdHocSettings.LicenseKey = "LICENSE KEY";
109
-
110
- // Set config. Note: config class must derive from FusionAdHocConfig or FileSystemAdHocConfig
111
- AdHocSettings.AdHocConfig = new CustomFusionAdHocConfig();
112
-
113
- // Create Fusion driver and set it as default driver for AdHoc
114
- FusionDriver fusionDriver = new FusionDriver();
115
- AdHocContext.Driver = fusionDriver;
116
-
117
- // Add connection to the local MSSQL database
118
- fusionDriver.AddConnection("SqlNW", FusionConnectionType.MsSql, "server=(local);database=Northwind;Trusted_Connection=True;");
119
- // Add connection to the OData provider which is connected to the Oracle database
120
- fusionDriver.AddConnection("OrclNW", FusionConnectionType.OData, "http://www.providerdomain.com/Oracle/FusionEndpoint.aspx");
121
-
122
- // Add visible data sources
123
- fusionDriver.VisibleDataSources = new string[] { "Orders", "Customers", "Order Details" };
124
-
125
- // Configure constraints for connections
126
- fusionDriver.AddConstraint("SqlNW/Order.Id", "SqlNW/*.OrderID");
127
- fusionDriver.RemoveConstraint("OrclNW/Account.Id", "OrclNW/User.AccountID");
128
-
129
- // Clear cache
130
- fusionDriver.DataCacheExpiration = DateTime.Now;
131
-
132
- // Add some reports to the cache
133
- fusionDriver.CacheReport("Financial reports\Sales");
134
- fusionDriver.CacheReport("Common reports\Employees");
135
-
136
- // Set connection to the database with reports table
137
- ((FusionAdHocConfig)AdHocSettings.AdHocConfig).ReportingConnectionString = "server=(local);database=ReportsDB;Trusted_Connection=True;";
138
- }
139
-
140
- [Serializable]
141
- public class CustomFusionAdHocConfig : FusionAdHocConfig
142
- {
143
- public override void ConfigureSettings()
144
- {
145
-
146
- }
147
- }
148
-</script>
149
-```
150
-
151
-##Customizing the Izenda Fusion driver
152
-
153
-Izenda reports is designed as a modular system to be easily customizable for usage with any datasources. The ``AdHocContext`` class has a **Driver** property containing an instance of ``Izenda.AdHoc.Database.Driver`` abstract class, which provides datasource metadata for Izenda AdHoc.
154
-
155
-The ``Izenda.AdHoc.Database.MSSQLDriver`` class implements complete functionality for using MSSQL server as your datasource and also allows you to create inheritors. So the easiest way to create a custom driver working with MSSQL server is to inherit ``Izenda.AdHoc.Database.MSSQLDriver`` and override the functionality you need to work differently. Below is complete instruction on performing this.
156
157
-1. Create new project with type of Class library in Visual Studio (Figure 2).
158
-![Creating a Custom Driver](http://wiki.izenda.us/Guides/Developer-Links-and-Guides/custom_fusion_driver_2.png)
159
-2.
Guides/Izenda-AdHoc-Driver.md
... ...
@@ -0,0 +1,159 @@
1
+#Izenda Fusion Driver
2
+
3
+[[_TOC_]]
4
+
5
+##How the Izenda Fusion Driver works
6
+
7
+The Izenda Fusion Driver composes data sources from several connections (data providers) into a single data source. This is very similar to how [[SSAS|http://technet.microsoft.com/en-us/library/ms175609(v=sql.90).aspx]] works, but using Fusion you can aggregate data not only from MSSQL databases but from very different data sources. For example, you can get data from the [[OData|Guides/OData]] data provider (i.e. without a direct connection to the database). All you need to do is set up the data sources' connections and you will be able to work with aggregated data as a single data source.
8
+
9
+![Izenda Fusion Driver Schematic](http://wiki.izenda.us/Guides/Developer-Links-and-Guides/fusion_driver_schematic.png)
10
+**Figure 1:** Schematics of how the Fusion Driver interacts with different datasources
11
+
12
+![Fusion Driver Using Multiple DataSources](http://wiki.izenda.us/Guides/Developer-Links-and-Guides/custom_fusion_driver.png)
13
+**Figure 2:** The driver works directly with your datasources and provides Izenda AdHoc with complete information about tables, fields of tables, data types, etc.
14
+
15
+##Configuring the Izenda Fusion Driver
16
+
17
+Configuring the Izenda Fusion Driver is almost the same as configuring the Izenda Driver with single connection. The main differences are:
18
+
19
+* Allows you to set up more then one data source end point
20
+* Allows you to set up database constraints separately for each connection
21
+* Needs to use additional connection strings for the AdHoc table if your reports are stored in your database
22
+
23
+Configuring the Izenda Fusion Driver consists of several steps:
24
+
25
+###1. Create the Fusion Driver
26
+
27
+At first you should create FusionDriver object and set up it as default driver for the Izenda AdHoc. Here is example how to do it in C#:
28
+
29
+```csharp
30
+FusionDriver fusionDriver = new FusionDriver();
31
+AdHocContext.Driver = fusionDriver;
32
+```
33
+
34
+###2. Add connections to the driver
35
+
36
+Now you can add connections to the data sources end points. The end point could be a direct connection to the MSSQL database or it can be an OData connection to the MSSQL or Oracle database.
37
+
38
+####a) Adding a connection to the local MSSQL database.
39
+
40
+You should specify the connection nickname in first parameter, the connection type of MSSQL in the second parameter, and the connection string in the last parameter:
41
+
42
+```csharp
43
+fusionDriver.AddConnection("SqlNW", FusionConnectionType.MsSql, "server=(local);database=Northwind;Trusted_Connection=True;");
44
+```
45
+
46
+####b) Adding a connection to the OData provider.
47
+
48
+You should specify the connection nickname in first parameter, the connection type of OData in the second parameter, and the link to the OData end point in the last parameter:
49
+
50
+```csharp
51
+fusionDriver.AddConnection("OrclNW", FusionConnectionType.OData, "http://www.providerdomain.com/provider_endpoint.aspx");
52
+```
53
+
54
+###3. Set up additional settings
55
+
56
+The Izenda Fusion Driver has several additional settings:
57
+
58
+####a) VisibleDataSources
59
+
60
+This is setup the same way as for a single connection. Only data sources with the specified names will be available:
61
+
62
+```csharp
63
+fusionDriver.VisibleDataSources = new string[] { "Orders", "Customers", "Order Details" };
64
+```
65
+
66
+####b) Constraints
67
+
68
+This is setup the same as for single connection except that you are able to specify separate constraints for each connection by using connection nicknames. Note that you can use wildcard characters to set up constraints:
69
+
70
+```csharp
71
+fusionDriver.AddConstraint("SqlNW/Order.Id", "SqlNW/*.OrderID");
72
+fusionDriver.RemoveConstraint("OrclNW/Account.Id", "OrclNW/User.AccountID");
73
+```
74
+
75
+####c) ReportingConnectionString
76
+
77
+If reports are stored in the database you should specify connection string to that database. Note that in addition to this, you should also use FusionAdHocConfig instead of DatabaseAdHocConfig. The following example sets up the connection string to the database using the reports table. If you store reports in the file system then skip this step(use FileSystemAdHocConfig if you do this).
78
+
79
+```csharp
80
+((FusionAdHocConfig)AdHocSettings.AdHocConfig).ReportingConnectionString = "server=(local);database=Reports;Trusted_Connection=True;";
81
+```
82
+
83
+####d) Set up cache
84
+
85
+Getting data from several data source providers may take a lot of time and resources when many connections are added. This will result in a slow connection to the providers due to large amount of data being transferred, etc. That’s why the cache is enabled by default for the Izenda Fusion Driver. By default, cache expiration time is set to 12PM on Saturday. This means that every Saturday, the cache will be cleared and all data will be requested from the providers during the next session.
86
+
87
+You can configure the cache yourself by using the following properties and methods:
88
+
89
+* **DataCacheExpiration:** Sets the date for cache expiration. All data in the cache older than the specified date will be cleared (removed from the cache). For example, if you want to clear all data more than two days old, you should set: ``fusionDriver.DataCacheExpiration = DateTime.Now.AddDays(-2);``
90
+* **CacheAllReports method:** Adds all available reports to the cache: ``fusionDriver.CacheAllReports();``
91
+* **CacheReport method:** Adds a single report with the specified name to the cache: ``fusionDriver.CacheReport(string reportFullName);``
92
+
93
+##Sample use
94
+
95
+Below is a full example of how to set up and configure the Izenda Fusion Driver with several connections and reports stored in your database:
96
+
97
+```csharp
98
+<%@ Application Language="C#" %>
99
+<%@ Import Namespace="System.Data"%>
100
+<%@ Import Namespace="Izenda.AdHoc.Database"%>
101
+<%@ Import Namespace="Izenda.AdHoc" %>
102
+<%@ Import Namespace="System.Configuration" %>
103
+
104
+<script runat="server">
105
+ void Session_Start(object sender, EventArgs e)
106
+ {
107
+ // Set license key. Note: "+FUSION" must be in license key
108
+ AdHocSettings.LicenseKey = "LICENSE KEY";
109
+
110
+ // Set config. Note: config class must derive from FusionAdHocConfig or FileSystemAdHocConfig
111
+ AdHocSettings.AdHocConfig = new CustomFusionAdHocConfig();
112
+
113
+ // Create Fusion driver and set it as default driver for AdHoc
114
+ FusionDriver fusionDriver = new FusionDriver();
115
+ AdHocContext.Driver = fusionDriver;
116
+
117
+ // Add connection to the local MSSQL database
118
+ fusionDriver.AddConnection("SqlNW", FusionConnectionType.MsSql, "server=(local);database=Northwind;Trusted_Connection=True;");
119
+ // Add connection to the OData provider which is connected to the Oracle database
120
+ fusionDriver.AddConnection("OrclNW", FusionConnectionType.OData, "http://www.providerdomain.com/Oracle/FusionEndpoint.aspx");
121
+
122
+ // Add visible data sources
123
+ fusionDriver.VisibleDataSources = new string[] { "Orders", "Customers", "Order Details" };
124
+
125
+ // Configure constraints for connections
126
+ fusionDriver.AddConstraint("SqlNW/Order.Id", "SqlNW/*.OrderID");
127
+ fusionDriver.RemoveConstraint("OrclNW/Account.Id", "OrclNW/User.AccountID");
128
+
129
+ // Clear cache
130
+ fusionDriver.DataCacheExpiration = DateTime.Now;
131
+
132
+ // Add some reports to the cache
133
+ fusionDriver.CacheReport("Financial reports\Sales");
134
+ fusionDriver.CacheReport("Common reports\Employees");
135
+
136
+ // Set connection to the database with reports table
137
+ ((FusionAdHocConfig)AdHocSettings.AdHocConfig).ReportingConnectionString = "server=(local);database=ReportsDB;Trusted_Connection=True;";
138
+ }
139
+
140
+ [Serializable]
141
+ public class CustomFusionAdHocConfig : FusionAdHocConfig
142
+ {
143
+ public override void ConfigureSettings()
144
+ {
145
+
146
+ }
147
+ }
148
+</script>
149
+```
150
+
151
+##Customizing the Izenda Fusion driver
152
+
153
+Izenda reports is designed as a modular system to be easily customizable for usage with any datasources. The ``AdHocContext`` class has a **Driver** property containing an instance of ``Izenda.AdHoc.Database.Driver`` abstract class, which provides datasource metadata for Izenda AdHoc.
154
+
155
+The ``Izenda.AdHoc.Database.MSSQLDriver`` class implements complete functionality for using MSSQL server as your datasource and also allows you to create inheritors. So the easiest way to create a custom driver working with MSSQL server is to inherit ``Izenda.AdHoc.Database.MSSQLDriver`` and override the functionality you need to work differently. Below is complete instruction on performing this.
156
157
+1. Create new project with type of Class library in Visual Studio (Figure 2).
158
+![Creating a Custom Driver](http://wiki.izenda.us/Guides/Developer-Links-and-Guides/custom_fusion_driver_2.png)
159
+2.