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

Question  147
 Your company has an existing SharePoint 2010 public-facing Web site. The Web site runs on multiple loadbalanced Web front-ends. Your company recently changed its name. You are asked to design a plan to update the Web site content to reflect the company name change. You need to accomplish this with a minimum amount of developer hours and minimum impact on users. Which approach should you recommend?
A. Create a Power Shell script to iterate through the site content and make the updates as needed.
B. Create a custom delegate control with the new company name and copy it to the \14\Config directory of all Web front-end servers. Perform an IISReset on each Web front-end server.
C. Create a custom application page with the new company name and copy it to the _layouts directory of all Web front-end servers.
D. Add a property in the web.config file to store the company name. Then update the master pages and page layouts to return the name from that property.html

解析:
 你公司有一个Sharepoint2010公共网站,此网站采用了若干个负载均衡的WFE服务器。你公司如今更改了公司名称,所以,你须要采用尽量少的开发以及减小尽量有的冲击来完成对网站内涉及到公司名称的内容的更改。你该如何操做呢?
  咱们知道,只要重启了IIS,那么Sharepoint网站就会暂时停运,用户就会访问不到Sharepoint网站,这样的冲击确定不是本题所要的。而选项B与选项D均须要重启IIS。其中选项D虽然是修改了Web.config文件,但咱们知道,要想使此文件的修改生效,每每就须要重启IIS。因此选项B.D能够直接排除。
  而选项C则试图经过建立一个新应用程序页面来解决本题的问题,这显然是两码事,本题主要是想要你修改已经存在的网站内容,而非使用新的公司名称建立新内容。因此选项C也应被排除。
  选项A,能够经过PowerShell代码段来遍历Sharepoint内对象并做相应的更改,又不用重启IIS。
所以本题答案应该选  A前端

参考 
http://msdn.microsoft.com/en-us/library/ee536539(v=office.14).aspx
http://msdn.microsoft.com/en-us/library/aa979592(v=office.14).aspxweb

 

Question  148
 You have a public-facing SharePoint 2010 site. The site resides on two Web front-ends that are not load balanced. You are asked to design an update for a Web Part to the site. The update requires modifications to the code in the global assembly cache (GAC). You need to design the update with minimal impact to users who are accessing the site. Which approach should you recommend?
A. Deploy the update directly to the GAC. Perform an IISReset on each Web front-end.
B. Deploy the update directly to the GAC. Recycle the application pool for the SharePoint site on each Web frontend.
C. Deploy the update within a custom Microsoft Windows Installer package that copies the code into the GAC and performs an IISReset on each Web front-end.
D. Deploy the update in a SharePoint solution file.服务器


解析:
   你公司有一个Sharepoint2010公共网站,此网站运行在两台未采用负载均衡的WFE服务器上。你如今须要升级网站内的某个Web Part,此升级涉及到对部署在GAC内的某个程序集代码的修改,并要求尽可能减小对网站的冲击,你该如何操做呢?
   咱们知道:负载均衡创建在现有网络结构之上,在负载均衡的思路下,多台服务器为对称方式,每台服务器都具备同等的地位,能够单独对外提供服务而无须其余服务器的辅助。经过负载分担技术,将外部发送来的请求按必定规则分配到对称结构中的某一台服务器上,而接收到请求的服务器都独立回应客户机的请求。经过应用负载均衡技术,使应用服务超过了一台服务器只能为有限用户提供服务的限制,能够利用多台服务器同时为大量用户提供服务。当某台服务器出现故障时,负载均衡服务器会自动进行检测并中止将服务请求分发至该服务器,而由其余工做正常的服务器继续提供服务,从而保证了服务的可靠性。【也就是说,这里所描述的状况在本题就没法产生做用了,咱们必需要人为介入去下降Web Part的升级对各个WFE服务器的冲击】
首先,若是采用IISReset的操做,那么就会形成整个Sharepoint网站中止服务。这是由于,IISReset会强制中止全部的进程并从新启动它们,经过这种方式以保证全部的更改都在从新启动后生效。固然,这种冲击是最大的,因此能够直接排除选项A.C。
    至于应用程序池回收(Recycle the application pool),咱们知道应用程序池是将一个或多个应用程序连接到一个或多个工做进程集合的配置。由于应用程序池中的应用程序与其余应用程序被工做进程边界分隔,因此某个应用程序池中的应用程序不会受到其余应用程序池中应用程序所产生的问题的影响。Sharepoint网站是基于Web Application的,而Web Application是运行在Application Pool的。若是回收程序池,系统就会开启一个新的进程,而新版本的DLLs就会从GAC中从新加载【针对本题就意味着新版本的Web Part的程序集从新加载】。 因此,选项B是本题正解。
至于选项D.开发并部署Sharepoint解决方案。咱们知道,这种方法也会从新启动IIS,因此也被排除。下面是Sharepoint场解决方案部署步骤的详细信息:
服务器场解决方案的部署步骤将建立一个计时器做业。此计时器做业由服务器场中的每台 Web 服务器上的计时器服务使用。此计时器做业还使用 SharePoint Foundation 管理 Web 服务来访问相应权限以将解决方案文件部署到每台计算机,所以全部服务器上必须同时运行这两项服务,部署才能成功。首先,分析包清单以查找程序集、应用程序页、JavaScript 以及其余不属于功能的文件。将这些项复制到清单中指定的位置。将功能中包含的全部文件复制到 Feature 目录(%ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\FEATURES 的子目录)。在将解决方案文件复制到目标计算机后,将为全部前端 Web 服务器安排配置重置;以后,重置过程将部署文件并从新启动 Microsoft Internet Information Services (IIS)【此处是相关描述】。服务器场管理员可指定执行此操做的时间。最后,注册服务器场解决方案功能,并将架构和定义文件提交到配置存储区。网络

所以本题答案应该选 B 架构

参考 
http://www.51testing.com/?uid-43726-action-viewspace-itemid-92693
http://blogs.msdn.com/b/dtaylor/archive/2011/02/23/sharepoint-2010-service-application-load-balancer.aspx
http://msdn.microsoft.com/zh-cn/library/ms525803(v=vs.90).aspx
http://msdn.microsoft.com/zh-cn/library/aa544500(office.14).aspxapp


Question  149
 You have multiple SharePoint 2010 sites based on the same site definition. You need to plan a strategy to update the property value for a Web Part specified in the site definition for all existing sites. You must accomplish this with a minimum of developer hours. Which strategy should you recommend?
A. Update the site definition to specify the new property for the Web Part and deploy it through a feature to each of the sites.
B. Create a delegate control with the updated value and deploy it through a feature to each of the sites.
C. Copy an update to the Web Part into the global assembly cache (GAC) and perform an IISReset.
D. Use a Power Shell script to iterate through the sites and update the property.负载均衡


解析:
  你基于某个网站定义建立了若干个Sharepoint网站,你如今想要对网站定义内的某个Web Part的属性值进行更改,并将此更改应用到全部的相关网站,要求尽可能少的开发工做,你该如何操做呢?
  首先,咱们知道,若是根据网站定义建立了网站,你一般就不能再经过修改网站定义来更改那些已经建立的网站了。Sharepoint提供了Feature Stapling来在不修改原有网站定义的状况下对已存在的网站进行功能扩充,但经过此方式就须要建立项目并进行开发了。然而因为本题仅涉及Web Part的属性更改,没涉及其功能的升级,因此咱们就能够借助PowerShell来作到这点。下面是样例代码:frontend

$site = Get-SPSite "SiteCollectionURL"
$webcoll = $site.AllWebs
 #Step through each web in site collection
foreach ($web in $webcoll) {
#Get the root folder
$folder = $web.RootFolder
#Get the welcome page
$welcomepage = $folder.WelcomePage
$file = $web.GetFile("$welcomepage")
$file.CheckOut()
$wpm = $web.GetLimitedWebPartManager("$welcomepage", [System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)
foreach($webpart in $wpm.WebParts){
            if($webpart.MyUniqueProperty){
if(!$webpart. MyUniqueProperty){
$webpart. MyUniqueProperty = $ MyUniquePropertyValue(Value which need to be Set/Update)
                                    $wpm.SaveChanges($webpart)
}#First If
}#Second If
}#Foreach
$file.CheckIn("Updated/Set property of webpart",1)
            $file.Publish("Updated/Set property of webpart")
            $site.Dispose()           
}#foreach

因此,选项D是本题的正解。
选项A.从新升级网站定义。这方法咱们在前面已经予以了否认。
选项B.建立Delegate Control做用不到你自行开发的Web Part部件,更别说还须要代码开发了。
选项C.经过代码升级Web Part是须要建立解决方案并部署的,不能直接采起像本选项这样的操做,并且仅仅更改Web Part的属性彷佛用不着那么大的动静。
所以本题答案应该选 D ide

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

 

Question  150
 You have an existing SharePoint 2010 solution consisting of custom Web Parts deployed to the global assembly cache (GAC). The signing key used for the Web Parts has recently changed. You need to design an update to the Web Parts without any change to the value settings of their properties. Which approach should you recommend?
A. Deploy the changes within a SharePoint solution.
B. Copy the changes directly to the GAC and perform an IISReset.
C. Programmatically copy the information from the existing Web Parts to their new versions and then remove the old instances.
D. Update the Web Parts through the Web Part gallery and select the Overwrite if file already exists check box.


解析:
   你有一个Sharepoint2010解决方案,此方案包含一些部署在GAC中的Web Part,如今,这些Web Parts的signing key发生了改变,你须要升级这些Web Parts而无需经过改变它们的属性作到这点,你该如何操做呢?
   咱们已经知道,WebPart就是组成网页(Web)的部件(Part),它是SharePoint站点WebPartPage的基本构建块。在SharePoint网站的页面上,数据的显示、数据的编辑,都是经过一个一个的WebPart来完成的;实质上,WebPart是ASP.NET自定义控件,都是由一个WebPart说明文件(.dwp)和WebPart程序集(.dll)组成。
   因为本题已经指出: “此方案包含一些部署在GAC中的Web Part,如今,这些Web Parts的程序集签名(signing key)发生了改变”。也就是说,此时的Web Part程序集已经再也不是原来的程序集了,你实质上是新建了一个程序集来升级你的Web Part。而题目要求你: “你须要升级这些Web Parts而无需经过改变它们的属性作到这点”, 咱们知道,在Web Part的.webpart文件中定义了其相关的属性信息,因此,咱们就须要把这些信息拷贝到新的WebPart项目中来。
   作完上述工做并部署了新的Web Part程序集后,你会发现,Sharepoint系统仍旧使用的是旧的Web Part,你并未升级它们。这是由于,这种操做并非某种意味上的”升级”。因为使用了新的签名的程序集,老的程序集仍然存在,而且Sharepoint系统中已经建立的Web Part仍旧使用并仍旧能够成功的找到老的Web Part程序集。因此即便你部署了新的Web Part程序集,老的Web Part仍旧没有改变。
   所以,你只有删除这些老的Web Part,而后再依据新的Web Part功能来建立新的Web Part实例,但因为拷贝了原来的Web Part的相关信息,因此新版本Web Part实例的相关属性信息仍是原来的样子。 因此,只有选项C正确描述了这样的操做。
   选项A. 这句话等于没说,咱们原本就是要经过解决方案来部署咱们的更改。
   选项B. 彻底是混淆描述,你怎么能直接到GAC的程序集中拷贝所做的更改呢?全部的更改应该是在解决方案中完成,而后再编译并部署到GAC中。
   选项D. 咱们知道,只有Web Part的描述信息能够上载到Web Part Gallery,而Web Part的功能实现是在程序集,因此,本选项的操做其实并没实现本题的要求。
所以本题答案应该选 C

参考 
http://msdn.microsoft.com/en-us/library/ee231579.aspx
http://msdn.microsoft.com/en-us/library/dd583149(v=office.11).aspx


Question  151
 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.功能A为全部的网站集提供一个列表定义
 要求2.功能B基于要求1中的列表定义在其所被部署和激活的网站上建立列表实例
 你该如何操做呢?
首先,根据要求1,功能A属于网站集级别。
其次,因为功能B是依赖于功能A,用于建立具体的网站实例,因此功能B的级别属于具体的Web,且依赖于功能A。在全部备选项中只有选项C符合这样的逻辑。
所以本题答案应该选 C 
参考 
http://msdn.microsoft.com/zh-cn/library/aa543162(v=office.14).aspx

相关文章
相关标签/搜索