If like me, you wonder how you can localize your SharePoint XSLT files, the ones you use in your custom field types and/or in your lists, here is how it works:
- You need to have a resource file, so for instance MyResource.resx, MyResource.en-US.resx and MyResource.fr-FR.resx
- You must deploy those resource files to the App_GlobalResources folder of the corresponding IIS web application. Now, you can easily do that with the new packaging mechanisms since SharePoint WSPs are now able to deploy directly in the web app folders.
- When those pre-requisites are respected, you can just use this:
in the "body" mode of your custom field type
and this, in the "header" mode of your custom field type:
This will grab the value of the key in the relevant resource file corresponding to the culture of the current web.
I've eventually migrated my rating system to SharePoint 2010. Originally, I didn't plan to migrate it since SharePoint 2010 offers an out of the box rating solution but I didn't notice directly that this feature is only available in SharePoint Server and SharePoint Server Enterprise, not in SharePoint Foundation.
Therefore, because of that and also because of some requests on CodePlex, I decided to make an effort and to find the necessary time to make the migration.
If you wonder how to implement a custom header pattern in XSL for a custom field type in either SharePoint Foundation or SharePoint Server, here is an example that you can download showing how to do.
In this little example, we'll implement a custom field type inheriting from Text that will show the number of entries having that same value within the list. You could achieve this by creating a view that groups the elements on that field & shows the totals but this is just to show an example :).
So, here is a screenshot of the functionality
When you click on the value contained in that specific column, you get an alert message showing you how many items in the list have the same value for that column. In this example, when you click on value 1, you get 2 since two rows contain this value as shown below:
As you know already, SharePoint 2010 uses an XSLT engine to render views & custom field types. You can still use CAML views but it defaults to XLST.
I've just built a custom field type whose the parent type was "Choice". While building the corresponding XSLT, I didn't find the "mode" I was supposed to use...So, in case, the same story happens to you, an easy way to know which mode you're supposed to use is to examine the out-of-the-box file delivered with any SharePoint installation.
I'm talking about this file:
I'll be presenting a session at the MIC on September 15 2010 along with a few others fellow SharePoint guys. The covered topics are quite exciting:
- SharePoint workflows
- Building BCS over custom WCF services
- InfoPath 2010
- Querying data in SharePoint 2010 (LINQ, CAML, RESTFUL) + using XLST to render views
- The Client Object Model (Silverlight, .NET & ECMAScript)
The full description & registration (it's free) page is available here :
In regular server-side SharePoint coding, when we want to check whether the current user has specific permissions on a list, we can use the method SPList.DoesUserHavePermissions(). This method isn't available from the Client Object Model but you can easily create your own this way:
You can use a similar technique with the Silverlight Client OM but you'll be forced to check asynchroneously!
I've seen and I got a lot of questions regarding the client object model and its two execution methods which are:
- ExecuteQuery() => synchroneous
- ExecuteQueryAsync(callback success,callback failure) => asynchroneous
As a quick reminder, if you execute the following code:
The code waits until SharePoint sends a response back. This can be useful if you want to make your code conditional upon SharePoint's answer.
Warning: I've just (on Sun. may 16) re-amended the code to be compatible with the RTM.
Today, after a trafic jam session (thanks Vilvoorde...) because of which I got late, I presented a session on how WCF is integrated into SharePoint 2010 beta2 (I've not tested yet on the RTM bits) and more particularly how you can benefit from the RESTFUL services and more particularly from ListData.svc.