Welcome to WindowsClient.net | Sign in | Join

SCE Reader Extensibility Overview

The Syndicated Client Experiences (SCE) Reader SDK has been factored into two parts. The SceReader component is the foundation of this class of applications and provides core services and functionality. The SceReaderSample project builds on top of this core functionality and provides a fully functional sample application.

You can customize the sample application extensively by directly editing the SceReaderSample application. You can customize the application at a more fundamental level by overriding and extending the functionality provided in the SceReader component.

The primary extensibility point for the SCE Starter Kit is the ServiceProvider class. This class provides access to a set of services which can be highly customized. These services include the following classes:

  1. AdSelector
  2. ConverterManager
  3. DataManager
  4. Logger
  5. PrintManager
  6. ViewManager
  7. WebCredentials

AdSelector

The AdSelector class chooses an ad from the ad feed to display in a given context. Possible customization scenarios include the following:

  1. More sophisticated ad-selection algorithms.
  2. Keyword-based ad targeting.

ConverterManager

Given a source type and target type, the ConverterManager class returns a suitable converter. A default set of converters is registered at run time, and it is straightforward to register your own converters. Possible customization scenarios include the following:

  1. Registering a converter to customize article presentation. (See also ViewInsertionManager for information about customizing article appearance.)
  2. Registering a converter to handle additional elements from an extended RSS feed.

DataManager

The DataManager class centralizes management of data that is represented by a publisher’s data feed. It exposes the data model and raises data centric events. Possible customization scenarios include the following:

  1. Displaying authentication UI before a data sync occurs
  2. Downloading “OnDemand” archives
  3. Selectively syncing video content

Logger

The Logger class centralizes data collection, serialization, and data upload. The methods provided by this class help you track application usage. In many scenarios, you will not extend Logger directly. Instead, you will use the Logger class methods to help you implement more sophisticated usage-tracking scenarios. Possible customization scenarios include the following:

  1. Specialized data upload for application-usage reporting.
  2. Custom content-consumption tracking.

PrintManager

The PrintManager class handles the conversion between an XML-based article and a printable format. Possible customization scenarios include the following:

  1. Customizing article printing with headers and footers.
  2. Implementing a print queue that prints a collection of articles simultaneously.

ViewManager

The ViewManager class is an abstraction layer between the data model generated from the publisher’s feed and the application UI. It is an important piece of the extensibility model provided by the Starter Kit. (This class is different than ViewInsertionManager, which is a component for customizing the appearance of article layouts.)

WebCredentials

The WebCredentials class is used to configure all HttpWebRequest instances for authentication purposes. Possible customization scenarios include the following:

  1. Configuring Web requests to access authenticated content.
  2. Configuring Web requests to bypass manually configured Web proxies.

ServiceProvider Extensibility Pattern

The NewsReader sample application contains a SampleServiceProvider class which illustrates the pattern you use to extend any ServiceProvider services. This pattern is summarized as follows:

  1. Create your own service that derives from one of the provided services.
  2. Create your own class that derives from ServiceProvider.
  3. Override the method ServiceProvider.OnInitializeServiceName. Point the ServiceProvider class’s internal service reference to the service you created in step 1. For example, if you created a custom logger class in step 1, this override would look like the following:
protected override void OnInitializeLogger() { LoggerInternal = new SampleLogger(); }
  1. Register your new service provider class. Registration must occur before any other application component references your service provider. In the sample application, a custom service provider is registered in the OnStartup method in NewsReaderSampleApplication.xaml.cs, using the following code:
SceReader.ServiceProvider.Initialize(new SampleServiceProvider());

Featured Item