SPDataStore.GetDataSource Method
Retrieves a data source from a SharePoint document library.
Namespace: Microsoft.PerformancePoint.Scorecards.Store
Assembly: Microsoft.PerformancePoint.Scorecards.Store (in Microsoft.PerformancePoint.Scorecards.Store.dll)
Syntax
'Declaration
Public Function GetDataSource ( _
location As RepositoryLocation _
) As DataSource
'Usage
Dim instance As SPDataStore
Dim location As RepositoryLocation
Dim returnValue As DataSource
returnValue = instance.GetDataSource(location)
public DataSource GetDataSource(
RepositoryLocation location
)
Parameters
location
Type: Microsoft.PerformancePoint.Scorecards.RepositoryLocationThe location of the data source in the SharePoint document library. Only the ItemUrl property must be defined.
Return Value
Type: Microsoft.PerformancePoint.Scorecards.DataSource
The requested data source, or a null reference (Nothing in Visual Basic) if it does not exist.
Implements
IBIMonitoringStore.GetDataSource(RepositoryLocation)
Remarks
Security Note |
---|
To apply appropriate user permissions before returning a retrieved data source or exposing its results to an external caller, call the ApplyUserPermissionsToDatasource(DataSource) method. |
Examples
The following code example shows how to retrieve a data source from the repository.
Before you can compile this code example, you must do the following:
Configure your development environment and create a C# class library project in Visual Studio. For information about configuring a development environment, see Setting Up the Development Environment for SharePoint 2010 on Windows Vista, Windows 7, and Windows Server 2008.
Add the Microsoft.PerformancePoint.Scorecards.Client and Microsoft.PerformancePoint.Scorecards.ServerCommon DLLs as references to your project. For more information about PerformancePoint Services in Microsoft SharePoint Server 2010 DLLs, see PerformancePoint Services DLLs Used in Development Scenarios.
Add the following using directive to your class: using Microsoft.PerformancePoint.Scorecards;.
Create a method that defines a string variable named "relativePath" to store the server-relative path to the object. The following example path sets the object identifier to "5": /BI Center/Data Connections for PerformancePoint/5_.000.
Paste the following code example into the new method.
// Create a RepositoryLocation object to represent the location of the data source.
// The constructor takes the server-relative path to the data source.
RepositoryLocation dataSourceLocation = new RepositoryLocation(relativePath);
// This example assumes the code is running in a Web Part on a front-end Web server.
// If this code is running within a service application, then you can call the
// SPDataStore.GlobalStore.GetDataSource method directly.
DataSource requestedDataSource =
BIMonitoringServiceApplicationProxy.Default.GetDataSource(dataSourceLocation);