5a2b4744bb933469bfcbeea0eeb896d8951a4ed3
API/CodeSamples/WebFarmNodesRsUrls.md
| ... | ... | @@ -0,0 +1,57 @@ |
| 1 | +#WebFarmodesRsUrls |
|
| 2 | + |
|
| 3 | +[[_TOC_]] |
|
| 4 | + |
|
| 5 | +##About |
|
| 6 | + |
|
| 7 | +**Data Type:** string array |
|
| 8 | +**Accepted Values:** URL locations |
|
| 9 | +**Default value:** null |
|
| 10 | +**Impacted Features:** Website infrastructure and url navigation |
|
| 11 | +**Purpose:** Gets or sets response server urls of other machines in webfarm |
|
| 12 | +**Usage:** This setting is used to ensure that Izenda is aware of all rs.aspx URLs when issuing server commands such as invalidating the server's schema cache on the filesystem. |
|
| 13 | +**Caveats:** This setting is only to be used when the webfarm in question uses different URLs for routing and does not ensure that caches will be successfully invalidated if load balancing with a single website URL is used as there is no way to know strictly through the URL what machine is being accessed. Other measures need to be taken to ensure schema cache invalidation successfully occurs in that scenario. |
|
| 14 | + |
|
| 15 | +##Code Samples |
|
| 16 | +###Global.asax (C♯) |
|
| 17 | + |
|
| 18 | +```csharp |
|
| 19 | +//main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 20 | +public class CustomAdHocConfig : Izenda.AdHoc.DatabaseAdHocConfig |
|
| 21 | +{ |
|
| 22 | + // Configure settings |
|
| 23 | + // Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method |
|
| 24 | + public static void InitializeReporting() { |
|
| 25 | + //Check to see if we've already initialized. |
|
| 26 | + if (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null) |
|
| 27 | + return; |
|
| 28 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"; |
|
| 29 | + //Creates a connection to Microsoft SQL Server |
|
| 30 | + AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"; |
|
| 31 | + Izenda.AdHoc.AdHocSettings.AdHocConfig = new CustomAdHocConfig(); |
|
| 32 | + AdHocSettings.WebFarmNodesRsUrls = new string[] { "http://mysite.reporting.com/rs.aspx", "http://mysite2.reporting.com/rs.aspx" }; |
|
| 33 | + HttpContext.Current.Session["ReportingInitialized"] = true; |
|
| 34 | + } |
|
| 35 | +} |
|
| 36 | +``` |
|
| 37 | + |
|
| 38 | +###Global.asax (VB.NET) |
|
| 39 | + |
|
| 40 | +```visualbasic |
|
| 41 | +'main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 42 | +Public Class CustomAdHocConfig |
|
| 43 | + Inherits Izenda.AdHoc.DatabaseAdHocConfig |
|
| 44 | + |
|
| 45 | + Shared Sub InitializeReporting() |
|
| 46 | + 'Check to see if we've already initialized |
|
| 47 | + If HttpContext.Current.Session Is Nothing OrElse HttpContext.Current.Session("ReportingInitialized") IsNot Nothing Then |
|
| 48 | + Return |
|
| 49 | + 'Initialize System |
|
| 50 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE" |
|
| 51 | + AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE" |
|
| 52 | + Izenda.AdHoc.AdHocSettings.AdHocConfig = New CustomAdHocConfig() |
|
| 53 | + AdHocSettings.WebFarmNodesRsUrls = New String() { "http://mysite.reporting.com/rs.aspx", "http://mysite2.reporting.com/rs.aspx" } |
|
| 54 | + HttpContext.Current.Session("ReportingInitialized") = True |
|
| 55 | + End Sub |
|
| 56 | +End Class |
|
| 57 | +``` |
|
| ... | ... | \ No newline at end of file |