Chapter 14. SharePoint Online

WHAT'S IN THIS CHAPTER?

  • An overview of SharePoint online

  • Programming differences in the cloud

If you have not heard about public or private clouds, you must not be reading the news or blogs, or looking at what the different vendors are doing. Software as a service (SAAS) is all the rage in the computing world. While it has many merits, including ease of deployment, anywhere access, and quick upgrades, at the same time it has a number of obstacles, such as limited offline support, less mature development tools, and less control of customization. Regardless of these limitations, many people are looking to the cloud as the next major shift in the computing world. If you have not tried to build applications against a cloud service such as Microsoft Azure or SharePoint Online, get started today.

SHAREPOINT ONLINE OVERVIEW

There are two different versions of SharePoint Online: Standard and Dedicated. Table 14-1 provides an easy way to compare the different ways you can deploy SharePoint. This table compares SharePoint On-Premises, SharePoint Online Standard and SharePoint Online Dedicated.

Table 14.1. Different Deployment Options for SharePoint

AREA

ON-PREMISES

ONLINE STANDARD

ONLINE DEDICATED

Type of Hosting

Self-hosted and managed

Multi-tenant hosted by Microsoft

Dedicated hardware and hosting by Microsoft

Type of Physical Access

Direct access to physical machines

Shared Hardware with no physical access

Dedicated hardware with no physical access

Administration Capabilities

Central Administration access supported

No Central Administration access but tenant administration access

Central Administration access supported

Customization

No limitations

No support for farm code but support for sandbox, SharePoint Designer (SPD), and client applications

Customizable, but some solutions require Microsoft Approval

Topology Support

Set by customer

No control but supports certificate- or forms-based authentication

Machine and process accounts in different AD forests

Size Limitations

No limits

Between 5 and 5000 users

5000 or more users

One of the major differences, as you can see in the table, is that SharePoint Online Standard does not support the full range of customizations like the other two deployments of SharePoint. Going even deeper, if you look at what constitutes a farm solution as opposed to a non-farm solution, the clarity of what will and won't work gets better. Table 14-2 shows examples of no-code solutions versus farm solutions.

Table 14.2. No-Code versus Farm Solutions

NO-CODE SOLUTION

FARM SOLUTION

Custom Markup (HTML, ASP.NET, XSLT)

Custom Server Components (coded workflows, timer jobs, Window Services)

SharePoint Designer solutions

Visual Studio Solutions (except for Sandbox Solutions)

Client-side code, such as Client OMs, including JavaScript and Silverlight

Application pages

Coding against SharePoint web services

Visual web parts

One other major difference between online and on-premises is that not all of the feature set of SharePoint is supported in the cloud. In particular, SharePoint Online does not support PerformancePoint or FAST in the cloud. Additionally, when dealing with search technologies, architecture and deployment become more critical when deploying in the cloud. For example, if you had a hybrid environment where you wanted to have one search index across both on-premises content and cloud content, where do you place your indexer — on-premises or online? The answer is that it depends, but either place that you decide to place it, you will be dealing with crawling across WANs. A solution may be to create two separate search deployments and use federated search. However, doing so results in the loss of the ability to have a single result set with integrated relevancy.

DEVELOPING IN THE CLOUD

As you can see by the summary above, some of the ways you are used to developing on-premises will not translate to the multi-tenant cloud. Using server-side code is a no-no when it comes to building applications where you are running SharePoint with other tenants on the server. When developing for online use, there are a number of different choices you have for development. You can use Sandbox Solutions, SPD, InfoPath, Access, or the SharePoint client object model in ASP.NET or Silverlight applications. Since many of these technologies have been covered already in this book, they will not be covered here again.

Instead, this chapter focuses on some of the best practices to use when developing in the cloud. These best practices can be used on-premises as well as on the cloud, but given the limitations of the cloud, you have more options on-premises.

Visual Sandbox Web Parts

One of the complaints about Sandbox Solutions is that you cannot create a visual web part as a Sandbox Solution. The reason for this is the way Visual Studio (VS) implements the visual web part and uses the Page.LoadControl method to load the user control that represents the web part. It requires access to the file system to get the ASCX file, then it compiles the ASCX file and returns a new type. There are a number of ways to resolve the problem of creating a visual web part, including compiling the ASCX yourself and referencing it in your Sandbox Solution.

However, there is an easier way than doing all this work yourself. There is a community effort to build tools for SharePoint on Codeplex. The tools available at Codeplex include a template for building visual web parts inside of a Sandbox Solution. You can download these tools from the following URLs: http://sharepointdevtools.codeplex.com/ and http://cksdev.codeplex.com/.

Debugging Your Solutions

Depending on the technology you decide to use, there will be different techniques to debug your solutions. Unfortunately, many of the techniques you are used to will not work in an online development environment. For example, you cannot enable the Developer Dashboard in the online environment. Also, your Sandbox Solutions cannot write to the file system or over the network. For SharePoint debugging purposes, get comfortable writing debugging information as screen alerts or storing it within SharePoint lists. Furthermore, you will want to keep a SharePoint site just for development and then deploy your solutions to your online production site.

When it comes to Silverlight or client-side code, your choices for debugging are better, since you can use the tools built into Internet Explorer or Firefox to debug your solution.

The following Sandbox web part shows how to log on to a SharePoint list for debugging purposes:

using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;

namespace SharePointOnlineLogging.WebPart1
{
    [ToolboxItemAttribute(false)]
    public class WebPart1 : WebPart
    {

        private Button logResultsButton = new Button() { Text = "Log Results" };
        private Label lbl = new Label();

        public WebPart1()
        {
        }

        protected override void CreateChildControls()
        {
            logResultsButton.Click += (object sender, EventArgs e) =>
            {

                SPContext context = SPContext.Current;

                SPWeb web = context.Web;

                SPList list = web.GetList("/Lists/
                 SharePointOnlineLogging-ListInstance1");

                string logResults = DateTime.Now.ToShortDateString() + " " +
                 DateTime.Now.ToShortTimeString()
                  + ": Logged from Sandbox Web Part!";

                SPListItem newItem = list.AddItem();


                newItem["Title"] = "New Log Result - " +
                DateTime.Now.ToShortTimeString();
                newItem["LoggingResult"] = logResults;

                newItem.Update();


                lbl.Text = "Logged Result: " + logResults;
            };
Controls.Add(logResultsButton);

            Controls.Add(lbl);

            //base.CreateChildControls();
        }

        protected override void RenderContents(HtmlTextWriter writer)
        {
            base.RenderContents(writer);
        }
    }
}
Debugging Your Solutions

EXAMPLE CLOUD SCENARIOS

To help understand areas where using SharePoint in the cloud makes sense, the following scenarios describe where you can use the cloud and where you can't. As you will find, for out-of-the-box functionality, SharePoint Online is a very viable solution. The areas to watch out for include custom code and unsupported features in the cloud, or features that require administrative access to the server.

The first scenario is your typical team collaboration, wherein you are creating a team site, sharing documents, and performing simple customization of the site. Because this case does not require high-end development or administrative access, this scenario would be supported easily in the cloud. The only gotchas are to make sure that users who use Office on their desktop understand how to authenticate against SharePoint Online and how to determine the address for their sites, since they will be fully qualified domain names rather than Intranet style short names.

The next scenario is a company portal. This is where it gets more complex, because many portals require rich customization and publishing infrastructure. This is one scenario where you will have to evaluate your needs versus what SharePoint Online provides from a development standpoint. If you find that your existing portal makes use of a lot of custom code (such as custom field controls or complex worklows), you may not want to run your solution in SharePoint Online or rewrite these solutions to use Sandbox Solutions, which are supported in the Online environment.

SharePoint Online will have an offering for building Extranets since the security for Extranets is different than Intranet sites. Plus, sharing and invitations with external parties makes it easy for end users to invite their business partners from other companies. While this offer isn't complete at the time of the writing of this book, Extranets, depending on what the offer finally ships, may be the first scenario that you undertake with SharePoint Online as a complement to your on-premises deployment of SharePoint. You may get a quick win by making it easy to share information with your business partners without having to worry about access to your internal corporate networks. You will want to make sure that the Online service-level agreements for availability and recovery meet your corporate standards and that the security in place for SharePoint Online meets your security guidelines for your company.

The last scenario is Internet-facing sites. SharePoint Online will have an offer for anonymous Internet facing sites with SharePoint Online 2010; you will want to evaluate this offer for medium-sized websites. If you are running a large scale website that requires a lot of customizations, the Online offer will not meet your needs. You will want to run your Internet site on-premises until Online allows for complex customizations and support for technologies such as content deployment.

SUMMARY

In this chapter, you learned about the different versions of SharePoint Online. Also, you saw what is supported in an on-premises deployment, as opposed to an online deployment. With the 2010 release of SharePoint Online, there is better symmetry between the on-premises and online versions of SharePoint, but to a developer there are a significant number of differences. You will have to keep that in mind as you develop your code to make it portable from an on-premises solution to a SharePoint Online solution.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.123.106