DevDays Netherlands 2011

Leave a comment

April 28 and april 29 we (me and some colleagues from QNH) went to the DevDays in The Hague (Netherlands). I decided to write a small summary about what we saw and to give some resources for further reading. So here it goes:

Azure and AppFabric
There were al lot of sessions about Windows Azure. Everything indicates that the cloud is really taking a flight in 2011/2012. We got an introduction to the 3 different middle-ware services that Azure at the moment offers:

  1. the service bus
  2. access control
  3. cache service (this service went on-line on the 29th of April 2011)

With the use of Azure AppFabric it is possible to build composite applications that make use of each of these services. For more information on Azure AppFabric see: http://www.microsoft.com/windowsazure/AppFabric/Overview/default.aspx. There is also a server version of AppFabric which you can find on http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=467e5aa5-c25b-4c80-a6d2-9f8fb0f337d2. AppFabric builds on top of the “Application server” role of Windows Server.

LightSwitch
Next went to see the presentation “LighSwitch Beyond the basics” by Beth Massi. LightSwitch is a framework on which you can build mash-up applications in Visual Studio really fast. With LightSwitch you can connect to a lot of different datasources. Datasource types include SqlServer, WCF RIA and yes: SharePoint lists and libraries. Next you can create a datamodel based on the datasources. For example: you can connect your SQL table to a SharePoint Library. The creation of the datamodel feels a lot like creating a datamodel in MS Access. It is also possible to add validation to your fields or entities (like: the date in this date-field should be after 1/1/1990). On top of your datamodel you can create CRUD (Create, Read, Update & Delete) screens based on SilverLight 4. And all I described above can be done without writing a single line of code!

However, the best thing about LightSwitch is that you can write code if needed. Events in the validation, the datasources and the views can be overridden. Further it is possible to create your own SilverLight controls that can be used in the views (for example the Bing Maps Control). LightSwitch is still in beta, but I think it’s definitely worth taking a look: http://msdn.microsoft.com/en-us/lightswitch/ff796201. I will be writing some more posts on LightSwitch and SharePoint.

MVC 3
We went to see Scott Hanselman’s presentation about MVC 3 (somehow the Microsoft MVC framework reminds me a lot about the Java Struts framework). Scott gave an introduction to “Razor”, a syntax for creating ‘cleaner’ mark-up in hybrid html/code aspx pages (something, which I remember, was also always an issue with Java JSP pages) For an introduction to Razor see Scott Guthrie’s blog http://weblogs.asp.net/scottgu/archive/2010/07/02/introducing-razor.aspx.

Scott talked about Modernizr. With the coming of HTML 5 and CSS3 there are browsers that support the new features and browsers that do not yet support these features. When you create a new website you want to make use of the newest features, but you also want your website still to work on older browsers. With the Modernizr framework you can make your website backwards compatible. In other words: if the browser supports the new technologies, it will make use of these new technologies. If it does not, instead it will render controls and features that it does support. For more information on Modernizr see http://www.modernizr.com/.

Something else he talked about was NuGet (see http://nuget.codeplex.com/) a tool for making use of third party libraries in .Net development easier. NuGet automates the tasks of downloading and incorporating third party libraries (including dependencies) in a project.

Here’s an impression of the DevDays 2011 The Hague Netherlands (the photo was taken with my phone so it is not really good quality…):

DevDays 2011 The Hague

SharePoint and Docx

Leave a comment

When you upload a docx to a document library, SharePoint adds custom column metadata to the document. For example: I’ve added 2 custom columns to a library. 1 Text field (CustomColumn1) and a dropdown column (CustomColumn2). Next I create an example docx document named “my_testdocument.docx”. I upload the testdocument to the document library and fill in the extra metadata:

Upload the docx document and fill in the custom metadata

Next I download the document to my desktop and change the docx extension to zip, so I can open the document. You can see that inside docx is completely xml:

docx to zip

I open the zip and look in the “customXml” folder for my custom columns. They appear in a file named “item2.xml”. Next I open the “item2.xml” file with an editor (in my case visual studio) and change the values of my custom column metadata:

change metadata values

After saving the file and renaming the file to “my_testdocument2.docx” I upload the edited file to the SharePoint Library:

new metadata

SharePoint adds the updated metadata to the custom Library columns.

How to split or merge a content database

Leave a comment

Spliting a contentdatabase in SharePoint 2010 can be usefull when a sitecollection becomes to big and you want to move it to another database. This same technique can also be used to combine sitecollections from different content databases to one content database (maybe because in the end the content did not grow as fast as you would have expected ).

Start by exporting the sitecollection. Go to central admin and choose Backup and Restore:

Backup and Restore

Next choose ‘Perform a sitecollection backup’:

Export a sitecollection

Choose a sitecollection and give a name and location for your backup:

You have now exported the sitecollection. Next we will import the sitecollection in another contentdatabase. Go to central admin -> Application management -> Manage Content Databases and create a new contentdatabase for the webapplication in which the above exported sitecollection lives:

Add a new content database

Now we will move the sitecollection to the other contentdatabase. Start up Powershell (SharePoint 2010 Management Shell) and enter the following command:

Restore-SPSite -Identity -Path [-DatabaseServer ] [-DatabaseName ] [-HostHeader ] [-Force] [-GradualDelete] [-Verbose]

Which in my example will look like:

Restore-SPSite -Identity http://sp2010:82 -Path c:\test.bak -DatabaseServer SP2010 -DatabaseName WSS_Content_2f5af4672a134a9e9414c704cd3ac806 -force

Do not forget to add the ‘-force’ or else the existing sitecollection will not be overwritten.

Powershell

After this command the sitecollection is moved to the other contentdatabase:

Result

Give SharePoint Site Columns (Fields) a different display and technical name via the webinterface

Leave a comment

Probably for some people this is obvious, but I just found out yesterday and I thought I should share it.

When you create a site column (or Field) as an installable feature you can specify a ‘DisplayName’ (the name that will be used to show the column via the webinterface) and a ‘Name’ which will be the technical name of the Field.

The webinterface does not seem to give you this possibility, somehow it seems you can only enter the displayname on the “Create new site column” page. However in reality it is both the ‘DisplayName’ and the technical name (or ‘Name’) that you specify on the moment of creation. Now here is a way how you can use the webinterface to create a sitecolumn that has different Display and Technical name:

Start by creating a new site column and give it the TECHNICAL column name. In this case I use “prefix_” as a prefix:

The fieldname that is both the display and technical name

Now to check the internal column name (you can hover over the display name and in the url that appears the technical name of the column is shown):

Url with the technical name of the column

No go back to the “Site columns” settings page and edit the site column that you have just created. Change the name into the DisplayName that you want the column to have:

The displayname of the column

Save the column and hover over the site column again. The internal technical name still has the prefix, and only the DisplayName of the column has changed!

The technical name still has the prefix