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. .NET Core中使用Razor模板引擎

    一.简介 在MVC以外的场景中,我们往往需要完成一些模板引擎生成代码或页面的工作:在以前我们一般常用的有Razor.NVeocity.VTemplate.虽然所有的模板系统都具有一些共同特征,但 Ra ...

  2. js观察者模式学习

    function Events(){ var obj = {}; this.on=function(key,fn){ var stack; stack = obj[key] || (obj[key] ...

  3. 在Winform开发中使用日程控件XtraScheduler(2)--深入理解数据的存储

    在上篇随笔<在Winform开发中使用日程控件XtraScheduler>中介绍了DevExpress的XtraScheduler日程控件的各种使用知识点,对于我们来说,日程控件不陌生,如 ...

  4. html5掷骰子的小demo

    代码如下: <!DOCTYPE> <html> <title>柯乐义</title> <head> <script> var l ...

  5. css3很美的蟠桃动画

    查看效果:http://hovertree.com/texiao/css3/26/ 源码下载:http://hovertree.com/h/bjaf/ndhxgfkn.htm 效果图如下: 代码如下: ...

  6. lua编译出so文件

    把lua编译出so文件 http://superuser.com/questions/557884/getting-error-recompile-with-fpic http://guiquanz. ...

  7. JAVA实现的微信扫描二维码支付

    吐槽一下 支付项目采用springMvc+Dubbo架构实现,只对外提供接口. 话说,为什么微信支付比支付宝来的晚了那么一点,一句话,那一阵挺忙的,然后就没有时间整理,最近做完支付宝支付,顺便也把微信 ...

  8. 第 19 章 CSS 其他样式

    学习要点: 1.颜色和透明度 2.盒子阴影和轮廓 3.光标样式 主讲教师:李炎恢 本章主要探讨 HTML5 中 CSS 其他剩下几个常用的样式,包括颜色.透明度.盒子的阴影轮廓以及光标的样式. 一.颜 ...

  9. Scalaz(5)- typeclass:my typeclass scalaz style-demo

    我们在上一篇讨论中介绍了一些基本的由scalaz提供的typeclass.这些基本typeclass主要的作用是通过操作符来保证类型安全,也就是在前期编译时就由compiler来发现错误.在这篇讨论中 ...

  10. python常用工具小函数-字符类型转换

    Python3有两种表示字符序列的类型:bytes和str.前者的实例包含原始的8位值就是的字节,每个字节有8个二进制位:后者的实例包含Unicode字符.把Unicode字符转成二进制数据最常见的编 ...