ContentSelector.GetContent Method (PIA)
Use this method to execute a Content Selection pipeline and return the resulting content in a SimpleList object.
Definition
[Visual Basic .NET]
Imports Microsoft.CommerceServer.Interop ‘ for IDictionary & ISimpleList
Imports Microsoft.CommerceServer.Interop.Targeting
…
Public Function GetContent(dictCSFContext As IDictionary,
) As ISimpleList
[C#]
using Microsoft.CommerceServer.Interop.Targeting;
using Microsoft.CommerceServer.Interop; //For ISimpleList & IDictionary
…
public ISimpleList GetContent(IDictionary pdictCSFContext);
Parameters
- pdictCSFContext
The IDictionary interface to a global context dictionary with a configuration for an instance of a CSF application. The dictionary contains global objects and configurations used by the ContentSelector object. At a minimum, the dictionary must contain thePipeline
key so that the ContentSelector object knows which pipeline to execute.
Return Values
[Visual Basic .NET] If this method completes successfully, it returns an ISimpleList interface to a SimpleList object containing the selected content. The elements of the SimpleList object are HTML or XML strings.
[C#] This method returns an ISimpleList interface to a SimpleList object containing the selected content. The elements of the SimpleList object are HTML or XML strings.
Exceptions
This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.
Note
- This method can also return an error returned by the invoked pipeline.
Remarks
The ContentSelector object reads the Pipeline
key of the passed in Dictionary object to find the pipeline object to invoke. It copies the values of the dictionary passed to it into a new dictionary. The new dictionary is passed to the pipeline as the pipe Context dictionary. An empty dictionary is created and passed as the Order dictionary for the pipeline. The ContentSelector object adds a reference to itself under the ContextProfile
key in the pipe Context dictionary.
When pipeline execution has completed, the ContentSelector object looks for the key formatted
in the Order dictionary, and returns the list assigned to that key as the return value. If the list assigned to the formatted
key does not exist, an empty list is created and returned. The self-reference in the pipe Context dictionary is removed to prevent a circular reference. References to the Order and Context dictionaries are added to the ContentSelector object before it returns, giving the page access to the values written into those dictionaries by the pipeline.
[Visual Basic .NET]
Example
For example code, see the sample in ContentSelector Object.
Requirements
Namespace: Microsoft.CommerceServer.Interop.Targeting
Platforms: Windows 2000, Windows Server 2003
Assembly: csfcomplib (in csfcomplib.dll)
See Also
Copyright © 2005 Microsoft Corporation.
All rights reserved.