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