Question 124
You are designing a SharePoint 2010 application. You need to design a single feature that includes content types, fields, modules, and list instances. Which scope should you design?
A. Farm scoped
B. Site scoped
C. Web Application scoped
D. Web scopednode
解析:
你计划在建立的一个Sharepoint2010功能(Feature)中包含内容类型,字段,模块和列表实例等元素(Element),你应该采用哪一个做用域范围呢?
下表根据元素类型的做用域列出相应的元素类型。:服务器
Scope架构 |
Elementapp |
Web (Web site)ide |
Content Type网站 |
Content Type Bindingui |
|
Controlspa |
|
Custom Actioncode |
|
Custom Action Groupserver |
|
Custom View |
|
Event |
|
Field |
|
Hide Custom Action |
|
List Instance |
|
List Template |
|
Module |
|
Property Bag |
|
Workflow Actions |
|
Web Template |
|
Site (site collection) |
Content Type |
Content Type Binding |
|
Control |
|
Custom Action |
|
Custom Action Group |
|
Event |
|
Field |
|
Hide Custom Action |
|
List Instance |
|
List Template |
|
Module |
|
Property Bag |
|
Template Association |
|
Workflow |
|
Workflow Actions |
|
Workflow Association |
|
WebApplication (Web application) |
Control |
Custom Action |
|
Custom Action Group |
|
Document Converter |
|
Hide Custom Action |
|
Template Association |
|
Web Template |
|
Workflow Association |
|
Farm (farm) |
Control |
Custom Action |
|
Custom Action Group |
|
Hide Custom Action |
|
Template Association |
|
Workflow Association |
从上表看到Site Scope与Web Scope均包含了本题所描述的元素(content types, fields, modules, and list instances),但考虑到Feature定义的重用性,即若是部署到网站集(Site Scope)则其下的全部Web都可使用。因此相对而言 Site Scope更佳。
所以本题答案应该选 B
参考
http://msdn.microsoft.com/en-us/library/ms454835(v=office.14).aspx
http://msdn.microsoft.com/zh-cn/library/ms441146(v=office.14).aspx
Question 125
You are designing a SharePoint 2010 application. You need to provision a custom document converter for the application. Which scope should you design?
A. Farm scoped
B. Site scoped
C. Web scoped
D. Web Application scoped
解析:
你想要建立一个Custom Document Convert,你应该采用什么做用域范围?
参照Question124的表格,咱们能够直接定位选项D,即Web Application scoped。
所以本题答案应该选 D
参考
http://msdn.microsoft.com/en-us/library/ms454835(v=office.14).aspx
http://msdn.microsoft.com/zh-cn/library/ms441146(v=office.14).aspx
Question 126
You are designing a SharePoint 2010 intranet site for your company. Your design needs to meet the following requirements:
.A SharePoint feature (feature A) must make a custom list definition available for the entire site collection.
.Another SharePoint feature (feature B) must provision an instance of that custom list definition in the particular site where the feature is activated.
Which approach should you recommend?
A. Set the scope of feature A to Web and the scope of feature B to Site. Add feature A to the set of Activation Dependencies in feature B.
B. Set the scope of feature A to Web and the scope of feature B to Site. Add feature B to the set of Activation Dependencies in feature A.
C. Set the scope of feature A to Site and the scope of feature B to Web. Add feature A to the set of Activation Dependencies in feature B.
D. Set the scope of feature A to Site and the scope of feature B to Web. Add feature B to the set of Activation Dependencies in feature A.
解析:
你须要按照下面要求为公司建立一个Sharepoint2010内部网站:
要求1.Sharepoint功能A能够为整个网站集提供用户列表定义
要求2.Sharepoint功能B能够基于功能A中所建立的列表定义来在它所被激活的网站建立一个列表实例。
你该如何操做呢?
根据要求1,功能A应该是Site Scope, 根据要求2,功能 B应该是Web Scope,而且功能B依赖于功能A,根据这样的逻辑,直接能够定位到选项C。
所以本题答案应该选 C
参考
http://msdn.microsoft.com/en-us/library/aa543162(v=office.14).aspx
http://msdn.microsoft.com/en-us/library/ee231535.aspx
Question 127
You are designing a SharePoint 2010 feature that will be included in a solution package. You have added a feature receiver to your feature. You need to ensure that the code in the feature receiver executes when the solution package is deployed to the Web front-end servers. Which approach should you recommend?
A. Add your code to the Feature Installed method of the feature receiver.
B. Add your code to the Feature Activated method of the feature receiver.
C. Add a Feature Installed node referencing the feature receiver assembly to the solution manifest file.
D. Add a Feature Activated node referencing the feature receiver assembly to the solution manifest file.
解析:
你须要为一个解决方案包中所含的功能建立一个Feature Receiver,此Feature Receiver中包含的代码会在此解决方案包被部署到WFE服务器时被执行,该如何操做才能达到此效果呢?
本题涉及Feature Receiver的相关Events,咱们知道Sharepoint的功能事件接收器用于指定在功能的生存期中做为四个关键事件(Events)的一部分调用的服务器端代码例程:
本题要求在解决方案包被部署到WFE服务器时Feature被执行,应该属于A feature is installed事件,即Feature被安装好后当即执行,因此选项A正确。
选项B. A feature is activated功能都被激活了还用启动它吗?
选项C.D涉及Solution Manifest File,解决方案清单(一般称为 manifest.xml)存储在解决方案文件的根位置。此文件定义要处理的功能、网站定义、资源文件、Web 部件文件和程序集的列表。它不定义文件结构。若是文件包含在解决方案中,但未列在 manifest.xml 文件中,则不管如何都不会处理这些文件。在此文件的架构中,你能够找到FeatureManifests节点,但不存在Feature Installed与Feature Activated节点。因此选项C.D被排除。
所以本题答案应该选 A
参考
http://msdn.microsoft.com/zh-cn/library/ee231604.aspx
http://msdn.microsoft.com/zh-cn/library/ms442108.aspx