Export (0) Print
Expand All
Expand Minimize

BIMonitoringServiceApplicationProxy.GetListItems method

Gets first class objects (FCOs) from the specified SharePoint document library or list.

Namespace:  Microsoft.PerformancePoint.Scorecards
Assembly:  Microsoft.PerformancePoint.Scorecards.ServerCommon (in Microsoft.PerformancePoint.Scorecards.ServerCommon.dll)

public FirstClassElementCollection GetListItems(
	string listUrl
)

Parameters

listUrl
Type: System.String

The server-relative URL of the document library or list that contains the objects. Example: /BI Center/Lists/PerformancePoint Content.

Return value

Type: Microsoft.PerformancePoint.Scorecards.FirstClassElementCollection
The FCOs from the specified repository.

Implements

IBIMonitoringServiceApplicationProxy.GetListItems(String)

PerformancePoint Services uses SharePoint document libraries and lists as its repository. It stores data sources in a document library, and it stores other FCO types in a list.

The following code example is an excerpt from the PerformancePoint Services SDK Reference Sample. The sample runs on the front-end web server within a PerformancePoint Services application instance; therefore it calls GetListItems(String) to retrieve all data sources from a specified document library.

Before you can compile this code example, you must do the following:

using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Web.Services.Protocols;
using Microsoft.PerformancePoint.Scorecards;

namespace Microsoft.PerformancePoint.SDK.Samples
{

    public class DataSourceConsumerHelper
    {
        private static IBIMonitoringServiceApplicationProxy proxy;

        public DataSourceConsumerHelper() { }

        // Get an instance of the service application proxy.
        public IBIMonitoringServiceApplicationProxy Proxy
        {
            get
            {
                if (null == proxy)
                {
                    proxy = BIMonitoringServiceApplicationProxy.Default;
                }
                return proxy;
            }
        }

        // Get all data sources in the specified list.
        public ICollection GetAllDataSources(string listUrl)
        {
            return GetDataSources(listUrl, null);
        }

        // Get all data sources in the specified list whose source 
        // name matches the specified source name.
        public ICollection GetDataSourcesBySourceName(string listUrl, string sourceName)
        {
            return GetDataSources(listUrl,
                                  dataSource => (dataSource.SourceName.Equals(sourceName,
                                                                              StringComparison.OrdinalIgnoreCase)));
        }

        // Get all data sources whose source names are included in 
        // the specified array.
        public ICollection GetDataSourcesBySourceNames(string listUrl, string[] sourceNames)
        {
            return GetDataSources(listUrl,
                                  delegate(DataSource dataSource)
                                  {
                                      foreach (string sourceName in sourceNames)
                                      {
                                          if (dataSource.SourceName.Equals(sourceName,
                                                                        StringComparison.OrdinalIgnoreCase))
                                          {
                                              return true;
                                          }
                                      }
                                      return false;
                                  });
        }

        // Get all the data sources in the specified list. The returned
        // collection is filtered by the specified predicate method.
        public ICollection GetDataSources(string listUrl, Predicate<DataSource> filter)
        {
            var dataSources = new List<DataSource>();

            FirstClassElementCollection elements = Proxy.GetListItems(listUrl);

            foreach (FirstClassElement element in elements)
            {
                if (element is DataSource)
                {
                    dataSources.Add(element.Clone() as DataSource);
                }
            }

            if (filter != null)
            {
                var filteredDataSources = new List<DataSource>();
                foreach (DataSource dataSource in dataSources)
                {
                    if (filter(dataSource))
                    {
                        filteredDataSources.Add(dataSource.Clone() as DataSource);
                    }
                }
                return filteredDataSources;
            }
            return dataSources;
        }

        // Get the data set.
        public DataSet GetDataSet(int maxRecords, DataSource dataSource)
        {
            try
            {
                return Proxy.GetPreviewDataSet(maxRecords, dataSource);
            }
            catch (SoapException)
            {
                return null;
            }
        }

        // Get the data source at the specified repository location.
        public DataSource GetDataSource(RepositoryLocation dataSourceLocation)
        {
            return Proxy.GetDataSource(dataSourceLocation);
        }
    }
}
Show:
© 2015 Microsoft