Question 75
You are designing a feature for a SharePoint 2010 solution that will be activated by default in your site definition. The values for the configuration settings are based on the particular Web site on which the feature is activated. You have the following requirements:
.Setting the configuration values should not cause downtime.
.The configuration settings must be accessible by other features.
You need to design how the configuration settings will be stored. Which approach should you recommend?
A. Specify the configuration settings using the SPWebConfigModification object.
B. Specify the configuration settings in the property bag for the Web site.
C. Place the configuration settings in the web.config file.
D. Place the configuration settings in a list created by the site definition.

解析:
  你计划创建一个网站定义,此网站定义中包含一个Feature,此Feature默认的会被自动激活, 相关的配置值取决于Feature被激活时所在的网站,也即与网站对象相关联, 并且需要满足如下要求:
  要求1. 在设置配置值时不得造成业务活动的停止
  要求2. 配置值可以被其它功能访问到
  你需要考虑如何保存这些配置值。
  在SharePoint里有许多地方可以存放配置数据。对于SharePoint委托控件(DelegateControl),你可以使用Element manifest文件。对于WebPart,你可以使用.webpart文件。对于全局配置,你可以使用web.config,自定义SharePoint列表,或者SPFarm,SPWebApplication,SPSite,SPWeb和SPList上的属性包。
  首先,根据要求1:在设置配置值时不得造成业务活动的停止,我们可以排除任何关于Web.config的修改,因为任何对此文件的修改都需要重新启动应用才能生效,由此必然导致业务活动停止。所以选项A.C均可排除。
其次选项B. Property Bags, 这是一个存放键-值对配置信息的好地方,Sharepoint的以下层次的对象中均提供了对应的Property Bags。
a. Farm (SPFarm class)
b. Web application (SPWebApplication class)
c. Site collection (SPSite class)
d. Site (SPWeb class)
e. List (SPList class)
   我们可以找到与特定的Web Site对应的Property Bag,使用它来存储配置信息并供其它Feature访问。示例代码如下:
设置配置值
SPSite siteCollection = new SPSite("  ");
SPWeb website = mySite.RootWeb;
website.Properties.Add(" KeyName ", "KeyValue");
website.Properties.Update

读取配置值:
SPSite siteCollection = new SPSite("");
SPWeb website = mySite.RootWeb;
string MyValue = website.AllProperties["KeyName"]);
   所以Property Bag应该是本题的正选。
   至于选项D,把配置信息保存在网站定义所内含的列表中,把列表作为保存配置信息的方式也不是不可,但这种方式并非是基于特定的SPWeb对象,而是基于特定的SPList对象的信息保存方式,与本题的” The values for the configuration settings are based on the particular Web site”所要求的层次级别不符,所以应该被排除。
因此本题答案应该选 B

参考 
http://msdn.microsoft.com/zh-cn/library/gg491705.aspx
http://msdn.microsoft.com/zh-cn/library/ms414322(v=office.14).aspx
http://msdn.microsoft.com/zh-cn/library/gg491706(v=office.14).aspx

Question 76
You are designing a SharePoint 2010 solution. Site administrators do not have direct access to the file system on the Web servers. You need to design the solution according to following requirements:
.It must contain a set of Web Parts that receive information from a common collection of configuration data.
.Site administrators must be able to modify the configuration settings for individual sites using the standard SharePoint user interface. Which approach should you recommend?
A. Set the configuration data with the SPWebConfigModification object.
B. Set the configuration data with SharePoint persisted objects.
C. Set the configuration data in the property bag for each Web site.
D. Set the configuration data in a list on each site where the Web Parts are placed.

解析:
  你设计一个Sharepoint2010解决方案,网站管理员无权直接访问Web服务器上的文件系统,你的解决方案需要满足如下要求:
  要求1. 包含一组Web Parts,它们可以从普通的配置信息集中获取信息
  要求2. 网站管理员可以通过Sharepoint用户界面修改各个网站的配置数据。
  你应该采用哪种方法来实现需求。
   由于选项A.B.C均没有提供用户界面来修改相应的配置,而且也不属于普通的配置信息。
   其中选项A是使用 SharePoint Foundation 对象模型来修改 web.config 设置,而根据题干管理员无权直接访问Web服务器上的文件系统。
   选项B通过Persistent Object, 我们知道SPPersistedObject类是用于为对象提供自动序列化其状态值并持久保存以及在需要时获取前面所保存的值并反序列化的相关方法。也即,它属于定义自定义管理设置方面的类。在 Windows SharePoint Services 平台上构建应用程序时,您可能需要创建一个类以定义应用程序的自定义属性设置并提供用于存储这些设置的方法。很明显它不是普通的配置信息,也没有提供用户界面以供修改。
   选项C通过属性包,如我们前面所述,这是一个存放键-值对配置信息的好地方,Sharepoint对SPFarm,SPWebApplication,SPSite,SPWeb和SPList这几个层次的对象均提供了属性包,但我们并没有用户界面来修改它们。
    所以只剩下了选项D.通过保存在列表中的配置信息来达到本题要求。
  因此本题答案应该选 D

参考 
http://msdn.microsoft.com/zh-cn/library/microsoft.sharepoint.administration.sppersistedobject.aspx
http://msdn.microsoft.com/zh-cn/library/gg491706(v=office.14).aspx

Question 77
 You are designing a SharePoint 2010 application that connects to an external Microsoft SQL Server database. You have the following requirements:
.Server administrators can add and edit connection strings at the Web application level.
.SharePoint users must not be able to view or modify sensitive data in the connection strings.
.Server administrators can add or change the connection strings declaratively with no custom UI required.
.The connection strings can be modified programmatically without redeploying code.
You need to create a plan to store connection strings for the database within the SharePoint system. Which approach should you recommend?
A. Add or change the connection strings in the web.config file.
B. Use a hierarchical object store configuration approach to store the connection strings.
C. Use a property bag configuration approach to store the connection strings.
D. Use SharePoint lists to store the connection strings.

解析:
   你设计一个Sharepoint2010应用程序,需要连接到Sharepoint系统外部的SQL数据库, 并满足如下要求:
  要求1. 服务器管理员可以在Web Application级别添加,修改数据库连接字符串
  要求2. 必须禁止Sharepoint用户查看和修改连接字符串中的敏感数据
  要求3. 服务器管理员可以通过非定制界面添加或修改连接字符串
  要求4. 可以无需重新部署代码来以可编程方式修改连接字符串
   你需要考虑在Sharepoint系统内采取哪种方式来保存连接字符串以达到上述要求。
   首先根据要求4,我们可以排除选项B. C。其中选项B使用hierarchical object store ,所谓hierarchical object store是指你通过创建继承自SPPersistedObject类的对象类实例来保存关于Farm, Web applications, features等等层次的用户的配置信息。此方法适用于你需要保存比较复杂的对象时使用。而选项C则通过属性包,我们知道Sharepoint对SPFarm,SPWebApplication,SPSite,SPWeb和SPList这几个层次的对象均提供了属性包。不管怎样,选项B.C均需要通过代码编程来应用,而且它们也并没有提供用户界面来修改维护。
   其次,选项D,使用列表保存配置信息,这种方式很明显违背了要求2,因为Sharepiont用户是可以查看到列表信息的,而且它也不满足服务器管理员可以在Web Application级别添加,修改数据库连接字符串这个要求。
    至于选项A,满足本题所有的要求。
 因此本题答案应该选 A

参考 
http://msdn.microsoft.com/en-us/library/ff647766.aspx
http://msdn.microsoft.com/zh-cn/library/microsoft.sharepoint.administration.sppersistedobject.aspx
http://msdn.microsoft.com/en-au/library/ms460914(v=office.12).aspx

Sharepoint学习笔记—习题系列--70-576习题解析 -(Q75-Q77)的更多相关文章

  1. Sharepoint学习笔记—ECM系列—文档列表的Metedata Navigation与Key Filter功能的实现

    如果一个文档列表中存放了成百上千的文档,想要快速的找到你想要的还真不是件容易的事,Sharepoint提供了Metedata Navigation与Key Filter功能可以帮助我们快速的过滤和定位 ...

  2. Sharepoint学习笔记—ECM系列--文档集(Document Set)的实现

    文档集是 SharePoint Server 2010 中的一项新功能,它使组织能够管理单个可交付文档或工作产品(可包含多个文档或文件).文档集是特殊类型的文件夹,它合并了唯一的文档集属性以及文件夹和 ...

  3. Sharepoint学习笔记—习题系列--70-576习题解析 --索引目录

        Sharepoint学习笔记—习题系列--70-576习题解析  为便于查阅,这里整理并列出了70-576习题解析系列的所有问题,有些内容可能会在以后更新. 需要事先申明的是:     1. ...

  4. Sharepoint学习笔记—习题系列--70-573习题解析 --索引目录

                  Sharepoint学习笔记—习题系列--70-573习题解析 为便于查阅,这里整理并列出了我前面播客中的关于70-573习题解析系列的所有问题,有些内容可能会在以后更新, ...

  5. Deep Learning(深度学习)学习笔记整理系列之(五)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  6. Deep Learning(深度学习)学习笔记整理系列之(八)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  7. Deep Learning(深度学习)学习笔记整理系列之(七)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  8. Deep Learning(深度学习)学习笔记整理系列之(六)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  9. Deep Learning(深度学习)学习笔记整理系列之(四)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  10. Deep Learning(深度学习)学习笔记整理系列之(三)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

随机推荐

  1. 原生JS编写的照片墙效果实例演示特效

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  2. TextView显示html文件中的图片

    fromHtml还有另一个重构:fromHtml(String source, Html.ImageGetter imageGetter, Html.TagHandler tagHandler) 而I ...

  3. es6继承 vs js原生继承(es5)

    最近在看es2015的一些语法,最实用的应该就是继承这个新特性了.比如下面的代码: $(function(){ class Father{ constructor(name, age){ this.n ...

  4. JavaScript基础—插曲

    Javascript基础 1:js中我们最好使用单引号,其实可以使用双引号的但是为了区别所以js中全部使用单引号.注释和C#的是一样的.网页里面的执行顺序是从上到下依次执行的,不管你js放到哪里,都会 ...

  5. CSS基础-插曲

    CSS学习 1:通过css来设置边框的颜色 我们可以通过border:10px solid red;来统一的设置颜色,但是我们有的时候需要每个边框的颜色不一样,我们就需要通过各自设置的方法来设置边框的 ...

  6. SQL中 将同一个表中的A列更新到B列,B列更新到A列

    有网友在SKYPE问及,如标题,SQL中 将同一个表中的A列更新到B列,B列更新到A列. 其实这个不是问题,直接写更新语句即可,可以参考下面动画演示: SQL source code: CREATE ...

  7. 分享15个HTML5工具

    HTML5 Working Draft Specification HTML5 Working Draft Specification译为HTML 5工作草案标准,它是 HTML5 的最新草案,由 W ...

  8. line-height 属性

    p.small {line-height:90%} p.big {line-height:200%}     该属性会影响行框的布局.在应用到一个块级元素时,它定义了该元素中基线之间的最小距离而不是最 ...

  9. 深度技术32位Win7系统Ghost版2014年

    深度技术32位Win7系统Ghost版,GhostWin7是指使用Ghost软件做成压缩包的Windows7,俗称克隆版Win7.用克隆版的目的是节省安装时间.本作品在采用微软封装部署技术的基础上,结 ...

  10. Facebook的Hack语言三大看点

    Hack语言主要有三大看点:类型化.异步.集合. Hack最基础的特性就是类型标注.PHP5已经开始支持对象的类型化,PHP7也提供了标量类型化声明.Hack提供了全面的类型标注支持,与其typech ...