Tuesday, November 25, 2008

Free MSDN Webcasts & HOLs for MOSS 2007 WCM Development

Microsoft is pushing out a new series of webcasts and hands-on labs around the area of building MOSS 2007 WCM Publishing sites. The series, SharePoint Products & Technologies for Internet Site Development, starts on December 2, 2008 and runs through January 6, 2009. Everything is completely free!
In time, all the materials, as well as the sample site, will be available for download.

Here's a list of the webcasts, the topics and the dates with registration links:

Unit testing Microsoft SharePoint

Typemock announce the Isolator for sharepoint. It is almost the same as Typemock Isolator, but will only work on APIs that are directly connected with sharepoint’s API. That means that if you only need to test sharepoint stuff, you can get a powerful product, for a much cheaper price than the full Isolator (you can always upgrade later if you need to isolate more APIs).

How to get a free licence:
Typemock are offering their new product for unit testing SharePoint called Isolator For SharePoint, for a special introduction price. it is the only tool that allows you to unit test SharePoint without a SharePoint server. To learn more click here.
The first 50 bloggers who blog this text in their blog and tell us about it, will get a Full Isolator license, Free. for rules and info
click here.

Enjoy it!

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.

Wednesday, November 19, 2008

Silverlight 2 Blueprint for SharePoint

You can get Silverlight 2 Blueprint for SharePoint from here:
http://www.codeplex.com/SL4SP
Now it's reach the Beta 2 version. Enjoy it!

SharePoint Guidance - November 2008

A new version of SharePoint Guidance is avaiable here:
http://www.microsoft.com/downloads/details.aspx?FamilyId=C3722DBA-6EE7-4E0E-82B5-FDAF3C5EC927&displaylang=en

This guidance helps architects and developers build SharePoint intranet applications. A reference implementation (RI) demonstrates solutions to common architectural, development and lifecycle management challenges.This guidance discusses the following:

  • Architectural decisions about patterns, feature factoring and packaging.
  • Design tradeoffs for common decisions many developers encounter.
  • Implementation examples demonstrated in the RI and in the QuickStarts.
  • How to design for testability, create unit tests, and run continuous integration.
  • Set up of development, build, test, staging, and production environments.
  • Managing the application life cycle including upgrade.
  • Team-based intranet application development.

The following areas are not discussed in this version of the guidance:

  • Content-oriented sites that use Web content management
  • Internet and enterprise-scale SharePoint applications
  • Multilingual SharePoint applications
  • Scale or security testing of SharePoint applications

More information about this you can find here: http://www.codeplex.com/spg/

Lookup issue for custom content types

If you have the following situation:
You have a couple of lists in your SharePoint application and you want to export their schema.xml file (to make content types based on custom lists created by you in SharePoint). Let us suppose we have some of those lists linked with lookup columns. Then we'll have a problem:
If we'll have the Department list and the Employee list and the Employee list has a column named Department witch is a lookup to the Department list and we extract the schema.xml files from both lists (with the help of SharePoint Solution Generator or OCDExportList) and we'll make a feature with those 2 content types and after that we'll deploy the feature to a different server and we'll create instances from those content types we'll see that the relation between the instances does no longer exist. The Department lookup column from the Employee list will not refer the Department list. Why is that?
If you'll look at the schema.xml file from the Employee list you'll find that your lookup column looks like that:

<field id="{92680819-4656-406f-9eb7-21377cb4eec8}" version="1" group="" rowordinal="0" colname="int2" name="Departament" staticname="Departament" sourceid="{d129f702-1314-4fef-8bdc-4826bc720cd7}" unlimitedlengthindocumentlibrary="FALSE" showfield="Title" list="{A83FD6BE-DE5A-49A6-A369-DA72AF737408}" required="TRUE" displayname="Departament" type="Lookup">

What is interesting here is the following attribute: List="{A83FD6BE-DE5A-49A6-A369-DA72AF737408}”. This attribute tell SharePoint that the lookup field will link to the list instance with the id equals with the GUID given. When you'll deploy it to a new server, the list instance with this id does not exist anymore so it doesn't know how to link the Employee list, so the relations between your lists are not longer used.
To resolve this issue you have to make the following modification:
List="Department" - if you'll provide the name of the instance here (where SharePoint expects a GUID) when you'll create instances from your content types SharePoint will search your current web for lists with the name you provided there, if it will find something it will make the replacement for this instance.
And if you want to be more abstract you should use resources files, so we'll change the attribute with something like: List="$Resources:empmon,list_Departament;" where empmon is your resource file deployed in your 12/Resources folder, and list_Department is your mapping name for your Department list. So when you want to change the lookup for a column (to refer another list) you just have to modify your resource file and when you'll create another instance of that list the new lookup column knows to refer the right list.

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!