Sharepoint学习笔记—习题系列--70-573习题解析 -(Q40-Q44)
Question 40
You need to send a single value from a consumer Web Part to a provider Web Part.
Which interface should you use?
A. IAlertNotifyHandler
B. IWebPartField
C. IWebPartParameters
D. IWebPartRow
解析:
本題的目的是在Webpart之間傳遞“單值”(single value)數(shù)據(jù)。
直接分析各選項(xiàng):
選項(xiàng)A. IalertNotifyHandler在 microsoft.sharepoint.dll 中,提供發(fā)送警報信息的相關(guān)方法。 例如可能通過IAlertNotifyHandler來自定義Alert Email。顯然此接口與WebPart之間的連接無關(guān)。更談不上還要在兩個Webpart之間傳遞“單值”數(shù)據(jù)了
選項(xiàng)B. IWebPartField 此接口用于在Web 部件控件之間實(shí)現(xiàn)根據(jù)數(shù)據(jù)字段的連接標(biāo)準(zhǔn)接口,即在它們之間傳遞“單值”數(shù)據(jù),正是本題想要的答案。
選項(xiàng)C. IwebPartParameters: 在 Web 部件連接中,數(shù)據(jù)通常從提供者發(fā)送至使用者。但在某些情況下,提供者需要使用者的參數(shù)來確定它應(yīng)發(fā)送回哪些值。IWebPartParameters 接口定義要實(shí)現(xiàn)的成員,這些成員有助于從使用者到提供者傳遞參數(shù)。也就是說,它是用來控件發(fā)送的數(shù)據(jù)的。
選項(xiàng)D. IwebPartRow 是一個提供者接口,用于實(shí)現(xiàn)Webpart之間傳遞” 數(shù)據(jù)行”
所以本題目正確選項(xiàng)應(yīng)該是B
參考:
http://msdn.microsoft.com/zh-cn/library/system.web.ui.webcontrols.webparts.iwebpartfield.aspx
?
Question 41
You need to connect two Web Parts by using the IWebPartRow interface.
Which method should you use?
A. DataItem
B. GetFieldValue
C. GetRowData
D. GetTableData
解析:
?本題是需要你判斷備選項(xiàng)中哪個是屬于IwebPartRow接口的方法。
A. DataItem 從字面上判斷也絕不是屬于”方法”的命名規(guī)范,至于它屬于哪個類的對象,搜索一下,也許你能找到許多答案,但絕不是本題的答案。
B. GetFieldValue. 屬于IwebPartField接口所包含的方法, 此接口用于在Web 部件控件之間實(shí)現(xiàn)根據(jù)數(shù)據(jù)字段的連接標(biāo)準(zhǔn)接口,即在它們之間傳遞“單值”數(shù)據(jù)
C. GetRowData 屬于IWebPartRow接口所包含的方法, IwebPartRow是一個提供者接口,用于實(shí)現(xiàn)Webpart之間傳遞” 數(shù)據(jù)行”
D. GetTableData 屬于IwebPartTable接口所包含的方法, 此接口用于實(shí)現(xiàn)在Webpart之間基于整個數(shù)據(jù)表的傳遞連接。
所以本題目正確選項(xiàng)應(yīng)該是C
參考:
http://msdn.microsoft.com/zh-cn/library/microsoft.sharepoint.webpartpages.communication.icellprovider.aspx
http://msdn.microsoft.com/zh-cn/library/dd586425(v=office.11).aspx
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.iwebpartrow.aspx
http://msdn.microsoft.com/zh-cn/library/system.web.ui.webcontrols.webparts.iwebpartrow(v=vs.80).aspx
http://msdn.microsoft.com/zh-cn/library/system.web.ui.webcontrols.webparts.iwebparttable.aspx
Question 42
You create a sandboxed solution that contains a Web Part.
You need to debug the Web Part by using Microsoft Visual Studio 2010.
To which process should you attach the debugger?
A. owstimer.exe
B. spucworkerprocess.exe
C. spucworkerprocessproxy.exe
D. w3wp.exe
解析:
?本題主要想考你Sandbox Solution的Debug方面的相關(guān)知識。
在Sharepoint的開發(fā)環(huán)境中調(diào)試不同的對象有時需要Attach到不同的進(jìn)程,下面就是一些常見的情況
?? 1、Farm Solution???? -----W3WP.EXE
?? 2、SandBox Solution?? -----PUCWorkerProcess.exe,( SharePoint 在一個獨(dú)立于主 IIS 應(yīng)用程序池 (w3wp.exe) 進(jìn)程的進(jìn)程 (SPUCWorkerProcess.exe) 中運(yùn)行沙盒解決方案代碼。所以你必須在SPUCWorkerProcess上進(jìn)行調(diào)試)
?? 3、用到了Full-trust Proxy的SandBox Solution--SPUCWorkerProcessProxy.exe
?? 4、feature receivers----Feature Receiver默認(rèn)情況下是自動被Visual Studio 啟動。你可以在Visual Studio的部署設(shè)置中更改這種設(shè)置。
??????? 4.1、feature receivers的 activation/deactivation :根據(jù)它被activation/deactivation 的方式,你需要Attaching到不同的進(jìn)程。
???????????? ? 在web界面上啟動或停止----W2WP.EXE
???????????? ? 在PowerShell中啟動或停止---- PowerShell.exe
??????? 4.2、feature receivers的 FeatureInstalled/FeatureUninstalling/FeatureUpgrading(安裝/卸載/升級)----- owstimer.exe
所以本題目正確選項(xiàng)應(yīng)該是B
參考:
http://msdn.microsoft.com/zh-cn/library/ee231562.aspx
http://msdn.microsoft.com/en-us/library/ee231550.aspx
http://www.cnblogs.com/wsdj-ITtech/archive/2011/12/08/2258260.html
Question 43
You create a custom Web Part.
You need to create a class to log Web Part errors to the Unified Logging Service (ULS) logs.
What should you use?
A. the ILogger interface
B. the ILoggingProvider interface
C. the SPDiagnosticsServiceBase class
D. the SPPersistedObject class
解析:
?本題想要實(shí)現(xiàn)定義某個類,完成向ULS中寫入Error信息的功能。
每臺運(yùn)行 Windows SharePoint Services 3.0 和 Office SharePoint Server 2007 的服務(wù)器都會將日志記錄信息寫入 ULS 日志文件和服務(wù)器事件日志。在服務(wù)器場中每臺運(yùn)行 SharePoint 的服務(wù)器上的 {SharePoint Root}\LOGS 文件夾中找到的 ULS 日志文件可包含相當(dāng)多的信息,具體取決于診斷日志限制的配置情況。盡管通常情況下日志記錄越詳細(xì)越好,但在日志文件中查找特定項(xiàng)可能會有一定難度。
通過為每個日志項(xiàng)分配唯一性,SharePoint 2010 提高了查找特定日志項(xiàng)的效率。此唯一性(稱為相關(guān)令牌)是一個在出現(xiàn)錯誤時提供給用戶的 GUID。管理員或開發(fā)人員隨后可在錯誤中提取此 GUID 字符串,并使用它在日志文件中搜索特定項(xiàng)。這將加快在日志文件中查找項(xiàng)的速度以便跟蹤特定事件。
在 Windows SharePoint Services 3.0 中,寫入 SharePoint 跟蹤日志和統(tǒng)一日志記錄系統(tǒng) (ULS) 日志的唯一方法是實(shí)現(xiàn)在實(shí)現(xiàn)其他代碼時所需的 IDiagnosticsManager 接口。但在 SharePoint Foundation 中,首選方法是使用 SPDiagnosticsServiceBase 類,該類包含與 ULS 日志進(jìn)行交互的更簡單且更有效的方法,尤其是可輕松實(shí)現(xiàn)的 WriteEvent 和 WriteTrace 方法。所以選項(xiàng)C是本題的答案。
選項(xiàng)A. the ILogger interface 此接口是從 .NET Framework 2.0 版中開始新增的,用于定義代碼生成任務(wù)報告錯誤時使用的接口。它用于定義 MSBuild 記錄器,該記錄器訂閱生成系統(tǒng)事件。
選項(xiàng)B. the ILoggingProvider interface 此接口提供關(guān)于logging providers的通用功能定義。位于Microsoft.SharePoint.Administration命名空間,因此屬于Administration管理方面的范疇。此空間提供了管理Windows SharePoint Services deployment的相關(guān)類型和成員。
選項(xiàng)D. the SPPersistedObject class? 用于為對象提供自動序列化其狀態(tài)值并持久保存以及在需要時獲取前面所保存的值并反序列化的相關(guān)方法。也即,它屬于定義自定義管理設(shè)置方面的類。 在 Windows SharePoint Services 平臺上構(gòu)建應(yīng)用程序時,您可能需要創(chuàng)建一個類以定義應(yīng)用程序的自定義屬性設(shè)置并提供用于存儲這些設(shè)置的方法。Windows SharePoint Services 3.0 中的 Microsoft.SharePoint.Administration 命名空間引入了對象持久性,使用它可將派生自基礎(chǔ) SPPersistedObject 類的類保留到 Windows SharePoint Services 數(shù)據(jù)庫中。若要創(chuàng)建保留的對象,您可以創(chuàng)建一個類,該類從 SPPersistedObject 或派生自 SPPersistedObject 的 Microsoft.SharePoint.Administration 命名空間中的某個類繼承。此類可以定義一個用于存儲 Windows SharePoint Services 數(shù)據(jù)庫中的自定義屬性設(shè)置的對象模型。例如,您可以創(chuàng)建通過某種方式使用 Windows SharePoint Services 的 Windows 服務(wù),這將需要創(chuàng)建一個繼承自 SPWindowsService 類的類,以便存儲特定于 Windows 服務(wù)的設(shè)置。已編譯的 DLL 將為客戶提供一個可用于檢索或保存屬性的對象模型。Windows SharePoint Services 提供用于存儲設(shè)置的方法和位置,并管理它們對服務(wù)器場中的所有服務(wù)器和過程(包括緩存刷新)的可用性。
? 在實(shí)際使用中,我們也可用它來保存用戶的某些配置信息。
?
所以本題目正確選項(xiàng)應(yīng)該是C
參考:
http://msdn.microsoft.com/zh-cn/library/ee535240(v=office.14).aspx
http://blogs.msdn.com/b/sharepoint_cht/archive/2011/03/24/uls-2.aspx
http://msdn.microsoft.com/zh-cn/library/microsoft.servicemodel.domainservices.tools.ilogger(v=vs.91).aspx
http://msdn.microsoft.com/zh-cn/library/microsoft.sharepoint.administration.iloggingprovider.aspx
http://msdn.microsoft.com/zh-cn/library/gg512103(v=office.14).aspx
http://msdn.microsoft.com/zh-cn/library/bb861848(v=office.12).aspx
?
Question 44
You create a SharePoint farm solution that contains a Web Part.
You need to debug the Web Part by using Microsoft Visual Studio 2010.
To which process should you attach the debugger?
A. owstimer.exe
B. spucworkerprocess.exe
C. spucworkerprocessproxy.exe
D. w3wp.exe
解析:
?還是關(guān)于Sharepoint項(xiàng)目如何Debug的問題。
?參考Question 42
本題目正確選項(xiàng)應(yīng)該是D,因?yàn)镕arm Solution是運(yùn)行于Windows SharePoint Services 進(jìn)程 (w3wp.exe)上的。
參考:
http://msdn.microsoft.com/en-us/library/ff798425.aspx
http://msdn.microsoft.com/zh-cn/library/ee231550.aspx
?
轉(zhuǎn)載于:https://www.cnblogs.com/wsdj-ITtech/p/3137155.html
總結(jié)
以上是生活随笔為你收集整理的Sharepoint学习笔记—习题系列--70-573习题解析 -(Q40-Q44)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Visual Studio 2010 调
- 下一篇: 非常友好的PHP后台模板