Assembly: Endeca.Web (in Endeca.Web.dll) Version: 2.1.3.0 (2.1.3.622)
Syntax
C# |
---|
public string BuildUrl( Action<CommandActionInfo> action, IIndexProvider indexProvider, string commandID ) |
Visual Basic (Declaration) |
---|
Public Function BuildUrl ( _ action As Action(Of CommandActionInfo), _ indexProvider As IIndexProvider, _ commandID As String _ ) As String |
Visual C++ |
---|
public: String^ BuildUrl( Action<CommandActionInfo^>^ action, IIndexProvider^ indexProvider, String^ commandID ) |
Parameters
- action
- Type: System..::.Action<(Of <(CommandActionInfo>)>)
A delegate that represents the changes to make to the commands and parameters registered with a UrlManager, in order to transition to the desired state that should be encoded in the URL.
- indexProvider
- Type: Endeca.Web.Url.Indexing..::.IIndexProvider
An indexed result object that will be included in the CommandInfoCollection used by the action. The command in the CommandInfoCollection with an id equal to commandId will be updated such that the result object is equal to the indexProvider. This object must implement the IIndexProvider interface.
- commandID
- Type: System..::.String
A string representing the ID of the command whose result object should be updated before the action is invoked.
Remarks
The desired modification(s) to the command or commands is specified by the action delegate. The implementation of this delegate can request copies of the commands that have been registered with the UrlManager by calling Get<(Of <(TCommand>)>)(String), and then alter the state of these copies to reflect the desired state that should be encoded into the URL. If any commands were registered with the UrlManager but not copied by calling Get<(Of <(TCommand>)>)(String) in the action delegate, then the state of those unmodified commands is also encoded into the URL.
In addition to the state of one or more commands, the URL can include arbitrary name-value pairs. These name-value pairs are represented by the Parameters collection. Similar to the manner in which the action delegate can obtain copies of the commands registered with the UrlManager, the delegate can obtain a copy of the Parameters collection. The delegate can then alter this copy to specify the exact name-value parameters to include in the URL.
Note that the algorithm by which commands and parameters are encoded into a URL is represented by the UrlProvider associated with the UrlManager. The Construct(String, CommandInfoCollection, NameValueCollection) method of this Provider is called after the action delegate is invoked to produce the URL that is returned by this method.
Examples
public string SelectDimensionValueUrl( UrlManager mgr, DimensionValue dimVal ) { return mgr.Urls.BuildUrl( delegate( CommandActionInfo i ) { // The Get method returns a copy of the command, and assumes a // NavigationCommand (or NavigationDataSource) has been registered with an // ID of 'navCmd'. i.Get<NavigationCommand>("navCmd").SelectDimensionValue( dimVal ); // Add a name/value pair to be encoded into the URL. i.Parameters["Foo"] = "Bar"; } , new IndexedDimensionValueCollection(dimensionValues), navigationDataSourceId ); }
Exceptions
Exception | Condition |
---|---|
System..::.ArgumentNullException | if action is null. |