Client object model focuses on the most relevant APIs for client-side development. But limiting the size of the client libraries reduces the amount of time that is required to download the libraries in the Silverlight and ECMAScript contexts. Http throttling is a new feature in SharePoint 2010 that allows the server to “back off” of serving requests when it is too busy. Requests generated prior to the server entering into the throttling mode will be completed. Access an External List using Office Add-ins• Chose Word 2010 Document Add-in• Chose the document• Added a WPF User Control• Added references• Added using statements• Created a class for data-binding• Instantiated a ClientContext• Retrieved List data
Client APIs are very intuitive .The naming convention rests very similar to the Server OM. “SP” prefix in the client objects has been dropped.
Client communicates to the server thorough Client OM which under the hood uses Client.svc WCF. Client.svc service uses Server OM as per client request and returns result to the client in JSON format.
You “get connected” to the data in SharePoint with the new ClientContext object.
The items parameter of the lambda expression is of type ListItemCollection . It does not contain an indexed property that allows us to specify which properties to load for items in the collection. Parameters to lambda expressions in the Include extension method are of type of the items of the collection. Therefore, you can specify the properties that you want to load for each item in the collection.
For instance, you can query for all items in a project list that are assigned to a certain person, and separately query for all items that have an estimated hours that is larger than a certain threshold, and access both result sets at the same time.
think as a .NET class or structure that is marshaled by value
(think as a .NET class or structure that is marshaled reference)
Initializinganother ClientContext to the same SP site doesn’t allow you to useobjectsfrom one client context with the other one. Client OM remembers that the list object is the one that was initialized by using the GetByTitle method, and that the client object model should execute the CAML query on that same list object after the list object is retrieved from the SharePoint database. The code uses that list client object to call the List.GetItems method, and then calls the ExecuteQuery method again. Any class that derives from the ClientObject class has these semantics.
Before executing Client Object Model calls you need to get a ClientContext object through which calls can be made.
The Dispatcher maintains a prioritized queue of work items for a specific thread.Dispatcher.BeginInvoke method executes a delegate asynchronously on the thread the Dispatcher is associated with.
Calling Load() method won't load the object immediately. We need explicitly call it by using executeQueryAsync() method. It has the success method and the failure method
You can obtain the PublicKeyToken value for the current SharePoint Foundation deployment from the default.aspx file in the %ProgramFiles% Common FilesMicrosoft Sharedweb server extensions14TEMPLATESiteTemplatessts folder, or from information provided for the Microsoft.SharePoint assembly at Local_Drive:WINDOWSWINNTassembly in Windows Explorer. Once the page is posted back the security token is validated. Once the security token is generated it’s valid for a configurable amount of time. By default, the ScriptMode property of ScriptManager is set to auto, as a result the minified version of js file loaded.
REST is a term coined by Roy Fielding in his Ph.D. dissertation [1] to describe an architecture style of networked systems. In WSS 3.0 you were able to access list data with the SOAP based Lists.asmx. This technique worked well for .Net desktop apps or server side application pages, but not so well with client side JavaScript.
For instance if you modify the row level permissions for a list item to deny read permissions to a user then ListData.svc will not return that list item for that user. If you try to access the URL for that list item directly SharePoint returns a 404. If you try to modify or delete a list item you don't have permissions to modify then SharePoint returns a 401 Unauthorized.