Share Point Client Object Model

  • Upload
    dentisy

  • View
    217

  • Download
    0

Embed Size (px)

Citation preview

  • 8/18/2019 Share Point Client Object Model

    1/12

    SharePoint 2010

    Managed Client Object Model

    Jason CribbetSummit 7 Systems Inc.

    Senior Developer

    http://summit7systems.com/blogs/jasoncribbet

    @jcribbet

  • 8/18/2019 Share Point Client Object Model

    2/12

    Agenda

    • Intro

    • Architecture

    • Usage• OM Objects

    • Demo

    • Benefits & Limitations

  • 8/18/2019 Share Point Client Object Model

    3/12

    What is the SP Client Object Model?

    • Object Oriented approach to access SP Data

    • 3 APIs for interacting with SharePoint Sites

     – .Net App (.Net Framework 3.5+)

     – Silverlight App (2.0+)

     – ECMAScript (JavaScript, Jscript)

    • Create and Modify many SharePoint objects

    o Add and Remove Lists

    o Add, Update, and Delete List

    Items

    o Change documents in document

    libraries

    o Create Sites

    o Manage Permissions of items

    o Add and remove Web Parts

    from page

  • 8/18/2019 Share Point Client Object Model

    4/12

    2007 Architecture

    Web

    Services

    Server OM

    JavaScript/Managed Code

    Web Parts, Custom

    Controls, etc.

    ContentDatabase

    Server Side

    Client Side

  • 8/18/2019 Share Point Client Object Model

    5/12

    2010 Architecture

  • 8/18/2019 Share Point Client Object Model

    6/12

    Usage

    • .Net Assemblies

     – Microsoft.SharePoint.Client.dll

     – Microsoft.SharePoint.Client.Runtime.dll

    • ECMAScript

     – Include “sp.js” within the page 

     – Ensure “sp.js” loaded before execution 

  • 8/18/2019 Share Point Client Object Model

    7/12

    OM Objects

    Server Side Classes Client Side Classes

    SPContext ClientContext

    SPSite Site

    SPWeb Web

    SPList List

    SPListItem ListItem

    SPField Field

    • Server OM vs. Client OM

  • 8/18/2019 Share Point Client Object Model

    8/12

    Key Code Objects

    • ClientContext.Load(clientObject, retrievals);

    • ClientContext.ExecuteQuery();

  • 8/18/2019 Share Point Client Object Model

    9/12

    Demo

    1. Respond to link with a SP Dialog2. Accept user input

    3. Create a List Item

  • 8/18/2019 Share Point Client Object Model

    10/12

    Benefits

    • Client OM looks similar to Server OM

    • Common API across ECMA, Silverlight, and .Net

    managed code

    • Abstracts the request details

    • Can access SP data remotely

    • Access data directly without using Web Services

  • 8/18/2019 Share Point Client Object Model

    11/12

    Limitations

    • No elevation of privilege

    • Can’t access WebApplication or Farm objects

    • Requests are throttled• Silverlight and JavaScript are asynchronous

  • 8/18/2019 Share Point Client Object Model

    12/12

    Questions?

    Jason CribbetSummit 7 Systems Inc.

    Senior Developer

    Twitter: @jcribbet

    http://summit7systems.com/blogs/jasoncribbet