如何:手动注册 PerformancePoint Services 扩展
上次修改时间: 2015年3月9日
为 Microsoft SharePoint Server 2010 中的 PerformancePoint Services 部署扩展的过程包括在应用程序服务器(即运行 PerformancePoint Services 的计算机)上注册扩展和自定义的 DLL,然后将任何支持性文件复制到其目标位置。
适用范围: SharePoint Server 2010
您必须手动地或者通过使用脚本或自定义计时器作业在 PerformancePoint Services web.config 文件中为场中的每个 PerformancePoint Services 实例注册您的扩展。不过,您可以将 PerformancePoint Services 扩展的组件作为解决方案打包,然后将其部署到整个场中。有关如何部署 SharePoint 解决方案的信息,请参阅使用解决方案。
备注
若要编辑 web.config 文件,您必须在应用程序服务器上具有足够的管理权限。
本主题介绍如何在将您的自定义 DLL 添加到全局程序集缓存后,在 PerformancePoint Services web.config 文件中手动注册扩展。所做的修改将取决于扩展类型,如表 1 所示。
表 1. 按扩展类型列出的可以进行的修改
扩展类型 |
在 web.config 文件中的修改 |
---|---|
报表 |
添加自定义对象的元数据 |
筛选器 |
添加自定义对象的元数据 添加提供程序或转换的键 |
数据源 |
添加自定义对象的元数据 添加提供程序或转换的键 |
记分卡转换 |
添加提供程序或转换的键 |
添加自定义对象的元数据
必须将自定义报表、筛选器或数据源对象的元数据添加到 web.config 文件中。PerformancePoint Services 使用此元数据创建和显示自定义对象以及打开自定义编辑器。元数据属性映射到 CustomFCODefinition 类中的属性。
添加自定义报表、筛选器或数据源对象的元数据
导航到位于应用程序服务器上默认路径 C:\Program Files\Microsoft Office Servers\14.0\WebServices\PpsMonitoringServer 中的 PerformancePoint Services web.config 文件。
重要说明 最好是在编辑 web.config 文件之前创建其副本。
在诸如记事本之类的文本编辑器中打开 PerformancePoint Services web.config 文件。
如果扩展是将在服务器上注册的第一个 PerformancePoint Services 自定义扩展,则您必须注册配置节处理程序,然后添加 CustomFCOGroup 元素,如下所示:
将以下代码粘贴到 sectionGroup 元素中。
<section name="CustomFCOGroup" type="Microsoft.PerformancePoint.Scorecards.Common.Extensions.CustomFCOSection, Microsoft.PerformancePoint.Scorecards.Common, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" allowLocation="true" allowDefinition="Everywhere" />
如果您的 Microsoft.PerformancePoint.Scorecards.Common.dll 版本的公钥标记不同于示例中的版本,则用实际的公钥标记替换 PublicKeyToken 属性的值。您可以在程序集缓存中找到此属性。
将以下代码粘贴到与 CustomDataSourceProviders、FCODaoProviders、CustomParameterDataProviders 和 CustomViewTransforms 元素位于相同级别的 Bpm 元素中。
<CustomFCOGroup></CustomFCOGroup>
将以下代码粘贴到 CustomFCOGroup 元素中。
<CustomFCO type="[The object type: ReportView, Filter, or DataSource.]" subType="[The unique identifier for your custom ReportView, Filter, or DataSource object.]" > <Resources assemblyName="[The fully qualified name of the resources assembly.]" resourcesName="[The fully qualified name of the resources file.]" FCOName="[The display name for the custom object.]" FCODescription="[The description for the custom object.]" FCOTemplateIcon="[The image resource to use as the icon for the custom object.]"/> <RendererClass name="[The fully qualified name of the renderer class in the format: Namespace.Class name, DLL name, DLL version number, DLL culture, DLL public key token. Applies to ReportView and Filter objects only.]"/> <EditorURI uri="[The URI of the custom editor.]"/> </CustomFCO>
在步骤 5 到步骤 13 中,用对象的实际值替换占位符值。请务必删除方括号,但请勿删除引号。
备注
有关如何安装 PerformancePoint Services 示例的说明,请参阅代码示例:自定义报表、筛选器和表格数据源对象和代码示例:自定义记分卡转换。
对于 type 属性,请输入自定义对象的类型。有效的值为 ReportView、Filter 或 DataSource。PerformancePoint Services 使用此值对 PerformancePoint 仪表板设计器、SharePoint Server 2010 和 PerformancePoint Services 存储库中的对象进行分类。
对于 subType 属性,请输入作为字符串的对象唯一标识符。例如,示例数据源使用以下项:subType="WSTabularDataSource"。
在用户从仪表板设计器创建一个自定义对象时,web.config 文件中的 subType 值将用作该对象的 SubTypeId 属性。PerformancePoint Services 使用此值来确定一个对象是否是自定义对象。
备注
如果自定义编辑器还指定对象的 SubTypeId 属性,则它必须匹配 web.config 文件中的 subType 属性。最佳实践是,仅当在仪表板设计器之外创建自定义对象时,编辑器才应指定 SubTypeId 属性。有关详细信息,请参阅用于自定义 PerformancePoint Services 对象的编辑器。
对于 assemblyName 属性,通过使用以下格式输入包含资源文件的程序集的完全限定名称。
assemblyName="[DLL name], Version=[version number], Culture=[culture type], PublicKeyToken=[public key token]"
如果您在扩展中未提供项目资源,则删除 assemblyName 和 resourcesName 属性。(下一步将介绍 resourcesName 属性。)
备注
有关如何将资源添加到扩展中的说明,请参阅如何:向 PerformancePoint Services 扩展添加资源。
对于 resourcesName 属性,请输入资源文件的完全限定名称。如果指定 assemblyName 属性的值,则必须提供值。如果您在扩展中未提供项目资源,则删除 assemblyName 和 resourcesName 属性。
对于 FCOName 属性,请输入自定义对象的名称。如果指定了资源程序集,则输入资源键作为名称,否则输入作为字符串的名称。此名称将显示在仪表板设计器、SharePoint Server 2010 和 PerformancePoint Services 存储库中。
对于 FCODescription 属性,请输入自定义对象的说明。如果指定了资源程序集,则输入资源键作为说明,否则输入作为字符串的说明。此说明将显示在仪表板设计器的模板选择对话框中。
对于 FCOTemplateIcon 属性,请输入资源键作为图标。如果扩展未提供自定义图标,则删除 FCOTemplateIcon 属性。此图标将显示在仪表板设计器的模板选择对话框中。
备注
若要使用自定义图标,扩展必须包含图标的 32 x 32 像素的位图图像资源。有关详细信息,请参阅如何:向 PerformancePoint Services 扩展添加资源。
对于 RendererClass 元素的 name 属性,请输入呈现器类的完全限定名,此类是呈现自定义报表或筛选器选择控件的默认 Web 服务器控件。使用格式 Namespace.Class name, DLL name, DLL version number, DLL culture, DLL public key token。例如,按如下方式注册示例报表的呈现器类。
<RendererClass name="Microsoft.PerformancePoint.SDK.Samples.SampleReport.SampleReportRenderer, Microsoft.PerformancePoint.SDK.Samples, Version=14.0.0.0, Culture=neutral, PublicKeyToken=fa525c8383a44a52" />
此值是 ReportView 和 Filter 类型所必需的。如果要注册自定义数据源对象,则删除 RendererClass 元素和 name 属性。
备注
您可以在自定义编辑器的用户界面中公开 RendererClassName 属性,以便让用户能够替代此值。
对于 EditorURI 属性,请输入自定义编辑器的 URI。PerformancePoint Services 将对象的 type 和 subType 附加到此路径,然后使用它从仪表板设计器或 SharePoint Server 2010 中打开编辑器。
可以根据需要将参数附加到编辑器 URI。每次打开编辑器时,此参数都将传递给编辑器。此值是静态的,无法动态地生成。附加参数的一种情况是,使编辑器能够同时支持报表和筛选器。若要使编辑器知道它正在处理哪种类型的对象,您可以将 type 传递到编辑器 URI 中。在这种情况下,如果是报表扩展,则将 ?type=ReportView 附加到编辑器路径;如果是筛选器扩展,则附加 ?type=Filter。这些参数不会影响到 PerformancePoint Services 附加的参数。有关 PerformancePoint Services 附加的参数的详细信息,请参阅用于自定义 PerformancePoint Services 对象的编辑器。
取决于对象类型,关闭文件或注册提供程序。
如果注册 ReportView 类型,则保存然后关闭 web.config 文件。
如果注册 Filter 或 DataSource 类型,则还必须注册提供程序。继续执行以下过程中的步骤 2。
添加提供程序或转换的键
如果扩展定义了数据源提供程序、筛选器的数据提供程序或记分卡转换,则必须注册提供程序或记分卡转换。
添加提供程序或转换的键
创建 PerformancePoint Services web.config 文件的副本。应用程序服务器上 web.config 文件的默认路径是 C:\Program Files\Microsoft Office Servers\14.0\WebServices\PpsMonitoringServer。
在诸如记事本之类的文本编辑器中打开 PerformancePoint Services web.config 文件。
如下所示添加提供程序或转换 DLL 的键:
备注
为了改善可读性,以下示例中添加了换行符。在将此项粘贴到 web.config 文件中后,可以删除换行符。
若要注册数据源提供程序,请使用以下格式在 CustomDataSourceProviders 元素中添加键:
<add key="[data source provider ID]" value="[namespace name.class name], [DLL name], Version=[version number], Culture=[culture type], PublicKeyToken=[public key token]" />
例如,若要在 PerformancePoint Services 示例中注册数据源扩展中的数据源提供程序,请添加下面的键。
<add key="WSTabularDataSource" value="Microsoft.PerformancePoint.SDK.Samples.SampleDataSource.WSTabularDataSourceProvider, Microsoft.PerformancePoint.SDK.Samples, Version=14.0.0.0, Culture=neutral, PublicKeyToken=fa525c8383a44a52" />
数据源提供程序 ID (WSTabularDataSource) 必须与您为 CustomFCOGroup 元素中的自定义数据源对象指定的 subType 属性相匹配,并且它必须匹配由 GetId() 方法返回的值(此方法由 TabularDataSourceProvider 类实现)。此外,它必须匹配 SubTypeId 属性(如果编辑器定义了此属性)。
若要注册筛选器的数据提供程序,请使用以下格式在 CustomParameterDataProviders 元素中添加一个键:<add key="[data provider ID]" value="[namespace name.class name], [DLL name], Version=[version number], Culture=[culture type], PublicKeyToken=[public key token]" />
备注
key 属性的值必须由筛选器数据提供程序中的 GetId() 方法以及由 ParameterProviderId 属性返回,而后者由筛选器的 BeginPoints 属性返回。
例如,若要在 PerformancePoint Services 示例中注册筛选器扩展中的数据提供程序,请添加下面的键。
<add key="SampleFilterDataProvider" value="Microsoft.PerformancePoint.SDK.Samples.SampleFilter.SampleFilterDataProvider, Microsoft.PerformancePoint.SDK.Samples, Version=14.0.0.0, Culture=neutral, PublicKeyToken=fa525c8383a44a52" />
若要注册记分卡转换,请使用以下格式在 CustomViewTransforms 元素中添加键:
<add key="[unique transform ID]" value="[namespace name.class name], [DLL name], Version=[version number], Culture=[culture type], PublicKeyToken=[public key token]" />
例如,若要注册 PerformancePoint Services 示例中的所有转换,请添加下面的键。
<add key="AddColumn" value="Microsoft.PerformancePoint.SDK.Samples.ScorecardTransforms.PreQuery.AddColumnTransform, Microsoft.PerformancePoint.SDK.Samples, Version=14.0.0.0, Culture=neutral, PublicKeyToken=fa525c8383a44a52"/> <add key="NumberScaling" value="Microsoft.PerformancePoint.SDK.Samples.ScorecardTransforms.PostQuery.NumberScalingTransform, Microsoft.PerformancePoint.SDK.Samples, Version=14.0.0.0, Culture=neutral, PublicKeyToken=fa525c8383a44a52"/> <add key="ShowAnnotationDate" value="Microsoft.PerformancePoint.SDK.Samples.ScorecardTransforms.PreRender.ShowAnnotationDate, Microsoft.PerformancePoint.SDK.Samples, Version=14.0.0.0, Culture=neutral, PublicKeyToken=fa525c8383a44a52"/> <add key="FormattingTransform" value="Microsoft.PerformancePoint.SDK.Samples.ScorecardTransforms.PreRender.FormattingTransform, Microsoft.PerformancePoint.SDK.Samples, Version=14.0.0.0, Culture=neutral, PublicKeyToken=fa525c8383a44a52"/>
保存然后关闭 web.config 文件。
请参阅
概念
使用 PerformancePoint Services 的开发方案
其他资源
如何实现 - PerformancePoint Services