Sharepoint学习笔记—习题系列--70-576习题解析 -(Q25-Q28)

Question 25
You are designing a SharePoint 2010 farm in your organization. You need to design the library to meet the following requirements:
.The budget approval office needs a custom document library, which will send an e-mail as soon as each budget document is updated by a user.
.The SharePoint farm administrator wants to block the addition of any document that is larger than 100 MB and send out a message to users informing them of the failure. Which approach should you recommend?

A. Design the following event receivers:
.An asynchronous event receiver to send an e-mail after the document is updated
.A synchronous event receiver to display a warning message when a file is added that is larger than 100 MB
B. Design the following event receivers:
.A synchronous event receiver to send an e-mail after the document is updated
.An asynchronous event receiver to display a warning message when a file is added that is larger than 100 MB
C. Design a timer job to send the following:
.A batch of “budget document updated” e-mails at the end of each day
.A synchronous event receiver to display a warning message when a file is added that is larger than 100 MB
D. Design a service application to send the following:
.A batch of “budget document updated” e-mails at the end of each day
.A synchronous event receiver to display a warning message when a file is added that is larger than 100 MB


解析:
  本题需要你在组织机构内设计一个满足下列要求的文档库:
要求1. 预算审批部门有他们的文档库,当此文档库中的文档有任何更新时,需要尽快(as soon as )发送Email给相关人员。
要求2. 场管理人员需要阻止添加任何大于100MB的文档到文档库,并给用户发送Email通知其添加大文档失败。
  首先大致浏览一下备选项项,总共有三类实现方式:
  1、Event Receiver,应该是比较合理的方式
  2、Timer job, 此方式的主要问题是无法满足事件处理的实时性,如要求2中,当上传大文档时就需要马上拒绝并通知用户。
  3、Service Application服务应用程序,使用 Service Application Framework 的原因一般包括:
i. 提供专供多个 SharePoint Web 应用程序使用的计算和分析
ii 在网站和网站集之间共享数据,从而在承载方案的服务器场中提供应用程序的多个实例
iii 执行长期运行的操作
iv 使用 Service Application Framework 提供的常规管理和设置基础结构
服务应用程序无法挂接到文档库事件中,而且选项D中处理文档更新的方式也并不是即时性的,所以,此方式也应该被排除。
 接下来回到Event Receiver方式,选项A.B的主要区别在于理解同步(Synchronous)与异步(Asynchronous):在Sharepoint2010中,你可以设置event receivers为Synchronous或Asynchronous。所谓同步,就是Event Receiver在事件发生时立即执行相关动作,它运行在w3wp.exe进程中。而所谓异步,就是Event Receiver在事件发生时并不立即执行相关动作,而是由OWSTIMER.exe控件其动作的时机。
  在本题要求文档更新需要尽快[as soon as]发送Email,而针对大文档则要求”立即”[without any delay]处理,所以前者使用Asynchronous即可满足需要,而后者则必须需要Synchronous处理。

因此本题答案应该选 A

参考 
http://msdn.microsoft.com/zh-cn/library/ee536537(v=office.14).aspx
http://chakkaradeep.com/index.php/event-receivers-in-sharepoint-2010/


Question 26
 You are designing a solution on a SharePoint 2010 intranet site where administrative access to the SharePoint 2010 application server is not available. You need to ensure that site usage information is collected on search statistics for all the sites on the farm. Which approach should you recommend?
A. Create a Windows service and schedule it to collect the search statistics according to a specified schedule.
B. Create a SharePoint sandboxed solution to collect the search statistics.
C. Write a console application to collect search statistics. Create a timer job to run the application according to a specified schedule.
D. Write a console application to collect search statistics. Use Windows Task Scheduler to run the application at regular intervals.


解析:
  你在设计一个Sharepoint2010内网解决方案,你需要确保你能收集场内所有网站的使用情况统计信息,你应该采用哪种方式解决此问题呢?
  首先,这是基于Sharepoint平台环境的信息获取,你只可能依赖于Sharepoint提供的相关工具完成对其相关对象的信息统计与整合,因此,选项A中采用通过创建Window Service服务并结合Schedule制定来收集Sharepoint内部对象的信息的方式是根本行不通的。因为,首先Window Service服务是针对每台机器本身的环境的。其次,它无法去操控Sharepoint的环境对象,更别提汇集这些对象的相关信息了。
  其次,由于信息来自于场内的多个网站(集),所以,选项B采用依赖于Sandbox方式汇集信息的手段也不可能行得通。因为Sandbox是受限方案,它的活动空间往往就局限于它所部署的网站集内部,它是不能完成跨网站集操作的。所以,选项B也被排除。
  余下的就是选项C.D,这两个选项的共同点就是通过编写Console应用来收集相关信息,这是可行的。差异在于如何计划执行任务:其中选项D试图通过Windows的Task Scheduler来计划收集场内各网站的信息的统计任务。问题在于Windows的Task Scheduler是针对的本机的任务安排,它根本就作用不到Sharepoint场,而如何执行场内各网站集的信息收集的任务是基于场的环境来安排的内容,它是跨服务器的操作,所以选项D是错误的,而选项C则基于Sharepoint的Timer Job来计划任务的执行,这是完全没有问题的。
因此本题答案应该选 C

参考 
http://technet.microsoft.com/zh-cn/library/cc678870(v=office.14).aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/aa383614(v=vs.85).aspx


Question 27
You are using SharePoint 2010 to design a site at your company. All employees need to have permission to fill out a new form. When an employee submits the form, the request should be saved as an item in a custom list. You have the following requirements:
.For security reasons, employees must only be able to view their own requests.
.Employees must not be able to view requests that other employees have submitted.
.Company managers must have permission to view every request submitted.
Which approach should you recommend?
A. Create a new workflow that updates the owner of the list item to the username of the employee who submitted the form.
B. Create and schedule a SharePoint timer job that sets item level security on each item in the list.
C. Create an event receiver that sets the appropriate item level security. Add the event receiver to the Item Added event in the list.
D. Create an event receiver that sets the appropriate list level security. Add the event receiver to the Item Updated event in the list.

解析:
  本题是要你提供一个表单填报解决方案,公司员工填报的表单需要保存到列表中,此方案必须满足如下要求:
  要求1.2. 员工只允许看到他们自己填报的结果
  要求3.公司管理人员可以看到所有人的填报结果
  根据题干要求,本题需要控制的权限粒度应该是列表项级(Item-Level Permissions),所以首先排除选项D,因为它设置是List级的权限。然后是权限设置的时机,很明显,我们应该在员工填报完表单,即填报结果保存进指定列表后,进行对应列表项的权限设置,而能满足此要求的最好方式就是基于列表项的相关事件,所以应该是Item Added Event, 而只有选项C符合此要求。
  至于选项A. 通过工作流去更改List Item的Owner并不能控制List Item可见性。
  而选项B.通过计划时间任务去修改List Item的Permission则无法满足权限控制的”及时”性。
因此本题答案应该选 C

参考 
http://technet.microsoft.com/zh-cn/library/cc721640.aspx


Question 28
You manage your company’s SharePoint 2010 development efforts. Your company has hired an outside vendor to print its marketing materials. The head of the marketing department has asked you to design a plan to add functionality to the intranet site that will allow company employees to submit their print orders to a SharePoint list on the intranet site throughout the day. The vendor should receive a daily e-mail that shows them all the orders that were submitted to the intranet site the day before. Your plan needs to make this functionality possible. Which approach should you recommend?
A. Create a custom workflow that generates an e-mail with order details and sends it to the vendor. Attach the workflow to the list and configure it to execute each time an item is added to the list.
B. Create an event receiver that generates an e-mail with order details and sends it to the vendor. Attach the event receiver to the Item Adding event on the list.
C. Create an event receiver that generates an e-mail with order details and sends it to the vendor. Attach the event receiver to the Item Added event on the list.
D. Create a timer job that retrieves all the orders submitted to the SharePoint list, generates an e-mail containing the order information, and sends it to the vendor. Schedule the timer job to run each morning.


解析:
  本题题意:你所在的公司专门找了一家外面的公司帮助打印本公司的市场销售方面的资料,因此,公司销售部门的经理找到IT部门,需要你设计一个基于Sharepoint的解决方案,方案需要做的事情就是:本公司员工如果需要打印相关资料,就直接提交他们的打印请求,这些请求被保存在指定的Sharepoint列表中,而外面的那家公司则每天都会收到Email,其内容就是前一天所汇总的打印请求清单。
  根据题意,你可以判断此要求有个明显的特点,就是每天有个特定的任务即: 汇总打印请求并发送Email,具有典型的Timer Job特征,只有选项D使用了Timer Job。
  为确定我们的判断,我们还需要进一步分析其它备选项:
  选项A. 每提交一个新的打印请求(execute each time an item is added to the list)就需要执行指定的工作流任务,此任务负责汇总请求,创建并发送Email。很显然,选项A变更了任务的执行频率。所以应该排除。
  选项B.C 也与选项A类似,只不过是基于列表项的事件接收器中执行相关任务。也变更了任务的执行频率。
因此本题答案应该选 D

参考 
 

posted @ 2013-09-27 09:37  wsdj  阅读(457)  评论(0编辑  收藏  举报