SharePoint Module Extractor

 

The location for the Codeplex project is here.

 

After messing around a lot with the elements files to generate some pages I’ve created a small webpart that does all this stuff for you.

I’ve reused some code from this codeplex project and I’ve asked Stefan Stanev if I could re-use it. Also I’ve added some functionality.

The codeplex project of Stefan connects to SharePoint and if you go to the page via de program than you can right click and generate the elements.xml file.

Only the program doesn’t take into account connections between webparts. This and some other small adjustment I’ve added in my solution. So the elements file that you can generate via my webpart should be the most complete one representing the page.

I’ve shared the code with Stefan so that he can update his package, but I don’t know if he did this or not.

So the install is easy, it’s a WSP so install, deploy and put it on an webpart page (example called: admin.aspx).

How does it work?

You can add 3 values in the attributes:

  • Module path attribute
  • Module Url attribute
  • File path attribute

The example below shows you the filled in values

FilledinWPWithLogging

Than you select a document library and the second dropdown list will be filled with only .aspx files from the previous selected document library.

After this you can select the extension, the module file will be given the page name (instead of elements.xml , you’ll quickly lose overview than Smile ) and according the extension you can view it in the browser or you can just download the file and put it in your solution.

Lastly you need to select the way how you want the listviewwebparts be exported, it can either be a view tag, or an alluserswebparts tag. See examples below:

AfterElementsFile

ViewTag

ShortendProperties

or a full export without any changes is also possible.

If you click on export than, the elements file is being generated and put into a document library called “Elements” .

The location for the Codeplex project is here.

So you don’t need to keep yourself busy with typing all of this stuff. Just create the page in the UI and export the elements file via the Module Extractor Smile

Leave some comments if you find something wrong or if you just like it.

Leave a Reply

Your email address will not be published. Required fields are marked *