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

Question  141
 You are planning an upgrade to a SharePoint 2010 application. You have the following requirements:
.Modify an existing workflow to include a new code activity.
.Ensure running instances of the workflow continue to work.
.Ensure new instances of the workflow include the modifications.
You need to plan the upgrade the application to meet these requirements. After the workflow code is modified, what should your plan specify?
A. Deploying the code to the global assembly cache (GAC) and deactivating the workflow feature.
B. Incrementing the version of the workflow assembly, deploying to the GAC, and activating the workflow feature.
C. Incrementing the version of the workflow assembly, deploying to the GAC, deactivating the workflow feature, and then activating the workflow feature.
D. Incrementing the version of the workflow assembly, deploying to the GAC, and modifying the appropriate workflow. xml file to reference the new version.


解析:
 你计划升级一个Sharepoint应用程序,需要满足如下要求:
 要求1.为一个已经存在的工作流添加一个新的代码活动
 要求2.保证那个已经使用的工作流实例的继续正常运行
 要求3.保证新的工作流实例包含了要求1中所作的修改
 你该如何操作以确保升级活动达到上述要求?
 由于本题要求“保证那个已经使用的工作流实例的继续正常运行”,所以你必须另外部署新Workflow的程序集。即” Incrementing the version of the workflow assembly, deploying to the GAC”,选项B.C.D前面部分的描述。而选项A则排除,因为部署到GAC中的是程序集(经过编译后的代码)而非代码。
  我们知道,每个工作流都具有一个工作流定义(workflow. xml)文件。此 XML 定义指定实际工作流程序集的标识、该程序集中的类以及工作流必须运行的任何工作流表单的位置。选项B.C均未对原来的工作的工作流定义(workflow. xml)文件进行修改,这样就达不到要求1,即必须要为已经存在的工作流添加一个新的代码活动。只有选项D,通过修改这个workflow.xml文件,把原来已经存在的工作流所依赖的工作流程序集的标识指向新创建的工作流程序集,从而达到本题的要求。
因此本题答案应该选 D

参考 
http://msdn.microsoft.com/zh-cn/library/ms434426(v=office.14).aspx
http://msdn.microsoft.com/en-us/library/ms414556(v=office.14).aspx
http://social.msdn.microsoft.com/Forums/en-US/6034c5d5-86b2-45dc-a9cc-4ebf4930668e/how-to-increment-the-version-of-my-workflow

 


Question  142
 You have a SharePoint 2010 application deployed in production. The application has a list with a single longrunning workflow named Version A. You design a new version of the workflow named VersionB. You have the following requirements:
.Existing instances of Version must continue to run until completed.
.VersionB must always be instantiated in the future.
.Version A must no longer be instantiated.
You need to design the solution to meet the requirements. Which approach should you recommend?
A. Disable the Start this workflow when a new item is created property in the Start Options of Version A.
B. Disable the Start this workflow when a new item is created property in the Start Options of VersionB.
C. Set the No New Instances property in the Remove Workflows settings of Version A.
D. Set the Optionally limit the number of versions to retain property in the Versioning Settings of the list.


解析:
  你开发部署了一个Sharepoint2010应用在生产环境,此应用包含了一个长期运行某个列表上的工作流,此工作流当前版本号为A,你准备开发此工作流的新版本B,并满足如下要求:
  要求1.已经运行的版本A必须继续运行,直到它执行完成
  要求2.升级后新创建的此工作流实例必须基于版本B创建
  要求3.版本B生效后,不再基于版本A创建新的工作流实例
 你该如何操作以满足上述要求呢?
  我们知道,通过将工作流与列表、文档库、内容类型或网站关联,可以添加工作流。通过取消工作流与列表、文档库、内容类型或网站的关联,可以移除工作流。或者,您可以阻止工作流的新实例启动,但仍允许所有正在运行的工作流实例完成。这正是本题所需要做的事情。
  下面是如何从列表或文档库移除工作流关联的具体步骤:
从列表或文档库移除工作流关联
1. 验证您是否拥有以下管理凭据:
    o 您必须是所配置的 SharePoint 网站上的 Site Owners 组的成员。
2. 通过浏览找到要从其中移除工作流的列表或库。
3. 执行下列操作之一:
   o 对于列表,在“列表工具”选项卡上单击“列表”。
   o 在“设置”组中,单击“列表设置”。
   o 对于库,在“库工具”选项卡上单击“库”。
   o 在“设置”组中,单击“库设置”。
4. 在“列表设置”或“库设置”页上的“权限和管理”部分,单击“工作流设置”。
5. 在“工作流设置”页上,单击“删除工作流”。
6. 在“删除工作流”页上,找到要移除的工作流并从以下选项中进行选择:
   o 选择“没有新实例(No New Instances)”以防止此工作流的新实例运行,但仍然允许正在运行的实例完成。【正是本题要求的效果,也只有选项C使用了此属性设置,所以选项C为本题的答案】
所有正在运行的工作流均完成后,您可以返回到此页以完全移除工作流关联。
   o 选择“移除”以防止此工作流的新实例运行并移除此工作流的所有实例。此选项将移除已在运行的实例。
7. 单击“确定”。
  选项A.B分别关闭自动启动工作流。与本题的要求没太大关系。
  选项D则涉及列表项(主要是文档库内文档的版本)的版本保存限制,与本题的工作流无关。所以也应该排除。
因此本题答案应该选 C

参考 
http://technet.microsoft.com/zh-cn/library/ee662537(v=office.14).aspx
http://technet.microsoft.com/zh-cn/library/ee662537(v=office.14).aspx
http://technet.microsoft.com/zh-cn/library/ee662540(v=office.14).aspx
http://office.microsoft.com/en-au/sharepoint-server-help/enable-and-configure-versioning-for-a-library-HA101853103.aspx

 

Question  143
 In your development environment, you designed new versions of a number of features currently working in a SharePoint 2010 farm. The features are being used throughout the farm at all scope levels. You need to meet the following requirements:
.All the features on the farm must be upgraded to the newest version.
.All existing feature instances must be upgraded to the latest version.
.The sites using the features must experience as little downtime as possible.
Which approach should you recommend?
A. Deploy all of the features as one solution package to the farm. Specify the new version number for each feature in the current Feature.xml file for the feature. Activate all of the new features at the farm level.
B. Deploy each of the features in its own solution package to the farm. Specify the new version number for each feature in the current Feature.xml file for the feature. Activate the new features only in the locations where they are currently activated.
C. Specify the new version number and any upgrade actions required in each of the Feature.xml files. Run Feature upgrade as a solution package on the farm.
D. Retract the existing versions of the features. Specify the new version number for each feature in a new Feature.xml file for each feature. Deploy the features as a new solution package. Activate the new features only in the locations where they are currently activated.


解析:
 你在开发环境中开发了几个新版本的功能,这些功能的老版本实例已经在生产环境中投入了应用,它们的应用层次是整个场内的任何层次(Web Application, Site Collection, Web, List….),你需要做到如下要求:
  要求1.所有功能都必须被升级到最新版本
  要求2.已经存在的各个层次的功能必须升级到最近的版本
  要求3.尽量减少功能停运时间
 本题涉及Sharepoint的功能升级,先来看看相关描述:
 在 Microsoft SharePoint Foundation 中,每个功能都具有一个在与其对应的 Feature.xml 文件中指定的版本号。在某个特定范围内激活一个功能时,会创建一个与该功能的版本关联的功能实例。利用 SharePoint Foundation 中的功能版本控制,可轻松跟踪功能及其关联实例。之后,当您部署新版本的功能时,SharePoint Foundation 检测到关联的功能也需要进行升级,因为功能实例的版本号小于当前的 Feature.xml 文件中指定的新版本号。
 在运行功能升级时,还会根据新 Feature.xml 文件中指定的升级操作对需要升级的功能实例进行升级。SharePoint Foundation 使用新的 QueryFeatures 方法(可应用于顶级对象,如 SPWebApplication 和 SPSite),基于功能实例的版本号来确定需要升级的功能实例。新 Feature.xml 文件中有一个部分,可用于指定将特定的功能实例从早期版本升级到最新版本所需的升级操作。升级基础结构会查询需要升级的功能实例集,然后升级其中的每个功能实例。此活动会涉及声明性升级操作和自定义升级代码。在 SharePoint Foundation 中,将跟踪每个功能实例的版本号。
按以下顺序依次升级功能:服务器场级别、Web 应用程序级别、网站集和特定网站。在网站级别,功能实例的升级顺序是:从根网站开始,然后按照子网站层次结构向下进行升级。将基于依赖性的顺序升级功能,也就是说,在升级功能之前,先升级这些功能所依赖的功能。
当升级期间出现错误时,升级将在指定的功能实例处停止,并在 ULS 日志和 Upgrade.log 文件中记录该错误。(通常,ULS 日志包含有关该错误的详细信息)。同时,继续对其他功能实例进行升级。在完成初始升级后并在重新启动此过程之前,管理员有机会发现并解决导致功能无法升级的问题。之后,当重新启动升级过程时,SharePoint Foundation 会对初次升级失败的功能重复所有升级操作,以便对所有功能和功能实例成功完成升级过程。
   Feature.xml 文件中新增的 <UpgradeActions> 节指定可应用于指定功能的升级操作。
可以将 <UpgradeActions> 节放置在 Feature.xml 文件的开头或末尾,使其位于 <Feature> 元素的内容中。通过该节,您可以为不同的升级范围指定升级操作,并且可以包含应用于指定范围的升级操作列表。升级定义始终将功能升级到 <Feature> 元素中声明的版本。
 下面我们来分析各备选项.
 选项A.把所有的功能都打包到一个解决方案中,并重新部署到场级别以及在场级别激活它们。这显然不符合本题描述:” 老版本实例已经在生产环境中投入了应用,它们的应用层次是整个场内的任何层次”。而且此方式也不会满组要求2。所以本选项被排除。
 选项B.重新开发针对各个功能的新版本功能的解决方案并部署到场。这种方式也并没有升级已运行的老版本,而仅是开发部署了新版本。且这种不断开发部署新解决方案的方法会频繁造成Sharepoint生产环境停运。所以选项B也应该被排除。
 选项C.通过开发功能升级解决方案包而不是重新开发新的功能解决方案包,这显然符合本题的要求。功能升级解决方案包就是用来完成Sharepoint功能升级的各种操作的。
 选项D.要收回已运行的旧版本的功能。这显然不符合要求2,即不能收回它们,而是升级它们。所以选项D排除。
  
因此本题答案应该选 C
参考 
http://msdn.microsoft.com/zh-cn/library/ee535723(v=office.14).aspx
http://msdn.microsoft.com/zh-cn/library/ee535708(v=office.14).aspx
http://msdn.microsoft.com/zh-cn/library/ee537575(v=office.14).aspx

posted @ 2014-08-29 12:17  wsdj  阅读(602)  评论(0编辑  收藏  举报