Share via


IContentSelector::GetContent Method [C++]

Use this method to execute a Content Selection pipeline and return the resulting content in a SimpleList object.

Definition

[C++]

HRESULT IContentSelector::get_GetContent(IDictionary* pdictCSFContext,ISimpleList** ppLstContent);

[Visual Basic]

Function GetContent(dictCSFContext As IDictionary,
) As ISimpleList

Parameters

  • pdictCSFContext [C++]
    [in] A pointer 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 the Pipeline key so that the ContentSelector object knows which pipeline to execute.
  • dictCSFContext [Visual Basic]
    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 the Pipeline key so that the ContentSelector object knows which pipeline to execute.
  • ppLstContent [C++]
    [out, retval] A pointer to a SimpleList object containing the selected content. The elements of the SimpleList object are HTML or XML strings.

Return Values

[C++] This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

[Visual Basic] If this method completes successfully, it returns a reference to a SimpleList object that contains the selected content. The elements of the SimpleList object are HTML or XML strings.

Error Values

[C++] This method returns S_OK (0x00000000) to indicate success and standard COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return a text description of the error.

[Visual Basic] This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to standard COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

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]

Example

For example code, see the sample in Code to Support the ContentSelector Object.

See Also

[C++]CacheManager Object

[Visual Basic]CacheManager Object

Content Selection Pipelines

[C++]ContentSelector Object

[Visual Basic]ContentSelector Object

Copyright © 2005 Microsoft Corporation.
All rights reserved.