Sharepoint学习笔记—习题系列--70-576习题解析 -(Q75-Q77)
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)的更多相关文章
- 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 Studio1.4.x JNI开发基础 - 简单实例
接上一篇,搭建好基于Android Studio的环境之后,编写native代码相对来说也比较简单了.在Android上编写Native代码和在Linux编写C/C++代码还是有区别,Native代码 ...
- SQL中利用DMV进行数据库性能分析
相信朋友对SQL Server性能调优相关的知识或多或少都有一些了解.虽然说现在NOSQL相关的技术非常的火热,但是RMDB(关系型数据库)与NOSQL是并存的,并且适用在各种的项目中.在一般的企业级 ...
- Design Pattern: Not Just Mixin Pattern
Brief 从Mix-In模式到Mixin模式,中文常用翻译为“混入/织入模式”.单纯从名字上看不到多少端倪,而通过采用Mixin模式的jQuery.extend我们是否可以认为Mixin模式就是深拷 ...
- C# 日志的配置流程
1. 下载log4net.dll文件 http://download.csdn.net/detail/abc456456456456/7653857 2. 项目中引用此dll 3. appconfig ...
- Javascript权威指南
一.数字写法 3.14 2345.789 .333333333333333333 6.02e23 // 6.02 × 10 23 1.4738223E-32 // 1.4738223 × 10 −32 ...
- Lua使用心得(1)
这几天研究了一下lua,主要关注的是lua和vc之间的整合,把代码都写好放在VC宿主程序里,然后在lua里调用宿主程序的这些代码(或者叫接口.组件,随便你怎么叫),希望能用脚本来控制主程序的行为.这实 ...
- 获取 Chromium 源代码以及环境配置
一.获取代码 a) 不下载代码,直接浏览,到这里:http://src.chromium.org/viewvc/chrome/ 或者这里:http://code.google.com/p/chromi ...
- 使用PDF.JS在线查看PDF
过程简单粗暴. 第一步:下载源码https://github.com/mozilla/pdf.js 第二步:将源码拷贝进项目中,可以新建一个PDFShow文件夹存放代码 第三步:修改viewer.js ...
- Sublime搭建Python开发环境
print ('hello world!') 1. 下载python,并设置path系统环境变量:当在命令行中输入python,出现如下界面,显示安装成功. 2. 安装最新的sublime,使用注册机 ...
- Scalaz(21)-类型例证:Liskov and Leibniz - type evidence
Leskov,Leibniz,别扭的名字,是什么地干活?碰巧从scalaz源代码里发现了这么个东西:scalaz/BindSyntax.scala /** Wraps a value `self` a ...