• Save
Custom SharePoint 2010 solutions without server access
Upcoming SlideShare
Loading in...5
×
 

Custom SharePoint 2010 solutions without server access

on

  • 4,793 views

 

Statistics

Views

Total Views
4,793
Views on SlideShare
4,757
Embed Views
36

Actions

Likes
0
Downloads
4
Comments
0

2 Embeds 36

http://balaonweb.blogspot.com 24
http://www.slideshare.net 12

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Custom SharePoint 2010 solutions without server access Custom SharePoint 2010 solutions without server access Presentation Transcript

  • Developing Custom SharePoint 2010 Solutions without server access
    Phil Wicklund
    SharePoint FREEWARE
    www.PhilWicklund.com
    SharePoint CONSULTING
    www.RBAconsulting.com
  • About Me…
    Working with SP since 2004
    Started as a trainer for Mindsharp
    Now consulting through RBA in MN
    Blog: philwicklund.com
    Writing a 2010 book:
  • Agenda
    The Problem: how to develop custom
    solutions that won’t impair the farm
    SharePoint Designer 2010
    Sandboxed Solutions
    Client Object Model
    Questions
    SharePoint FREEWARE
    www.PhilWicklund.com
    SharePoint CONSULTING
    www.RBAconsulting.com
  • SharePoint Designer 2010
    Used for:
    Browser alternative (administrate pages, content types, web parts, etc)
    Branding
    XsltListViewWebPart
    Workflow
    External Data
    SharePoint FREEWARE
    www.PhilWicklund.com
    SharePoint CONSULTING
    www.RBAconsulting.com
  • Demo 1: Workflow with SPD
    Model Workflow in Office Visio
    Import Workflow into SharePoint Designer
    Publish to SharePoint, and test
    SharePoint FREEWARE
    www.PhilWicklund.com
    SharePoint CONSULTING
    www.RBAConsulting.com
  • Sandboxed Solutions
    Solutions are cab based file with wspextenion
    can contain web parts, features, workflows, etc.
    Scoped to a Site Collection
    Site Collection Administrators Install, Manage and Monitor the solutions
    SharePoint FREEWARE
    www.PhilWicklund.com
    SharePoint CONSULTING
    www.RBAconsulting.com
  • Sandboxed Solutions
    Solution Gallery:
    SharePoint FREEWARE
    www.PhilWicklund.com
    SharePoint CONSULTING
    www.RBAconsulting.com
  • Sandboxed Solutions
    Debugging Sandboxed Solutions
    Farm Solutions run in the w3wp.exe process
    Sandboxed Solutions run in the SPUCWorkerProcess.exe process
    Hitting F5 automatically attaches to SPUCWorkerProcess.exe, then simply drop web part on a page, for example
    SharePoint FREEWARE
    www.PhilWicklund.com
    SharePoint CONSULTING
    www.RBAconsulting.com
  • Sandboxed Solutions
    Caveats
    Full API swapped out at runtime with sandboxed subset. SPSecurity.RunWithElevatedPrivledges, for example, won’t work.
    IntelliSense is also truncated to help prevent runtime errors since compiler compiles against full API
    Try to avoid cut and paste
    All classes below SPSite are available
    Partial trust prevents access to anything outside the scope of the Site Collection (Internet, Web service, file system, etc)
    SharePoint FREEWARE
    www.PhilWicklund.com
    SharePoint CONSULTING
    www.RBAconsulting.com
  • Sandboxed Solutions
    Monitoring
    “Point” quotas set in Central Administration. Default is 300 points.
    Shows usage reports, for today and a 14 day average
    Points – next slide
    Validators
    Fire on upload of solution into Gallery
    Can enfore, only web parts, singed cod with a particular token, log/catalog solutions, etc.
    SharePoint FREEWARE
    www.PhilWicklund.com
    SharePoint CONSULTING
    www.RBAconsulting.com
  • Sandboxed Solutions
    Courtesy John W Powell - MSDN
  • Demo 2: Sandboxed Web Part
    New Visual Studio Project
    Create a Web Part
    Deploy as Sandboxed Solution
    SharePoint FREEWARE
    www.PhilWicklund.com
    SharePoint CONSULTING
    www.RBAConsulting.com
  • Client Side Object Model
    Not enough web services in SP 2007
    Rather than create more services, COM provides the complete API
    COM provides a consistent development experience:
    Windows Applications
    ASP.NET web sites
    Silverlight Applications
    JavaScript, www client side scripting
    SharePoint FREEWARE
    www.PhilWicklund.com
    SharePoint CONSULTING
    www.RBAconsulting.com
  • COM Architecture
    SharePoint FREEWARE
    www.PhilWicklund.com
    SharePoint CONSULTING
    www.RBAconsulting.com
  • Assembly References
    SharePoint, Server Side
    Microsoft.SharePoint (ISAPI)
    .NET clients
    Microsoft.SharePoint.Client (ISAPI)
    Silverlight clients
    Microsoft.SharePoint.Client.Silverlight (Layouts/clientbin)
    Javascript clients
    SP.js & SP.Core.js (Layouts)
    SharePoint FREEWARE
    www.PhilWicklund.com
    SharePoint CONSULTING
    www.RBAconsulting.com
  • Comparable Objects
    SharePoint FREEWARE
    www.PhilWicklund.com
    SharePoint CONSULTING
    www.RBAconsulting.com
  • Starter Code
    Using Microsoft.SharePoint.Client;
    ...
    using (ClientContext context = new ClientContext("http://intranet"))
    {
    Web web = context.Web;
    context.Load(web);
    context.ExecuteQuery();
    string title = web.Title;
    // ListCollection lists = web.Lists;
    }
    SharePoint FREEWARE
    www.PhilWicklund.com
    SharePoint CONSULTING
    www.RBAconsulting.com
  • Iterating through Lists in a Web
    using (ClientContext context = new ClientContext("http://intranet"))
    {
    Web web = context.Web;
    context.Load(web);
    context.Load(web.Lists);
    context.ExecuteQuery();
    foreach(List list in web.Lists)
    {
    //do something
    }
    }
    SharePoint FREEWARE
    www.PhilWicklund.com
    SharePoint CONSULTING
    www.RBAconsulting.com
  • Efficiencies… Don’t be Lazy!
    Web web = context.Web;
    context.Load(web, wprop => wprop.Title));
    ListCollection lists = web.Lists;
    IEnumerable<List> filtered = context.
    LoadQuery(lists.Include(l=>l.Title));
    context.ExecuteQuery();
    foreach(List list in filtered)
    { }
    SharePoint FREEWARE
    www.PhilWicklund.com
    SharePoint CONSULTING
    www.RBAconsulting.com
  • Working with List Items
    Web web = context.Web;
    List list = context.Web.Lists.
    GetByTitle(“List Title");
    CamlQuery query = CamlQuery.CreateAllItemsQuery();
    ListItemCollection items = lst.GetItems(query);
    context.Load(items);
    context.ExecuteQuery();
    foreach (ListItem item in items)
    {
    string title = item["Title"];
    }
    SharePoint FREEWARE
    www.PhilWicklund.com
    SharePoint CONSULTING
    www.RBAconsulting.com
  • Efficencies with List Items
    CamlQuery query = new CamlQuery();
    query.ViewXml = "<View><Query><Where><Eq>
    <FieldRef Name='Title'/><Value Type='Text'>Phil</Value>
    </Eq></Where></Query></View>";
    ListItemCollection items = list.GetItems(query);
    context.Load(items, x => x.Include(
    item => item["ID"],
    item => item["Title"],
    item => item.DisplayName));
    SharePoint FREEWARE
    www.PhilWicklund.com
    SharePoint CONSULTING
    www.RBAconsulting.com
  • Adding new List Items
    List list = context.Web.Lists.
    GetByTitle(“List Title");
    context.Load(list);
    ListItemnewItem = list.AddItem(new ListItemCreationInformation());
    newItem["Title"] = "My new item";
    newItem.Update();
    context.ExecuteQuery();
    SharePoint FREEWARE
    www.PhilWicklund.com
    SharePoint CONSULTING
    www.RBAconsulting.com
  • Silverlight & Asynchronous Calls
    private void Button_Click(object sender, RoutedEventArgs e)
    {
    // Load a bunch of stuff
    clientContext.ExecuteQueryAsync(success, failure);
    }
    private void success(object sender, ClientRequestSucceededEventArgsargs)
    {
    RunQueryrunQuery= Run;
    this.Dispatcher.BeginInvoke(runQuery);
    }
    private delegate void RunQuery();
    private void Run() { /* do something */ }
    private void failure(object sender, ClientRequestFailedEventArgsargs) { /* do something */ }
    SharePoint FREEWARE
    www.PhilWicklund.com
    SharePoint CONSULTING
    www.RBAconsulting.com
  • Demo 3: .NET COM
    Build a Console (client) Application
    Render all theList Titles from a remoteSharePoint site.
    Create a new list itemin a remote SharePointsite.
    SharePoint FREEWARE
    www.PhilWicklund.com
    SharePoint CONSULTING
    www.RBAConsulting.com
  • Questions & Comments
    Phil Wicklund
    SharePoint FREEWARE
    www.PhilWicklund.com
    SharePoint CONSULTING
    www.RBAConsulting.com