Sharepoint学习笔记—习题系列--70-576习题解析 -(Q78-Q80)
Question 78
You are designing an application configuration approach for a custom SharePoint 2010 application. You need to design the application configuration to:
.Store and secure custom configuration settings for the application including connection strings, server names, file paths, and other miscellaneous settings.
.Read and display the settings on the site with an administrative user interface that can be configured using a custom _layouts page.
.Store configuration settings at the farm, Web application, site collection, and site levels as needed.
You need to design a storage option that is simple and lightweight in structure and programmatically configurable. Which approach should you recommend?
A. Add custom configuration settings to the web.config file and programmatically read this file to display the custom settings.
B. Use a hierarchical object store to save the custom configuration settings and programmatically read it to display the custom settings.
C. Use a property bag to store the custom configuration settings.
D. Use SharePoint lists to store the custom configuration settings.
解析:
你需要为一个Sharepoint2010应用程序设计一个存取配置信息的方案,需要满足的条件如下:
要求1. 涉及的配置信息包括连接字符串,服务器名,文件路径以及其它各种各样的设置信息。
要求2. 通过创建的用于管理的应用程序页,在此页面上读取和显示网站上的相关配置信息。
要求3 配置信息涉及场,Web Application,网站集以及网站等诸多层次。
你所提供的保存这些配置信息的方案需要简单,结构不复杂并且支持编程操作。
我们来分析各选项:
选项A.使用Web.config。首先我们知道,Web.config针对的是Web Application层次及以下的对象,而且创建其管理页面也非常复杂,所以不符合本题要求。
选项B.使用hierarchical object store,前面我们说过所谓hierarchical object store是指你通过创建继承自SPPersistedObject类的对象类实例来保存关于Farm, Web applications, features等等层次的用户的配置信息。此方法适用于你需要保存比较复杂的对象时使用,所以也不符合本题所要求的简单,结构不复杂的要求。
选项C.使用属性包。我们知道Sharepoint对SPFarm,SPWebApplication,SPSite,SPWeb和SPList这几个层次的对象均提供了属性包,通过对应的类对象可以直接使用它们,非常快捷简单,示例代码如下:
using System;
using System.Collections;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities; namespace Test
{
class Program
{
static void Main(string[] args)
{
using (SPSite site = new SPSite("http://localhost"))
{
using (SPWeb web = site.OpenWeb())
{
SPPropertyBag props = web.Properties;
foreach (DictionaryEntry de in props)
{
Console.WriteLine("Key = {0}, Value = {1}", de.Key, de.Value);
}
}
}
Console.ReadLine();
}
}
}
所以选项C符合本题要求。
选项D.使用列表。首先,列表直接就显示在内容页面(Content Page)上,而非要求2所讲的去创建用于管理的应用程序页(Application Page)。其次,使用列表来存储配置Sharepoint场,Web Application级别的信息并不合适,如果要通过代码来实现本题目所涉及的配置内容很显得比较复杂,需要考虑的东西比较多。
因此本题答案应该选C
参考
http://msdn.microsoft.com/en-au/library/ms460914(v=office.12).aspx
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.properties.aspx
Question 79
You are designing a SharePoint 2010 intranet site. Your design must:
.Specify the manner in which to store and read custom configuration settings.
.Use a standard user interface to allow the configuration settings to be created or changed.
You need to design the solution at the site collection and site levels to meet these requirements. Which approach should you recommend?
A. Use the property bag to store custom configuration settings.
B. Use the hierarchical object store to store custom configuration settings
C. Use SharePoint lists to store the custom configuration settings
D. Add custom configuration settings in the web.config file to display the settings
解析:
你需要设计一个Sharepoint2010内部网站满足如下要求:
要求1. 确定以哪种方式存取用户配置信息
要求2. 使用标准的用户界面以支持创建和修改配置信息
你需要在网站与网站集层次满足以上要求。
由于本题要求使用标准的用户界面以支持创建和修改配置信息,比较各备选项就发现只有使用列表才能符合要求了,因为Property bag与hierarchical object store均未提供用户界面进行修改,它们都需要通过代码编程实现。Web.config也不是标准的用户界面所能操纵的,况且它主要是针对Web Application级别的配置设置。
因此本题答案应该选 C
参考
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.meetings.propertybag.aspx
http://msdn.microsoft.com/en-au/library/ms460914(v=office.12).aspx
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.properties.aspx
Question 80
You are designing a SharePoint 2010 farm implementation that will include an extranet zone that will employ forms-based authentication (FBA). The plan must:
.Specify how farm administrators will manage modifications to the configuration settings for the FBA within each Web application.
.Support granular modifications to the individual Web applications.
.Include a process to apply the modifications to the SharePoint configuration database.
.Specify a process to deploy the changes throughout the server farm by propagating the changes to all Web frontend servers.
You need to create a software configuration management plan for the farm that meets all these requirements. Which approach should your plan recommend?
A. Create a feature that contains code to read, modify, and save the configuration setting for the SPWebApplication object for each Web application. Save the settings in the hierarchical object store by creating a SPPersistedObject class to store the configuration.
B. Create a feature that contains code to modify the configuration settings to the web.config file for each Web application. Then propagate the changes programmatically by implementing the SPWebConfigModification class.
C. Build a custom list for each Web application that stores the required configuration information. Create a custom workflow that uses the Set Field in Current Item action to synchronize the settings in the list with the configuration database and the Web servers.
D. Build the required changes declaratively by creating an XML extension containing the settings needed. Deploy the file to the 14\Config directory. Then use the Stsadm copyappbincontent command to merge these changes with the existing web.config file.
解析:
你负责设计一个包含外部区域(支持表单认证FBA)的Sharepoint2010场应用,需要满足如下要求:
要求1. 指明场管理员如何针对每个Web Application维护用于表单认证的配置设置。
要求2. 支持对各个Web Application分别进行修改
要求3. 实现把上述的修改传播到场内所有的WFE服务器上
你需要针对Sharepoint场来制定一个软件配置管理方案以满足上述所有要求。
下面我们来分析各备选项:
选项A. Create a feature that contains code to read, modify, and save the configuration setting for the SPWebApplication object for each Web application. Save the settings in the hierarchical object store by creating a SPPersistedObject class to store the configuration.
我们知道,Web.config与Hierarchical object store均是针对Web Application层次的配置存储途径,Hierarchical object store主要用于为第三方应用程序通过创建继承自SPPersistedObject类的对象来实现存取配置信息提供一个应用框架。实例化 SPPersistedObject 的对象保留在 SharePoint 2010 配置数据库中。而我们知道Sharepoint使用配置数据库来存储服务器场中服务器的配置和网站映射信息。每个服务器场只能有一个配置数据库。 由此就无法实现本题的要求3,即把上述的修改传播到场内所有的WFE服务器上。所以本选项被排除
选项B. Create a feature that contains code to modify the configuration settings to the web.config file for each Web application. Then propagate the changes programmatically by implementing the SPWebConfigModification class.
通过Web.config来实现,我们知道SharePoint Foundation用到了大量的 web.config 文件。Sharepoint中的每个 Web Application都对应一个文件,并且每台前端 Web 服务器中包含每个这些文件的副本。为了更加轻松地自定义 web.config 文件,SharePoint Foundation 提供了两种更改方式。第一种方式是通过创建包含一组 web.config 修改的 XML 文件以声明方式注册 web.config 项,此方式会把所有WebApplication的web.Config都修改掉。第二种就是使用 SharePoint Foundation 对象模型来修改 web.config 设置。
我们可以以编程方式添加和删除 Web.config 设置,修改 web.config 设置的一种方法是使用 Microsoft.SharePoint.Administration 命名空间的 SPWebConfigModification 类,这使得您能够动态地对实体进行注册。这些修改保留在配置数据库中,在那里,它们充当一种虚拟 web.config,后者其实上充当 SharePoint Foundation Web 应用程序的 .config 文件堆栈的最后一层。在调用 SPWebService.ApplyWebConfigModifications 方法时,所做更改才会生效。
调用 ApplyWebConfigModifications 方法将安排一个计时器作业以在整个服务器场中部署更改【也就是本题要求3所指的”传播”效果】。若要将 web.config 修改应用于特定的 Web 应用程序,请将此修改添加到 Web 应用程序的 web.config 修改集 (WebConfigModifications) 中。例如,您可以使用 oWebSite.Site.WebApplication.WebConfigModifications.Add(MyModification) 将 web.config 修改添加到特定网站的父 Web 应用程序中。即使是将 web.config 修改添加到单个 Web 应用程序,您也仍旧必须调用 ApplyWebConfigModifications。
由上面分析可以看出,选项B是本题想要的答案。
选项C. Build a custom list for each Web application that stores the required configuration information. Create a custom workflow that uses the Set Field in Current Item action to synchronize the settings in the list with the configuration database and the Web servers.
列表并不是用来存储Web Application级别配置信息的合理架构,所以直接排除。
选项D. Build the required changes declaratively by creating an XML extension containing the settings needed. Deploy the file to the 14\Config directory. Then use the Stsadm copyappbincontent command to merge these changes with the existing web.config file.
本选项虽然使用了Web.config,但它的操作方式是将配置修改影响到所有的Web.config,而满足不了本题要求2所提的:支持对各个Web Application分别进行修改。所以也被排除。
因此本题答案应该选 B
参考
http://msdn.microsoft.com/zh-cn/library/bb861909(v=office.14).aspx
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spwebapplication.aspx
http://dsen-25.blogspot.com.au/2011/08/hierarchical-object-store-in-sharepoint.html
http://msdn.microsoft.com/zh-cn/library/bb677365(v=sql.105).aspx
Sharepoint学习笔记—习题系列--70-576习题解析 -(Q78-Q80)的更多相关文章
- Sharepoint学习笔记—ECM系列—文档列表的Metedata Navigation与Key Filter功能的实现
如果一个文档列表中存放了成百上千的文档,想要快速的找到你想要的还真不是件容易的事,Sharepoint提供了Metedata Navigation与Key Filter功能可以帮助我们快速的过滤和定位 ...
- Sharepoint学习笔记—ECM系列--文档集(Document Set)的实现
文档集是 SharePoint Server 2010 中的一项新功能,它使组织能够管理单个可交付文档或工作产品(可包含多个文档或文件).文档集是特殊类型的文件夹,它合并了唯一的文档集属性以及文件夹和 ...
- Sharepoint学习笔记—习题系列--70-576习题解析 --索引目录
Sharepoint学习笔记—习题系列--70-576习题解析 为便于查阅,这里整理并列出了70-576习题解析系列的所有问题,有些内容可能会在以后更新. 需要事先申明的是: 1. ...
- Sharepoint学习笔记—习题系列--70-573习题解析 --索引目录
Sharepoint学习笔记—习题系列--70-573习题解析 为便于查阅,这里整理并列出了我前面播客中的关于70-573习题解析系列的所有问题,有些内容可能会在以后更新, ...
- Deep Learning(深度学习)学习笔记整理系列之(五)
Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...
- Deep Learning(深度学习)学习笔记整理系列之(八)
Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...
- Deep Learning(深度学习)学习笔记整理系列之(七)
Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...
- Deep Learning(深度学习)学习笔记整理系列之(六)
Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...
- Deep Learning(深度学习)学习笔记整理系列之(四)
Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...
- Deep Learning(深度学习)学习笔记整理系列之(三)
Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...
随机推荐
- Android Activity返回键控制的两种方式
Android Activity返回键监听的两种方式 1.覆写Activity的OnBackPressed方法 官方解释: Called when the activity has detected ...
- Azure ARM (7) ARM Template - 使用Visual Studio编辑
<Windows Azure Platform 系列文章目录> 之前介绍的ARM Template,都是使用文本编辑器来编辑JSON文件的. 文本讲介绍如何使用Visual Studio, ...
- 基于HTML5的WebGL呈现A星算法3D可视化
http://www.hightopo.com/demo/astar/astar.html 最近搞个游戏遇到最短路径的常规游戏问题,一时起兴基于HT for Web写了个A*算法的WebGL 3D呈现 ...
- git gitignore文件失效处理
这里讲的是使用 git ignore 时候的一种特殊情况 正常你在本地给项目添加了一些文件之后,一般都会自动全部跟踪,但是在这个时候你必须编辑一个ignore文件,把一些不需要跟踪到文件ignor ...
- Auto Mapper04(MVC中的配置)
学习如何在MVC项目中配置AutoMapper. 一:首先在MVC项目中引用AutoMapper的DLL文件,接着创建一个接口,这里面我们需要定义两个方法,接口里面的方法只能定义不能实现,也没有什么修 ...
- 简单横道图Demo
代码(每个月都显示整月): @{ ViewBag.Title = "横道图"; Layout = "~/Views/Shared/_Layout.cshtml" ...
- xpath学习积累
"//comment()":“所有注释节点”
- C++移位运算符
关于逻辑移位.算术移位可参见迅雷深大笔试题部分.的一道题. 以前看到C++标准上说,移位运算符(<<.>>)出界时的行为并不确定: The behavior is undefi ...
- LCA---Tarjan算法
本问题中Tarjan算法不需要设置栈和dfn,low标号,而是设置了并查集. 通过一次dfs遍历即可找出所有节点对的lca.将这样一次读取所有查询,计算一次后返回所有查询lca的算法称为离线算法 涉及 ...
- 使用ASP.NET 4的自动启动特性,解决ASP.NET第一次访问速度慢问题
些web应用在可以处理用户访问之前,需要装载很多的数据,或做一些花费很大的初始化处理.今天使用 ASP.NET 的开发人员经常使用应用的Global.asax 文件中的 “Application_St ...