Showing posts with label Sharepoint Tools. Show all posts
Showing posts with label Sharepoint Tools. Show all posts

Monday, June 22, 2009

SPSource: Reverse engineering tool for SharePoint

SPSource is a tool for SharePoint developers to assist in the creation of WSS Solution Packages (WSPs) allowing for the use SharePoint Designer and the SharePoint web UI to make quick changes to items, then push those items into Visual Studio for later compilation into a WSP.

Some examples of what can be done using SPSource:
  • Completely define a custom Publishing Feature using SPD and the SharePoint UI, creating the master pages, page layouts, content types, style sheets, and images directly in the content database. Once at a point where it's ready for deployment, run SPSource against the project and pull everything into a pre-existing WSP. If changes are needed in the markup, make them using SPD, and re-run SPSource. The files in the WSP will be updated and ready for a solution upgrade.
  • Implement a class on an ASPX page (code behind) in SPD, and code that class in Visual Studio, or add custom server controls to the markup in SPD. Push your assembly directly to the GAC or bin as part of the build process, and the code-to-test time is much faster, as the markup files are already in the content database. Once everything is set, run SPSource again the project, and pull everything together into the WSP.
  • Add a custom Content Query Web Part (CQWP) .webpart file to the web part gallery, and change the properties and settings for the new CQWP via the UI and SPD to use custom XSL files that you add to the Style Library/XSL Style Sheets folder. Create new ItemStyles, change the Headers, or add new parameters to the Main XSL. The XSL files can be updated quickly using SPD, and changes can be seen right away. When all is ready for integration into the WSP, execute SPSource against the new files and create a new Feature for the new web part in minutes.
  • Create a complex List instance with Content Types and related Site Columns and reverse the whole lot out to a Feature to deployed to another environment as a Solution Package (wsp) using your favourite tool: VSeWSS, WSPBuilder or STSDev.
You can download it from here.

To use it you can make the following steps:

1. Create the following folder structure to mirror the 12 Hive folder structure:


2. Then create a folder for your Feature (which will deploy the List Template, Site Column and Content Type). For example at C:\temp\SPSource Demo\12\TEMPLATES\FEATURES\SPSourceDemoFeature.


3. Create a Feature.xml file

Create a Feature file at C:\temp\SPSource Demo\12\TEMPLATES\FEATURES\SPSourceDemoFeature\feature.xml file and place the default feature XML content in the file:

<Feature

Id="863BBC74-939E-4296-A538-931369C04433"

Title="SPSource Demo Feature"

Description=""

Version="1.0.0.0"

Scope="Site"

Hidden="False"

xmlns="http://schemas.microsoft.com/sharepoint/">

<ElementManifests>

</ElementManifests>

</Feature>


4. Create the .spsource file

Create a new .spsource file e.g. ‘C:\temp\SPSource Demo\12\TEMPLATES\FEATURES\SPSourceDemoFeature\lists.spsource’. The content of this file reflects the base schema for the Elements Manifest. So start with:


<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

</Elements>

Because we want to reverse engineer the Site Column, Content Type and List you will need two elements in here. One to point to the List and one to point to the Content Type.

NOTE: Any associated Site Columns on the Content Type will automatically be reverse engineered.


<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

<ListTemplate Name="Documents" />

<ContentType Name="Demo Document" />

</Elements>



5. Run SPSource

Now that you have set up the folder for SPSource to run, you now need to execute SPSource.

Open up a command prompt window and type:

Cd C:\temp\SPSource Demo

This will take you to the folder where you’ve created your files (if you chose a different name please adjust this).

Then simply type:

"C:\Program Files\SPSource \SPSource.exe" -designsite http://win-0xqbnqw37uf:41508/sites/DevDemo

NOTE: If you chose a different location for SPSource when you installed it you will have to modify this.

Friday, June 12, 2009

SharePoint 2007 Test Data Population Tool

Microsoft Office SharePoint Server Test Data Load Tool (MOSSDW.exe) is a tool that helps data population for MOSS deployments. It provides an XML based mechanism to populate multiple objects and associate XML tags to classes. It is available as a command line executable which accepts an XML file that specifies the objects to be populated.

The basic XML format for Microsoft Office SharePoint Server Test Data Load Tool is as follows:

<mossdwlib>
<object parameter="”value”">
<childobject parameter="value"></childobject>
</object>
</mossdwlib>

For example:


<mossdwlib>
<testportal>
<testarea num="5" urlname="PublishingWeb$num$"></testarea>
</testportal>
</mossdwlib>

This sample would create 5 web sites named PublishingWeb1 through PublishingWeb5 under the current portal site.

You can use a lot of nice features and options for this purpose. For a complete list you have to download the help for this tool.

You can download this tool from here.

BDC Meta Man - a time saver for integration

I've found a nice tool for generation of Application Definition files for BDC for SharePoint: BDC Meta Man. It is very easy to use and very efficient as you could see in the next video:



It knows to connect to SQL Server, Oracle, DB2, MySQL, InforMix, Web Services, Access or any ODBC connection. It knows even to get data from SAP (with the use of Sitrion).
For a deep dive into the BDC I recommend to you this book:

SharePoint 2007 Developer's Guide to Business Data Catalog.You can find a review for this book here.

Tuesday, February 17, 2009

A Remote Content Editor Web Part in your SharePoint applications

A very interesting article was written by Christophe (or better known as PathToSharePoint) about a nice creative idea: How to control the home page (or any page) from your every SharePoint web on your every SharePoint SiteCollection on your every SharePoint Application. Christophe found (and implement) the idea to control those pages with the help of the Control Editor Web Part. This control will be connected to a shared file (over the entire SharePoint farm) and just execute the script from that file in your browser, so you can send mass messages to users, you can customize the page remotely (adding links, removing things from it), you can implement a custom security (or logging) mechanism with it etc.
The next step with this control is to create an administrative tool to manage the content of that file (not all users have JavaScript, HTML, CSS and SharePoint skills) and to integrate with your solutions, so your power users will have real time control over it. 
Indeed, a very interesting idea.
You can find more about this, on his blog here.

Friday, January 30, 2009

SharePoint Dispose Checker Tool

A new must have tool has been released by Microsoft! This tool is called SharePoint Dispose Checker Tool. This tool analyzes your assemblies and helps to identify potential memory leaks. 
This tool was made to help you to check your assemblies that use the SharePoint API so that you can build better code. It provides assistance in correctly disposing of certain SharePoint objects to help you follow published best practice. This tool may not show all memory leaks in your code. 

Please review the MSDN article on using Deploy in SharePoint applications here.
The SPDisposeCheck tool can be downloaded here.
Roger Lamb maintains a nice blog for the SPDisposeCheck team here.

Monday, January 26, 2009

SharePoint Skinner

A great tool for customizing and branding a SharePoint Web Site or portal is SharePoint Skinner.
It is a desktop application which enables you to visual edit the css for your SharePoint and save it as a SharePoint Theme. It is very easy to use and very productive. You should read more about it on its tutorial here: http://www.elumenotion.com/Blog/Lists/Posts/Post.aspx?ID=4
You will find it on CodePlex too: http://www.codeplex.com/SP2007Skinner

JQuery with SharePoint

Monday, December 15, 2008

3D Silverlight Charts in SharePoint: SmartTools.Charts

An impressive library for charting was developed by Visifire(http://www.visifire.com/) a while ago. This library is using WPF and Silverlight to create very nice 3D charts (you can test a lot of charts here in this gallery: http://www.visifire.com/silverlight_charts_gallery.php). And, of course we can use them in SharePoint.
Jan Tielens made a new control in his SmartTools library, named SmartTools.Charts (you could find it here: http://www.codeplex.com/smarttools/Wiki/View.aspx?title=Charts&referringTitle=Home) to fulfill our needs to have nice looking charts in SharePoint.

To install and use the feature you should complete the following tasks:
1. First thing you have to do is to download the SmartTools.Charts from codeplex and install it on the site collection you need (it is build with the WSPBuilder so it has an installer for this task). 2. After you install it, you have to enable it at the site collection level. To do that, go in Site Collection features and enable SmartTools.Charts.
3. You are able now to add 2 new web parts:
a) List Charts - this web part connects to one list on your site and brings data from that list in the chart. You can specify here the list to connect to, the view to filter data and the columns to use in chart (as you could see in the picture below).



b) Tasks List Chart - a particular List Chart - it is linked with the Tasks List in the site to show the percentage of work for each task:



4. Enjoy it!

Remember that this tool is on Beta 1, so it might have some bugs out there.
Very good work Visifire for creating those charts and Jan for the SharePoint integration.

P.S. You should have Silverlight enabled in IIS for the site collection you want to put those charts. To do that, go in IIS and add the following MIME Types to the site where the SharePoint site collection is:

.xaml
application/xaml+xml

.xap
application/x-silverlight-app

.xbap
application/x-ms-xbap

Monday, November 24, 2008

Enable AJAX On SharePoint feature

I was searching for a tool to quickly enable AJAX on SharePoint site collections, but I was unable to find something like that, so I decided to create one. I named it Enable AJAX On SharePoint. This tool is just a feature on the site collection scope which make the appropriate modifications in the site collection web.config to enable AJAX.

You could find it here:


For deployment it is used WSPBuilder so you have to start the setup.exe file to install it. To use it just enable / disable the feature at the site collection level and the AJAX will be enabled / disabled for this scope.
This tool is free for any purpose.
If you have some improvements for it feel free to change it. I'll appreciate if you'll send me an email with the modifications (or request for modifications).

P.S. do not forget to rewrite (at the page level) the _spOriginalFormAction and _spSuppressFormOnSubmitWrapper in order to use AJAX in that aspx page. Just add this script on every page that uses AJAX (or in the masterpage file):

<script type="'text/javascript'">
_spOriginalFormAction = document.forms[0].action;
_spSuppressFormOnSubmitWrapper = true;
</script>


The code for this feature is here:


Enjoy it!

Friday, November 21, 2008

U2U CAML Query Builder Feature

This feature has been developed to ease the work of a SharePoint 2007 developer. It consists of an application page where you can build a CAML query. The CAML query itself is stored in a list from where you can further work with it. You can download it from here: http://www.u2u.be/res/Tools/SharePointCamlQueryBuilder.aspx


If you want to know more about CAML, please visit the following page: http://msdn.microsoft.com/en-us/library/ms462365.aspx


This tool is one of the several tools developed by U2U to ease the work with CAML Query. I like this tool most because is integrated in SharePoint and if you'd like to create a new CAML query you just have to activate this feature for the site collection you work on an a new link in any of your Action tab of your any list instance will appear: Build a new CAML Query. To build a new query just press this new option and you're ready to start.

A very intuitive page is used for this task - is very similar with the create a new view option for every SharePoint list: you can select the columns you want to have in the query, you can put an order by statement, you can filter the results and you can set some other more specific properties for the CAML query.

The last step to build a query is to Preview the results. Here you'll have options to export the CAML query to C#, VB.NET, CAML and the tool will generate the code for that:

You have even the option to select the returning type of the method it will generate: DataSet or SPListItemCollection and to preview the results as a table.
You just have to copy paste the code this tool will generate into your project and that's it - you have a new CAML query in your SharePoint solution.

Tuesday, November 18, 2008

Imtech StsAdm Commands v1.0.0.0 - OCDExportList

A nice to use tool is Imtech STSAdm Commands. When you'll install it you'll be able to use a custom command in stsadm: OCDExportList. This command is somehow the equivalent of SharePoint Solution Generator for exporting list definitions. I had some problems to use SharePoint Solution Generator (SSG) after I installed Visual Studio 2008, so I couldn’t use this tool any more. After a little search on the Internet a have found this tool and I've started to use it. I found that it is very easy to use and very light. With this tool I can export list definitions (after you customize them on SharePoint) and use them in my own content types (a very useful thing to do).
How to use it:
I created a bat file with the following content:

@SET STSADM="c:\program files\common files\microsoft shared\web server extensions\12\bin\stsadm"
@SET DEPLOY=D:\Projects\_Generated Code\
@SET URL="http://localhost"
@SET NAME=MyList
%STSADM% -o ocdexportlist -url %URL% -name "%NAME%" -dir "%DEPLOY%%NAME%"

This export the list definition file (schema.xml) and the appropriate list files (NewForm.aspx, EditForm.aspx, etc.) in the D:\Projects\_Generated Code\MyList folder. Then you just have to copy the entire folder in your solution in Visual Studio under your feature folder and you're ready to deploy it as a new content type.
The release for this tool is located here: http://www.codeplex.com/tmt/Release/ProjectReleases.aspx?ReleaseId=10875
Some other information about it is here: http://blog.mastykarz.nl/export-list-definition-free-stsadm-command/

Monday, November 17, 2008

WSPBuilder

WSPBuilder is a must have for every SharePoint Developer. You'll find it on CodePlex(http://www.codeplex.com/wspbuilder). I mostly use it as extension for Visual Studio 2008.
First of all you can use it to add new items in your SharePoint Solution. It have templates for the most common things you'll do in SharePoint:



When you'll use a template from it, WSPBuilder will populate your solution with the necessary files and folders and will make the appropriate configuration for the features to deploy the item you'd just add to the solution. So you just have to worry about the code behind the feature, the other nasty things(creation of folders and files and synchronization of the features) are taking care by the WSPBuilder.

And after you'll finish the development and you'll want to deploy your solution, nothing can be more simple: you just have to add a Solution Installer Configuration item from the templates WSPBuilder has and to configurate it (it is very simple to do that) and after that you just have to press a button and the WSPBuilder will make you a wsp solution and an installer for it and your Sharepoint solution is ready to be deployed (nice and easy). You just have to press Create Deployment Folder as shown below and a folder named deploy is created in your bin folder. In this folder you have an installer for your Sharepoint Solution and you can use it to install your solution to any server you'll want just by using a wizard (and of course you can distribute it to non SharePoint power users to install it on their servers).




As you could see in the image you have and other useful options you can use in your SharePoint Solution. You just have to right click on your project after you have installed WSPBuilder extensions for Visual Studio.
So on my opinion this tool is a must for every SharePoint developer.

SPSkin

A very good tool to create and edit SharePoint CSS is http://james.milne.com/SPSkin/. You just have to go at this page and load your existing CSS there (when you press CSS button) and after that you can modify it easily with the options you have in the left toolbar. This is very intuitive and it also have a lot of predefined skins for SharePoint (a few hundred). When you'll finish to customize the CSS there, you'll have to press the CSS button and to Copy / Paste it to your SharePoint. And that's it! You now have a brand new SharePoint skin!