• .dwp和.webpart的区别


    .dwp和.webpart是用来描述web part的代码信息的文件的两个版本.

    它们两个的区别就在于.dwp是用于SharePoint V2中的, 而.webpart文件是用在SharePoint V3中的. 在文件的内部, schema也是不同的, 这种不同可以通过xmlns属性的版本号区别出来.

    这是.dwp(for v2)的一个例子.

    <WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
      <Assembly>Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
      <TypeName>Microsoft.SharePoint.Portal.WebControls.SearchBoxEx</TypeName>
      <Title>Search Box</Title>
      <Description>Used to search document and items.</Description>
      <FrameType>None</FrameType>
      <AllowMinimize>true</AllowMinimize>
      <AllowRemove>true</AllowRemove>
      <IsVisible>true</IsVisible>
      <Width>335px</Width>
      <GoImageUrl xmlns="urn:schemas-microsoft-com:SearchBoxEx">/_layouts/images/gosearch.gif</GoImageUrl>
      <GoImageUrlRTL  xmlns="urn:schemas-microsoft-com:SearchBoxEx">/_layouts/images/goRTL.gif</GoImageUrlRTL>
      <GoImageActiveUrl xmlns="urn:schemas-microsoft-com:SearchBoxEx">/_layouts/images/gosearch.gif</GoImageActiveUrl>
      <GoImageActiveUrlRTL  xmlns="urn:schemas-microsoft-com:SearchBoxEx">/_layouts/images/goRTL.gif</GoImageActiveUrlRTL>
    </WebPart>

     

    这是.webpart文件的一个例子, 有少许不同.

    <webParts>
      <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
        <metaData>
          <type name="Microsoft.SharePoint.Portal.WebControls.BusinessDataListWebPart, 
                Microsoft.SharePoint.Portal,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" />
          <importErrorMessage>Cannot import this web part.</importErrorMessage>
        </metaData>
        <data>
          <properties>
            <property name="Title" type="string">Business Data List</property>
            <property name="Description" type="string">Display a list of items from a data source in the Business Data Catalog.</property>
            <property name="CatalogIconImageUrl" type="string">/_layouts/images/bizdatawebpart.gif</property>
            <property name="CacheXslStorage" type="bool">true</property>
            <property name="CacheXslTimeOut" type="int">600</property>
          </properties>
        </data>
      </webPart>
    </webParts>

    主要的区别就是所有的web part的属性在v3中都通过property元素和一个name属性来指定. v2中的任何元素都有element name.

     

    你应该用哪一种呢? 应该是.webpart, 毕竟它是稍微新一点的v3. 然而, 使用v2也的确没有什么不对的地方, 尽管v2的这种格式将来可能会在新版本的SharePoint产品中移除掉. 事实上, 如果你看一眼web part gallery, 你会看到很多还在使用dwp的web part. 所以, 目前为止, 我们建议使用新版本的.webpart, 但是如果你更熟悉.dwp的话, 你也可以使用它的.

    来源:

    The difference between .dwp and .webpart

    http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/08/21/the-difference-between-dwp-and-webpart.aspx

  • 相关阅读:
    vue使用laydate.js插件报错laydate.css: Invalid
    自定义css样式结合js控制audio做音乐播放器
    福利福利~262集前端免费视频!
    解决Vue在IE中报错出现不支持=>等ES6语法和“Promise”未定义等问题
    设置Chart.js默认显示Point点的值不用鼠标经过才显示
    js监听某个元素高度变化来改变父级iframe的高度
    Vue中注意target和currentTarget的使用
    VUE中让由全局变量添加生成的新数组不随全局变量的变化而变化
    bootstrap-table前端实现多条件时间段查询数据
    js小数点相乘或相除出现多位数的问题
  • 原文地址:https://www.cnblogs.com/awpatp/p/1738678.html
Copyright © 2020-2023  润新知