Thursday, April 22, 2010

Introduction to querying lists with REST and ListData.svc in SharePoint 2010

http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2010/01/21/introduction-to-querying-lists-with-rest-and-listdata-svc-in-sharepoint-2010.aspx

When you are getting started, the first thing you want to do is check and see if you have ListData.svc up and running. Like any SharePoint web service, it’s located in the _vti_bin folder of any existing site, so it will work with items relative to that site. Here is what a typical URL might look like.
http:///_vti_bin/ListData.svc

To get the data for this list via REST we simply just add the list name to the URL. In my case the name of the list is called Tasks. Here is what the URL would look like.
http:///_vti_bin/ListData.svc/

you just want to know the status for a specific task (note that the site column is actually called StatusValue here), you can simply add it to the URL like this.
http:///_vti_bin/ListData.svc/()/()
In my case:
http://sp2010/_vti_bin/ListData.svc/Tasks(3)/StatusValue


You need to install ADO.NET Data Services v1.5 CTP2 on SharePoint front-end to get it working.

Friday, April 9, 2010

SharePoint 2010 Client Object Model

Now you can work with SharePoint remotely. Client code communicates to the server through Client OM which uses Client.svc WCF service to communicate with SharePoint Server. Client.svc service uses Server OM as per client request and returns the result to the client in JSON format.

Thursday, April 8, 2010

Built-in SharePoint constants

http://blog.hompus.nl/2010/02/05/prevent-hardcoded-sharepoint-ids-in-your-code

The SPBuiltInFieldId class contains 314 GUID’s for the default SharePoint fields.
The SPBuiltInContentTypeId class contains 34 content type ID’s for the default SharePoint content types.
The FeatureIds class contains 16 GUID’s for the MOSS publishing features
The FieldId class contains 61 GUID’s for the publishing fields.
The ContentTypeId class contains 10 content type ID’s for the publishing content types.
The PropertyConstants class contains 42 names of the standard user profile properties

The WssFeatureIds class however is public and the only place the 24 WSS feature id’s are available.

Because this class is not documented I list all fields:

AnnouncementsList
BasicWebParts
ContactsList
CustomList
DataConnectionLibrary
DataSourceLibrary
DiscussionsList
DocumentLibrary
EventsList
GanttTasksList
GlobalContentTypes
GlobalFields
GlobalMobilityRedirect
GridList
IssuesList
LinksList
NoCodeWorkflowLibrary
PictureLibrary
SurveysList
TasksList
TeamCollaboration
WebPageLibrary
WorkflowHistoryList
XmlFormLibrary

Wednesday, April 7, 2010

Django sessions and forms in IE


Django framework allows to store user data in the current browser session.

Each HttpRequest request has session attribute which is dictionary-like object:
request.session['context'] = '2k3'

But keep in the mind that this operation changes current session and it can affect the browser behaviour.

For instance, Internet Explorer enforces page refreshing during previous page loading by "Back"operation. So if you had completed form there (on the previous page) - form's data is lost with "Back" in browser.