欧非资源网:安全、免费、专业放心的资源下载站! 最新软件|软件分类

您的位置:欧非资源网 > 其他专区 > SharePoint > Sharepoint 关于Element.xml中Ghostable与GhostableInLibrary属性设置

Sharepoint 关于Element.xml中Ghostable与GhostableInLibrary属性设置

时间:2020-01-15 21:59作者:admin来源:未知人气:275我要评论(0)

你可能在处理Sharepoint的element manifest file时会遇到File节中的Type属性的设置,此属性有两个可选项:Ghostable与GhostableInLibrary。 如果你不设置它,则默认的会为"Unghostable"。此属性的设置到底是什么意思呢?

复制代码
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/" >
  
<Module Name="WP_Stm_DataSync" List="113" Url="_catalogs/wp">
    
<File Path="WP_Stm_IntranetPatch_NexusDataSyncWP_Stm_DataSync.webpart" Url="WP_Stm_DataSync.webpart" Type="GhostableInLibrary">
      
<Property Name="Group" Value="Custom" />
    
</File>
  
</Module>
</Elements>
复制代码

  一、Ghostable与GhostableInLibrary:

     当你设置了它们时,此File就会在WFE(Web Front End服务器(WFE))的Cache中驻留,虽然都是驻留,但在处理方式上有差异

     1、如果你设置的值为GhostableInLibrary,则此File会被作为特定的List的Item来对待,所谓特定的List是指此List的Base Type是Document Library,所谓的对待方式就是你可以Check-in, Check-out,Version history等等Document Library List的Item应该具有的操作方式。

     2、而如果你设置的值为Ghostable,则此File只会被作为普通的List Item来对待。     

     而Cache的工作方式是,例如:你修改了Sharepoin某个页面的内容,Sharepoint要做的事情就是把修改前后发生变化的那部分及时保存到database中,下次再显示此页面时,就会把cache在WFE Memory中的原页面内容与从database中取出的变化部分进行整合,从而创建出修改后的页面内容然后呈现到客户端。
     你可以做一个测试,在Sharepiont网站中创建一个Custom List,此List不继承自Document Library,然后创建一个Item级的Feature,在其Element.xml中采用GhostableInLibrary设置,把此Feature
部署到你创建的Custom List中,你会发现在此Custom List中Items中你找不到你刚才部署的Feature,原因很简单,因为此Custom List不是Document Library类型的List,而其Item Feature的部署又采取的是针对
Documenty Library List类型的部署方式,所以就此产生了所谓的"Ghost" Item。如果把刚才创建的Feature修改为Ghostable方式,重新部署,你就会在你的Custom List中找到你部署的Feature了。

  二、而如果你不设置Type值,则其工作方式就是"Unghostable"

    即:此File不再Cache在WFE的Memory中,而是全部保存到database中,下次要呈现时,就全部从database中去取出来。

相关阅读 SharePoint中Office文件无法打开的解决方案如何快速生成SharePoint测试大文件如何查询SharePoint Library中空文件夹?如何快速备份SharePoint Farm Solution如何解决Event Viewer中SharePoint Error - Event ID 8321SharePoint 2016 CU安装失败,"Exception: The upgraded database schema doesn't match the TargetSchema"的解决方案InfoPath Error “此文档库已经被重命名或删除,或者网络问题导致文件无法保存…” 的解决方案SharePoint 2013 App概述How to Shrink SharePoint Content Database Log File?Project Web App Feature无法开启的解决方案

文章评论
发表评论

热门文章 SharePoint 2016 图文安装教程 后面有激活序列号、密钥分享[SharePoint入门教程]一SharePoint发展、工具及术语如何用 SharePoint Online创建团队网站?SharePoint Iframe 报错“此内容不能显示在一个框架中”

最新文章 SharePoint中Office文件无法打开的解决方案如何快速生成SharePoint测试大文件 如何查询SharePoint Library中空文件夹?如何快速备份SharePoint Farm Solution如何解决Event Viewer中SharePoint Error - Event ID 8321SharePoint 2016 CU安装失败,"Exception: The upgraded database s

人气排行 SharePoint 2016 图文安装教程 后面有激活序列号、密钥分享[SharePoint入门教程]一SharePoint发展、工具及术语如何用 SharePoint Online创建团队网站?SharePoint Iframe 报错“此内容不能显示在一个框架中”SharePoint 2013 安装图解 SharePoint安装步骤图解教程SharePoint 如何开启访问请求[SharePoint入门教程]一SharePoint概述[SharePoint入门教程]一创建SharePoint母版页

盖楼回复X

(您的评论需要经过审核才能显示)