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.