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

Question 16
You are designing a SharePoint 2010 solution to manage statements of work. You need to design the solution according to the following requirements:
.Store the customer ID, purchase order number, estimated completion date, and other fields associated with specific documents as they are uploaded.
.The information must be created so that it can be set within the Microsoft Word document information panel.
.Programmatically execute a series of tasks, including assigning tasks to validate the information and creating team sites, based on information related to each document.
.These tasks must run to completion, even if the server is rebooted.
Which approach should you recommend?
A. Create a document library for a custom content type that contains site columns for the document information. Develop a SharePoint workflow for the document library to execute the document tasks.
B. Create a document library for a custom content type that contains site columns for the document information. Develop an event receiver for the document library to execute the document tasks.
C. Create a custom list with fields to store the additional items and an attached document. Develop a SharePoint workflow for the custom list to execute the additional tasks.
D. Create a custom list with fields to store the additional items and an attached document. Develop an event receiver for the custom list to execute the additional tasks.


解析:
  本题需要你设计一个管理工作有关说明的解决方案。方案要求满足如下条件:
要求1. 当上载某个文档时,同时需要保存与此文档相关的客户ID,订购编号,估计完成时间以及其它相关信息。[看完此要求,直接就想到文档的有关Meta Data]
要求2. 相关信息必须在Word文档的信息面板上创建。[这些信息其实就是前面提到的与此文档相关的各类信息]
要求3. 基于上载的文档,通过代码执行一系列任务,包括验证相关信息,创建工作组网站
要求4. 这些任务必须要完成,即使服务器重启了也不应影响它们的执行。
  首先,根据要求1,2:需要在文档的属性面板上创建相关信息,并自动保存这些信息,这项工作不能通过列表加附件来解决,因为这种方式提取不到作为附件的Word文档的诸多文档属性并保存到列表中[至少不是Sharepoint平台自动办到的],所以只能通过文档库方式解决。所以可以直接排除选项C.D。
  其次,对于要求4,只有工作流能满足,因为工作流可以保存任务执行的当前状态,即使服务器重启,这种状态也是不受影响的。而选项D通过事件接收器来执行相关任务则持久化保存任务执行的各种状态,所以不适合。
因此本题答案应该选 A

参考 
http://blogs.msdn.com/b/sharepoint_chs/archive/2010/11/26/introducing-document-management-in-sharepoint-2010.aspx


Question 17
You are designing a SharePoint 2010 solution. You need to design the solution to meet the following requirements:
.All sites must have a consistent structure when initially created.
.All sites must include a document library that contains Word documents with searchable properties.
.Site users must be able to generate a spreadsheet detailing the properties of the document library contents.
Which approach should you recommend?
A. Create a feature to create the required site structure programmatically. Create a content type for the document library. Create a custom workflow for the document library to allow users to generate the spreadsheet.
B. Create a feature to create the required site structure programmatically. Use feature stapling to associate the feature with all site definitions. Create a custom action for the standard document library to allow users to generate the spreadsheet.
C. Create a custom site definition for the sites and allow only that site definition to be used. Create a content type  for the document library. Create a custom action for the document library to allow users to generate the spreadsheet.
D. Create a custom site definition for the sites and allow only that site definition to be used. Create a content type for the document library. Create a custom event receiver to allow users to generate the spreadsheet.


解析:
 本题需要你设计一个解决方案,满足如下要求:
要求1. 所有的网站在创建时必须具有一致的结构 【每当题目提到此要求时,第一反应往往就是通过模板或定义去实现】
要求2. 所有的网站均包括一个Word文档库,此文档库的文档具有可供搜索的文档属性【看到此描述,第一反应就是文档的信息面板上的信息(Document Information Panel )】
要求3. 网站用户可以生成一个电子表格以显示文档的相关属性【貌似要通过其它功能去另外实现】
  首先,对于要求1,我们直接就可以排除选项A.B了,因为基于网站定义的方式去创建你场内的网站绝对是保持其一致性结构的好方法。事实上,我们可以开发用户自定义的网站定义并作为Feature部署到场中,在这种层面上,选项A.B在前半部分的描述仿佛也不算完全错误,但相对于选项C.D而言,选项C.D的描述更具体,更明确,直接指明了要通过网站定义去实现一创建网站的结构一致性。(另:在选项B中提到的feature stapling,即功能附加,用于向使用给定网站定义的网站的所有新实例附加功能,而不修改网站定义或创建代码例程以在每个网站上激活该功能。也称为功能网站模板关联。)
   接下来看要求2,其实就是要通过文档信息面板来创建文档属性,在文档管理系统中,用户经常(通常是在他们保存文档时)被要求提供文档的元数据(属性)。文档信息面板的设计目的是,让用户能够在处理文档的任何时候在一个位置同时指定有关该文档的所有属性。文档信息面板是一个表单,它显示在客户端应用程序中,其中包含用于文档元数据的字段。文档信息面板使用户能够根据需要随时输入有关文件的重要元数据,而不必离开客户端应用程序。对于存储在文档库中的文件,文档信息实际上是分配给该文件的内容类型的列【这句话就说明了,我们需要创建内容类型去保存文档相关属性,这也是选项C.D的第2句描述:Create a content type for the document library】。文档信息面板针对每个内容类型属性或列显示一个字段,用户可以编辑此类字段。
    然后是要求3,要求用户自己去决定是否创建一个电子表格以显示文档的相关属性。选项C.D之间的区别就在于是否提供了这样的能力。选项C是通过Custom Action途径去实现,我们知道
Custom Action就是用户自定义操作,它代表可以在工具栏或菜单中的放置的任何控件或菜单项,表示的是可供用户执行的某类操作。所以很明显,这应该是本题用户想要的,也即:实现获取文档属性并打开电子表格显示这样的操作,然后放到工具栏或菜单中由用户在需要要时随时调用这样的功能实现。至于选项D中的实现方式:通过event receiver,这种方式显然不是能由用户随时操控的,它决定的上述操作的激发时机只能是与文档列表或文档相关操作(eg:添加,修改,删除)发生时进行的,决定权不在用户。
因此本题答案应该选 C

参考 
http://msdn.microsoft.com/zh-cn/library/ms550037(v=office.14).aspx
http://msdn.microsoft.com/zh-cn/library/ee538686(v=office.14).aspx


Question 18 
 You are designing a SharePoint 2010 application. You need to ensure that a custom list named Phone Numbers is automatically created and added to the site whenever a new Team Site is created. Which approach should you recommend?
A. Create a feature that defines a Phone Numbers list template. Then activate the feature on the team site.
B. Create a feature that defines a Phone Numbers list template. Then use feature stapling to associate the feature with the site definition of the team site.
C. Create the custom Phone Numbers List Template element and add the List Template element to the onet.xml file of the team site.
D. Create the custom fields, views, and other specifications for the Phone Numbers list definition and add them to the schema.xml file.


解析:
  本题是想要实现:当任何时候创建一个Team Site时,附带的就要向这个新创建的Team Site中自动添加一个名为Phone Numbers的用户自定义列表。那么应该通过哪种方式来实现这样的场景呢?
  我们其实可以通过两种方式:1是创建一个Site Definition,在此Site Definition中包含我们想嵌入的列表定义。2.是通过feature stapling(功能附加):用于向使用给定网站定义的网站的所有新实例附加功能,而不修改网站定义或创建代码例程以在每个网站上激活该功能(这种激活是自动的)。也称为功能网站模板关联。功能附加是通过一项专门用于将其他功能附加到一个或多个网站定义的功能实现的。通过执行功能附加,可以将一项功能附加到通过任何网站定义或通过特定网站定义(基于在相应的 WEBTEMP.xml 文件中标识的模板名称)创建的任何新网站。
   下面我们来看看本题的各个备选项:
选项A : 如果不是提到要(automatically created and added:即自动创建与添加)的要求的话,本选项也不是不可的。由于实现不了自动处理,所以只能排除本选项。
选项B:通过功能附加方式,应该可以解决本题的需求。把需要包含的列表定义为一个功能,然后附加到指定的网站定义中去。
选项C:  在上面提到,通过创建一个网站定义也能解决本题的需求。但本选项的问题出在它试图把一个List Template直接添加到onet.xml文件中,这样操作是错误的,具体细节请参考我的博客系列( http://www.cnblogs.com/wsdj-ITtech/archive/2012/12/08/2734951.html)。正确的操作是把相关的列表定义创建成Feature,然后再到Onet.xml中去引用 。
选项D: 本选项也是不完整的,道理同选项C。 ListTemplate 元素用于指向某 List definition 的定义,这个定义包含在 Schema.xml 文件中,你在创建List实例时就会用到这个ListTemplate,而这个ListTemplate又指向了具体的某个List Definition。所以它们的关系是 List Instance-->List Template--->Schema.xml(定义了特定的List Definition)。因此,List Template起到了承上启下的作用,而Schema.xml 文件则包含了List Definition的定义, 这个Schema.xml是List Definition的基本组成文件,这个文档以Element元素作为根节点,其下包含的内容有:
.默认视图定义
.列表中的字段定义
.列表视图的工具栏定义
.内容类型声明 ContentType
.以及列表的其他元数据(eg:列表说明..)。
从内容上看,本选项是完成Schema.xml文件,但仅此还远远达不到定义列表模板,创建列表实例并且嵌入到网站定义的完整目的的。

因此本题答案应该选 B

参考 
http://msdn.microsoft.com/zh-cn/library/ff382738(v=office.12).aspx#odcwss2007taFeatureStapleFeatureStapling
http://msdn.microsoft.com/zh-cn/library/ms474369(v=office.14).aspx
http://msdn.microsoft.com/en-us/library/ms432370.aspx

posted @ 2013-09-09 17:40  wsdj  阅读(434)  评论(2编辑  收藏  举报