Build Search SQL queries and supporting code on a flash!

18 02 2009

Recently I have been involved in a project where the complete search experience had to be rewritten. This implies the creation of templates (XML for the query itself and XSLT for the result processing), new controls and control processors. While defying, this is a rare opportunity to really dig into the search API. If you find yourself into such a situation, take a look at the SharePoint SearchCoder. This is a small tool that through a GUI, allows you to create the queries and c# code to use it. Very nice! Right into my tool box.

“Code blocks are not allowed in this file”

13 02 2009

If you come accross this error, here is the information you need to solve it:

Cause: you are running code snippets inside a file that is not allowed to do so by default.

Afected files: i.e. Master pages and Page layouts

Solution: you have to add an explicit authorization for the file(s) where you want to do so. The question is: do you really want to do it? You should take the best approach which is to add a code behind file (you can find how to do it here: Adding Code-Behind Files to Master Pages and Page Layouts in SharePoint Server 2007). If you still want to do it, just add a tag like this to your <PageParserPaths>:

<PageParserPath VirtualPath=”/_catalogs/masterpage/MyMaster.Master” CompilationMode=”Always” AllowServerSideScript=”true” />

Keep having fun ūüôā

Sharepoint config store

13 02 2009

While the web.config may be a nice place to store your configuration information, you need to edit it manualy if you need to change a configuration key. This operation must be repeated as many times as the number of machines you have on your farm. Thus it is not practical and it does not make sense. Other approaches include SQL table, sharepoint lists and so on.

Chris O’Bryan came up witn an implementation of a config store, based on a SPList and with the basic methods to access them.

The project is available from codeplex and you can find the approach described here: A better Config Store for SharePoint sites .

Great work Chris!

Devdays09: Portugal ~ Oeiras ~ Tagus Park

11 02 2009

<Portuguese event>

Vai decorrer nos próximos dias 18 e 19 de Fevereiro o evento promovido pela Microsoft, desta feita dedicado à comunidade de desenvolvimento: DevDays 2009.

Estarei presente na apresenta√ß√£o da sess√£o “Desenvolvimento em Sharepoint: o bom, o mau e o vil√£o“, onde juntamente com o Bruno Valente iremos apresentar¬†o estado actual dos processos de desenvolvimento. O formato da sess√£o √© inovador e mais do que uma apresenta√ß√£o, pretende promover a discuss√£o e a xtroca de experi√™ncias entre os participantes.


Apesar de baseado na plataforma .NET, a metodologia de desenvolvimento de projectos baseados em Sharepoint tem algumas diferen√ßas importantes como: Tipos de artefactos, organiza√ß√£o das solu√ß√Ķes, ferramentas de desenvolvimento, processo de deployment, etc. O foco desta sess√£o √©, atrav√©s da troca de experi√™ncias entre a audi√™ncia e os speakers, discutir os diferentes problemas encontrados e as melhores solu√ß√Ķes.

Apareçam e troquem umas bolas conosco!

</Portuguese event>

It is out: SPDisposeCheck

2 02 2009

It is finally out: . You can get it from here:

For those of you that haven’t heard about it, this is a tool that integrates with Visual Studio, and checks your assemblies for Sharepoint Disposable objects not being disposed. This is a must. Use it frequently during the development and NEVER, and I do mean NEVER, put your code into productyion before evaluating it with this tool.

The problematic around disposing objects can be found in articles like Best Practices: Using Disposable Windows SharePoint Services Objects.