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 ...
随机推荐
- 基于HT for Web的Web SCADA工控移动应用
在电力.油田燃气.供水管网等工业自动化领域Web SCADA的概念已经提出了多年,早先年的Web SCADA前端技术大部分还是基于Flex.Silverlight甚至Applet这样的重客户端方案,在 ...
- 『给它加个壳』纯MarkDown博客阅读体验优化
今天鼓捣了一天纯MarkDown书写的博客样式的美化,事实证明图表较多的MarkDown撰写的博文一样可以展现出非常漂亮的效果.为了让纯MarkDown书写的博客有一个干净舒服的阅读体验,我主要针对博 ...
- C#对图片文件的压缩、裁剪操作初探
在做项目时,对图片的处理,以前都采用在上传时,限制其大小的方式,这样带来诸多不便.毕竟网站运维人员不一定会对图片做处理,经常超出大小限制,即使会使用图片处理软件的,也由于个人水平方面原因,处理效果差强 ...
- WinPhone学习笔记(二)——页面外观剖析
上一个篇博文说了WinPhone页面内部的东西,现在介绍表面的东西,先来看看一下一个WinPhone页面 这个页面分了三部分:顶部这个是状态栏, 中间这个是一个页面的内容部分, 最下面则是应用程序栏 ...
- 分享一个递归无限级拼接Json的方法---ExtJs的TreePanel和TreeGrid均适用(Ef,Lambda,Linq,IQueryable,List)
话不多说,先上实体类,如果你不是codefirst,就把它当成数据表结构. 下面是底层BaseDal获取数据的方法 (如果你没有Base类,直接写在你的DAL层和BLL层) 下面是BaseServi ...
- 微信公众号入门学习1_使用C#,ASP.NET APIController如何公众号接入服务器并启动开发者模式
前言: 本文是以微信公众号中的订阅号(个人)来进行简单介绍,本人也是刚刚开始学习,有不足之处,欢迎批评指正. 先粘贴2个帮助链接: 入门指引:http://mp.weixin.qq.com/wiki ...
- EasyUI使用tree方法生成树形结构加载两次的问题
html代码中利用class声明了easyui-tree,导致easyUI解析class代码的时候先解析class声明中的easyui-tree这样组件就请求了一次url:然后又调用js初始化代码请求 ...
- Firemonkey TComboBox 下拉菜单字型修改方法 (D10)
在 FMX 下的 TComboBox 下拉菜单字型修改有二种方法: uses FMX.Pickers; 使用 Style,需先设定好 Style 后,再指定预设项的 Style,方法如下: proce ...
- mysql命令行基本操作
开启:打开电脑的“开始”菜单栏,找到“运行”,在运行框中直接输入:net start mysql.再 登录:Mysql -P 端口号 -h mysql主机名\ip -u root (用户) - ...
- final static 深度解析
function test(){ var a = b = 10; } test( ); alert(b); 由上一篇博客说起,最后输出的是10.引起歧义的原因是全局变量和局部变量的关系.顺着这个话题, ...