[转]Importing documents to Document Libraries with Mavention Import Document Library Contents(使用VS插件导出文档库内容定义)
2011-11-03 13:26
477 查看
Recently I showed you how you can import Lists and their data into your SharePoint Project using the Mavention Import List Instance extension. As you can imagine supporting list data is only half of the story, so to complete it another extension became available. Find out how to import documents from Document Libraries into your SharePoint project using Mavention Import Document Library Contents.
Last week we discussed how test data can help you test your SharePoint solutions and how you can import list data into your SharePoint Project for repeatable deployment. In my articles I covered only list data. However, as we all know, many SharePoint solutions include not only Lists but also Document Libraries and their data. So in order to be really productive you have to have a solution to cover both types of lists.
List Items and Files in Document Libraries are not quite the same from the deployment point of view. In order to provision List Items to a List you have to use the ListInstance element with all the data specified in the Data element. On the other hand to provision a document to a Document Library you have to use a Module and include not only the metadata but also the document itself.
After installing the extension a new option called Import Document Library Contents is added to the context menu of all Document Libraries in the Server Explorer.
![](http://blog.mastykarz.nl/images/Importing-Document-Libraries-contents-wi_B12F/01_thumb.png)
After you click the option the contents of the selected Document Library will be imported to your SharePoint Project.
Important: For this to work you have to have a SharePoint Project open and active in Visual Studio 2010.
During the import process, the extension will create in the active SharePoint Project a new Module called after the selected Document Library. All files will be downloaded and included in the project structured just as they were in the selected Document Library.
![](http://blog.mastykarz.nl/images/Importing-Document-Libraries-contents-wi_B12F/02.png)
Together with downloading the files and including them in the active SharePoint Project, the Mavention Import Document Library Contents extension will update the Element Manifest so that all files can be provisioned to a Document Library.
![](http://blog.mastykarz.nl/images/Importing-Document-Libraries-contents-wi_B12F/03_thumb.png)
The only thing left for you to do is to add the imported Module to a Feature and once you activate it, all files from the imported Module should be provisioned to SharePoint.
Tip: As you might have noticed the extension imports all files with all available properties. To keep the imported files clean you should remove all unnecessary files (such as List Forms) and properties. In my next post I will show you how you can modify the XSLT we used previously for cleaning List Instance data, to clean up unwanted document properties in a Module.
And this is it! Using the Mavention Import Document Library Content extension you can import Documents from a Document Library into you SharePoint Project with a single mouse click.
Download: Mavention Import Document Library Contents from Visual Studio Gallery.
Last week we discussed how test data can help you test your SharePoint solutions and how you can import list data into your SharePoint Project for repeatable deployment. In my articles I covered only list data. However, as we all know, many SharePoint solutions include not only Lists but also Document Libraries and their data. So in order to be really productive you have to have a solution to cover both types of lists.
List Items and Files in Document Libraries are not quite the same from the deployment point of view. In order to provision List Items to a List you have to use the ListInstance element with all the data specified in the Data element. On the other hand to provision a document to a Document Library you have to use a Module and include not only the metadata but also the document itself.
Importing documents into SharePoint Project with Mavention Import Document Library Contents
Mavention Import Document Library Contents is an extension for the Visual Studio 2010 SharePoint Developer Tools which is very similar to the Mavention Import List Instance extension I presented previously.After installing the extension a new option called Import Document Library Contents is added to the context menu of all Document Libraries in the Server Explorer.
![](http://blog.mastykarz.nl/images/Importing-Document-Libraries-contents-wi_B12F/01_thumb.png)
After you click the option the contents of the selected Document Library will be imported to your SharePoint Project.
Important: For this to work you have to have a SharePoint Project open and active in Visual Studio 2010.
During the import process, the extension will create in the active SharePoint Project a new Module called after the selected Document Library. All files will be downloaded and included in the project structured just as they were in the selected Document Library.
![](http://blog.mastykarz.nl/images/Importing-Document-Libraries-contents-wi_B12F/02.png)
Together with downloading the files and including them in the active SharePoint Project, the Mavention Import Document Library Contents extension will update the Element Manifest so that all files can be provisioned to a Document Library.
![](http://blog.mastykarz.nl/images/Importing-Document-Libraries-contents-wi_B12F/03_thumb.png)
The only thing left for you to do is to add the imported Module to a Feature and once you activate it, all files from the imported Module should be provisioned to SharePoint.
Tip: As you might have noticed the extension imports all files with all available properties. To keep the imported files clean you should remove all unnecessary files (such as List Forms) and properties. In my next post I will show you how you can modify the XSLT we used previously for cleaning List Instance data, to clean up unwanted document properties in a Module.
And this is it! Using the Mavention Import Document Library Content extension you can import Documents from a Document Library into you SharePoint Project with a single mouse click.
Download: Mavention Import Document Library Contents from Visual Studio Gallery.
相关文章推荐
- [转]Import List Instances and their data with Mavention Import List Instance(使用VS插件导出列表数据定义)
- #246 – 在文档中使用FlowDocument控件(Use FlowDocument Control to Host Entire Documents)
- Add a file to a Document Library and update metadata properties in a single method添加文档的方法
- android studio导入eclipse的library/ import libraries from eclipse to android studio
- Creating Your Own Document Management System With SharePoint 使用SharePoint创建你自己的文档管理系统
- 网页内容使用JS导出为word文档
- Spring STS 使用SVN插件时报 Failed to Load JavaHL Library 的错误
- 最近在使用MyEclipse的SVN插件时总是弹出一个大大的对话框,报一个Failed to load JavaHL Library.错误
- SharePoint 2013 Step by Step—— How to Upload Multiple Documents in Document Library
- SharePoint 2013 Step by Step—— How to Upload Multiple Documents in Document Library
- 最近在使用MyEclipse的SVN插件时总是弹出一个大大的对话框,报一个Failed to load JavaHL Library.错误 [java] view plaincopy Failed
- SPJS Upload for SharePoint: Custom upload page for uploading documents to various document libraries in a site collection
- SharePoint 2013 Step by Step—— How to Upload Multiple Documents in Document Library
- MyEclipse使用SVN插件报Failed to load JavaHL Library.错误解决方法
- Failed to load JavaHL Library.的解决——ubuntu下eclipse的svn插件使用javahl
- C# 不使用第三方插件导出XPS,PDF,图片文档
- Failed to load JavaHL Library.的解决——ubuntu下eclipse的svn插件使用javahl
- LINQ To XML:按文档定义的元素顺序显示元素InDocumentOrder
- #256 – 使用FixedDocument 在指定的地方显示内容(Use a FixedDocument to Display Content at Fixed Locations)
- How to Insert OLE Object (Adobe Acrobat Document) in Word with C#(如何使用C#在Word中插入OLE对象-PDF文件)