Oracle® Providers for ASP.NET Developer's Guide 11g Release 2 (11.2.0.3) for Microsoft Windows E18737-02 |
|
|
PDF · Mobi · ePub |
This class allows ASP.NET applications to retrieve site map information from an Oracle database.
System.Object
System.Configuration.Provider.ProviderBase
System.Web.SiteMapProvider
System.Web.StaticSiteMapProvider
Oracle.Web.SiteMap.OracleSiteMapProvider
// C# Public class OracleSiteMapProvider: StaticSiteMapProvider, IDisposable
All public static methods are thread-safe, although instance members are not guaranteed to be thread-safe.
This class allows ASP.NET applications to read and load site map information from an Oracle database.
The following is a web.config
example for an ASP.NET application that uses OracleSiteMapProvider
as the default provider. This configuration uses the connection string and default attribute values specified in the machine.config
file.
<?xml version="1.0"?> <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"> <system.web> <siteMap defaultProvider="OracleSiteMapProvider"/> </system.web> </configuration>
The following is a web.config
example for an ASP.NET application that uses OracleSiteMapProvider
as the default provider, with customized settings and an application-specific connection string:
<?xml version="1.0"?> <configuration xmlns= "http://schemas.microsoft.com/.NetConfiguration/v2.0"> <connectionStrings> <add name="my_sitemap_app_con_string" connectionString= "User Id=scott;Password=tiger;Data Source=Oracle"/> </connectionStrings> <system.web> <!-- Enable and customize OracleSiteMapProvider --> <siteMap defaultProvider="CustomOracleSiteMapProvider"> <providers> <add name="CustomOracleSiteMapProvider" type="Oracle.Web.SiteMap.OracleSiteMapProvider, Oracle.Web, Version=2.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" connectionStringName="my_sitemap_app_con_string" applicationName="my_sitemap_app" securityTrimmingEnabled="false"/> </providers> </siteMap> </system.web> </configuration>
Note that the applicationName
attribute should be set to a unique value for each ASP.NET application.
Namespace: Oracle.Web.SiteMap
Assembly: Oracle.Web.dll
Oracle Providers for ASP.NET Version: Oracle Providers for ASP.NET 2.0 and Oracle Providers for ASP.NET 4
OracleSiteMapProvider
requires the Change Notification privilege with Oracle Database 10g release 2 (10.2)and later.
See Also:
OracleSiteMapProvider
members are listed in the following tables.
OracleSiteMapProvider Constructors
The OracleSiteMapProvider
constructor is listed in Table 4-1.
Table 4-1 OracleSiteMapProvider Constructor
Constructor | Description |
---|---|
Instantiates a new instance of the |
OracleSiteMapProvider Static Methods
OracleSiteMapProvider
static methods are listed in Table 4-2.
Table 4-2 OracleSiteMapProvider Static Methods
Static Methods | Description |
---|---|
|
Inherited from |
|
Inherited from |
OracleSiteMapProvider Public Properties
OracleSiteMapProvider
public properties are listed in Table 4-3.
Table 4-3 OracleSiteMapProvider Public Properties
Public Properties | Description |
---|---|
Gets or sets the name of the application that differentiates site map data for different applications |
|
Gets the number of seconds that the command is allowed to execute before it is terminated with an exception |
|
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
OracleSiteMapProvider Public Methods
OracleSiteMapProvider
public methods are listed in Table 4-4.
Table 4-4 OracleSiteMapProvider Public Methods
Public Methods | Description |
---|---|
Builds a |
|
Releases all the resources for this instance |
|
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
Initializes the |
|
|
Inherited from |
This constructor instantiates a new instance of the OracleSiteMapProvider
class.
This constructor creates an instance of the OracleSiteMapProvider
class.
This constructor instantiates a new instance of the OracleSiteMapProvider
class.
// C# public OracleSiteMapProvider();
The OracleSiteMapProvider
constructor is called by ASP.NET to create an instance of the OracleSiteMapProvider
class as specified in the configuration file for the application. Initialization values for the OracleSiteMapProvider
object are passed through the Initialize
method.
This constructor is not intended to be used directly by the application.
See Also:
OracleSiteMapProvider
static methods are listed in Table 4-5.
Table 4-5 OracleSiteMapProvider Static Methods
Static Methods | Description |
---|---|
|
Inherited from |
|
Inherited from |
OracleSiteMapProvider
public properties are listed in Table 4-6.
Table 4-6 OracleSiteMapProvider Public Properties
Public Properties | Description |
---|---|
Gets or sets the name of the application that differentiates site map data for different applications |
|
Gets the number of seconds that the command is allowed to execute before it is terminated with an exception |
|
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
See Also:
This property gets or sets the name of the application that differentiates site map data for different applications.
// C# public string ApplicationName{get; set;}
The name of the application. If the applicationName
attribute is not specified in the application configuration file, or if the value is an empty string, then this property is set to the application virtual path.
HttpException
- The ApplicationName
property was set by a user that does not have high ASP.NET hosting permission.
System.Configuration.Provider.ProviderException
- The application name supplied exceeds 256 characters.
ArgumentException
- The application name supplied is an empty string or a null reference.
The string value of the ApplicationName
property is used for organizing user information.
Multiple ASP.NET applications can use the same data source and create duplicate user names because user information is stored uniquely for each application name. This property can be set programmatically, or it can be set declaratively in the configuration file for the Web application using the applicationName
attribute. The attribute name in the configuration file is case-sensitive.
The ApplicationName
property is not thread-safe. It is recommended that program code not allow users to set the ApplicationName
property in Web applications.
See Also:
This property gets the number of seconds that the command is allowed to execute before it is terminated with an exception.
// C# public int CommandTimeout {get;}
An int
.
To customize a provider, ASP.NET developers can set an integer value for this property through the web.config
file using the commandTimeout
attribute.
The default value is 30 seconds. The attribute name in the configuration file is case-sensitive.
See Also:
OracleSiteMapProvider
public methods are listed in Table 4-7.
Table 4-7 OracleSiteMapProvider Public Methods
Public Methods | Description |
---|---|
Builds a |
|
Releases all the resources for this instance |
|
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
Initializes the |
|
|
Inherited from |
See Also:
This method builds a SiteMap
tree of the SiteMapNode
objects by loading site map data from the Oracle database.
// C# Public override SiteMapNode BuildSiteMap();
The root SiteMapNode
of the site map navigation structure.
InvalidOperationException
- The OracleSiteMapProvider
instance is not initialized.
ProviderException
- One of the following conditions exists:
Root node is not found.
Multiple root nodes are found.
Parent node is not found for any node.
ConfigurationErrorsException
- One of the following conditions exists:
The roles of the SiteMapNode
contain characters that are not valid.
A URL is parsed for a SiteMapNode
that is not unique.
A SiteMapNode
object was encountered with a duplicate value for Key
.
An error occurred while parsing the URL of a SiteMapNode
.
This method fetches site map data from the database and builds a tree of site map nodes in memory. The OracleSiteMapProvider
object could choose to subscribe to database change notifications to get notified about the changes in the site map data in the database. This method is thread-safe.
See Also:
Oracle Data Provider for .NET Developer's Guide for more information about change notification
This method releases all the resources for this instance.
// C# public override void Dispose();
This method releases all the resources for this instance when the application domain is closed.
See Also:
This method initializes the OracleSiteMapProvider
instance with the property values specified in the ASP.NET application configuration file (web.config
).
// C# Public override void Initialize(string name, NameValueCollection config);
name
The name of the OracleSiteMapProvider
instance to initialize.
config
A Systems.Collections.Specialized.NameValueCollection
object that contains the names and values of configuration options for the site map provider.
ArgumentNullException
- The config
parameter is null.
InvalidOperationException
- A SiteMapProvider
is already initialized.
ProviderException
- One of the following exists:
The connectionStringName
attribute is null or empty in the configuration file.
The connection string corresponding to the value of the connectionStringName
attribute is null or empty.
The configuration file contains an unrecognized attribute.
An error occurred during initialization of the provider.
The Initialize
method is not intended to be called directly by the application.