Is it possible to convert any .webpart file to a .dwp so that I would
- Export a .webpart file
- Convert it to .dwp file (add every property in dwp format)
- Import it back
Since .dwp
web part file corresponds to SharePoint-based web parts and .webpart
to ASP.NET web parts, web part file can not be converted without rebuilding web parts itself.
The set of features provided exclusively by Microsoft.SharePoint.WebPartPages.WebPart is as follows:
- Cross page connections
- Connections between Web Parts that are outside of a zone
- Client-side connections (Web Part Page Services Component)
- Data caching infrastructure, including the ability to cache to the database
An attempt to convert SharePoint-based web part file from version 2 (MSContentEditror.dwp):
<?xml version="1.0" encoding="utf-8"?>
<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
<Assembly>Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
<TypeName>Microsoft.SharePoint.WebPartPages.ContentEditorWebPart</TypeName>
<Title>Content Editor</Title>
<Description>Allows authors to enter rich text content.</Description>
<PartImageLarge>/_layouts/images/mscontl.gif</PartImageLarge>
</WebPart>
to version 3 (MSContentEditror.webpart):
<?xml version="1.0" encoding="utf-8"?>
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c,Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Title">Content Editor</property>
<property name="Description">Allows authors to enter rich text content.</property>
<property name="PartImageLarge">/_layouts/images/mscontl.gif</property>
</properties>
</data>
</webPart>
</webParts>
will give an error during adding web part on page.