Summary: Learn about the developer features that are coming to SharePoint Online, strategies and patterns for successfully developing on SharePoint Online, and links to additional resources for developers to deepen their knowledge of these extensibility features.
Available in SharePoint Online
|This article is prerelease documentation for SharePoint Online and is subject to change. It describes functionality that is available in the SharePoint Online Beta program, based on Microsoft SharePoint 2010 technology, not the current SharePoint Online subscription service. For more information about the SharePoint Online Beta service, see the SharePoint Online home page for the Office 365 Beta program.
Applies to: Microsoft SharePoint Online
Provided by: The SharePoint Developer Documentation Team
Introduction to SharePoint Online
SharePoint Online is a cloud-based service, hosted by Microsoft, for businesses of all sizes. Instead of installing and deploying SharePoint Server on premises, any business can now simply subscribe to SharePoint Online to provide their employees with an enterprise-grade solution to create sites to share documents and insights with colleagues, partners and customers.
SharePoint Online provides sites to:
- Manage and share important documents
- Keep teams in sync and manage important projects
- Stay up to date with company information and news
- Share documents securely with partners and customers
- Market your business using a simple public-facing website
SharePoint Online works with familiar Microsoft Office applications. It is easy to create Office documents and save them directly to SharePoint Online, or co-author documents with Office Web Apps. Users can access important documents offline or from familiar mobile devices, and set document-level permissions to protect sensitive content. With one click it is possible to communicate in real time with colleagues, customers, and partners from within SharePoint sites.
By letting Microsoft assume much of the operational burden that comes from managing the infrastructure that is associated with on-premises software, businesses can focus their resources on what is important—their businesses. Small-sized and medium-sized businesses can now take advantage of the same enterprise-strength collaboration platform that larger-sized companies do, without having to shoulder the operational and hardware infrastructure necessary to host SharePoint on-premises.
As a cloud-based service, SharePoint Online uses redundant and geographically dispersed data centers. Each data center houses a reliable and redundant infrastructure to support the service. And SharePoint Online provides businesses with the flexibility to scale resources as demands change.
SharePoint Online offers developers a flexible, robust framework for customizing and developing solutions for use in the multitenant environment of the cloud. The development features and patterns you use in developing for SharePoint Online are a subset of those available for developing for SharePoint 2010 on-premises.
This article presents an overview of the developer features that are available in SharePoint Online, introduces strategies and patterns for successfully developing on SharePoint Online, and provides links to more resources for developers to deepen their knowledge of these extensibility features.
Customization and Development Strategies
There are three basic ways to customize SharePoint Online:
- Configuration by using the browser Customizations that you can perform by using the SharePoint Online user interface in your browser. For example, you can edit page layouts, add and customize the default Web Parts, add lightweight Microsoft Silverlight widgets to a page, or embed jQuery code in a Content Editor Web Part.Because in-browser configurations are primarily performed by end users, they are outside the scope of this article. For more information for enterprises, see the SharePoint Online Planning Guide for Office 365 Beta for Enterprises. For more information for small businesses, see SharePoint Online Planning Guide for Office 365 Beta for Small Businesses.
- Customization by using SharePoint Designer Microsoft SharePoint Designer 2010 is a Web and application design program you can use to design, build, and customize your websites within SharePoint Online. With SharePoint Designer 2010, you can create data-rich webpages, build powerful no-code workflow-enabled solutions, and design the appearance and behavior (look and feel) of your site. Customizations that you can perform in SharePoint Designer are generally declarative, and can also employ client-side scripting.
- Developing SharePoint Online solutions that contain custom code To enable more technically complex solutions, SharePoint Online provides both server and client object models for developers. Microsoft Visual Studio 2010 provides a range of specialized templates for creating sandboxed solutions that contain a variety of SharePoint items, such as site and list definitions, workflows, Web Parts, event receivers, and content types, to include in your SharePoint solutions.
Accessing Developer Features
Customizing SharePoint Online Using SharePoint Designer 2010
SharePoint Designer 2010 is the tool of choice for rapid development of SharePoint applications. Using SharePoint Designer 2010, advanced users and developers can create SharePoint solutions in response to business needs. Advanced users can compose no-code solutions that encompass a variety of common scenarios, from collaborative sites to human workflows, leveraging the building blocks that are available in SharePoint in an easy to use environment. In addition, developers can use SharePoint Designer 2010 to get a quick start on SharePoint development projects.
SharePoint Designer 2010 delivers a powerful site-authoring experience by providing one place where you can do the following, all without writing a line of code:
- Create a SharePoint site
- Customize the components that compose the site
- Design the logic of the site around a business process
- Deploy the site as a packaged solution
The tasks you perform in SharePoint Designer are generally referred to as customizations, instead of development, because tasks performed in SharePoint Designer require you to create or edit SharePoint items declaratively, instead of using server-side code. (Some tasks you perform in SharePoint Designer can employ client-side scripting.)
You should be aware of an important aspect of SharePoint Designer customization: When you are using SharePoint Designer, you are editing directly against the selected SharePoint Online site. This differs from SharePoint solution development in Visual Studio 2010, where you create and debug your solution on a local SharePoint installation, and then deploy the completed solution to the solution gallery in SharePoint Online.
SharePoint Designer is available as a free download from Microsoft. For more information, including system requirements, see Microsoft SharePoint Designer 2010 (32-bit).
SharePoint Designer Customization Areas
The business solutions you can create in SharePoint Online by using SharePoint Designer fall into the following main types of solutions.
- Interactive data-rich user interfacesWith SharePoint Designer 2010, you can create powerful and dynamic user interfaces for your SharePoint data, and you can make them available in many places, including your SharePoint site and custom windows, panes, and fields in Microsoft Office business applications.
The interfaces that you can create include custom views, forms, Web Parts, navigation, and custom Office client windows and task panes. This kind of flexibility enables you to create completely customized user experiences of your business data.
You might combine multiple data sources into a single view, create dashboards with related item views, design custom forms tailored to individual roles, and customize the available toolbars and Server ribbon commands associated with the data.
- Declarative workflows for managing business processesEvery business process in an organization consists of a set of activities that are connected based on a common business need. SharePoint declarative workflows are designed around this model by providing rules-based workflows that consist of sets of conditions and actions. You organize and run a series of actions that correspond to a work process that is based on a sequence of conditions and actions.
By using SharePoint Designer 2010, you can create declarative, rules-based workflows that manage the business processes in an organization. Workflows automate both business application processes and human collaborative processes. Workflows for business application processes might update one data source when another data source changes; and workflows for human collaborative processes might send a document to an employee’s manager for approval.
The declarative workflows you can build in SharePoint Designer introduce application logic to your business processes without requiring you to write code. This is made possible by the workflow designer in SharePoint Designer 2010, which allows nested logic, substeps, and more. Alternatively, you can design and share workflows by using Microsoft Visio 2010 with its flowchart templates that can be exported to SharePoint Designer 2010.
- Connections to data that is inside or outside of SharePointWith SharePoint Designer 2010, you can connect to numerous data sources, and then integrate that data into your site and Office client applications. Your users, as a result, can see and interact with business data on your site and from within the programs you choose instead of connecting to those data sources separately.
Directly from the ribbon, you can connect to an external database, SOAP service, REST (Representational State Transfer) service, and more. Connecting to data sources is a powerful feature of SharePoint Designer 2010 because there are so many supported options you can use to make data available to your users. With data connections, you can bring together lists and libraries, external databases and data sources via OLE DB or ODBC protocols, XML web services via SOAP, and more.
|Currently in SharePoint Online, you cannot connect external business data sources by using the Microsoft Business Connectivity Services (BCS) framework.
- Designed and branded sitesThe final area of customization provided by SharePoint Designer 2010 is design and brand—that is, taking a consistent look and feel and applying it to your SharePoint site. You can incorporate a company logo, color scheme, headers and footers, supporting graphics, custom navigation, and more. As a result, every page on the site can be immediately recognized as a part of a larger corporate site. In SharePoint Designer 2010, you design and brand SharePoint sites by using master pages, page layouts, and cascading style sheets.
Designing and branding a site is different from the other pillars of customization, where the focus is on creating custom business solutions. Branding is something you generally perform less often and at the top of a site collection. That custom brand is then inherited by the site collection’s subsites. The branding effort is also likely to be performed by a web designer instead of a solution creator.
For these reasons, master pages, page layouts, and cascading style sheets are disabled by default for all users except SharePoint Online administrators. In this way, only those responsible for the site brand have access to these powerful, yet sensitive files. You can re-enable them for specific users.
Restricting Access to SharePoint Designer
The SharePoint Online administrator has the ability to restrict the tasks for which other users can employ SharePoint Designer. The SharePoint Online administrator can do the following:
- Restrict who can detach pages from the site definition
- Restrict who can edit master page and page layouts
- Restrict who can edit files in URL site hierarchy
- Prevent the use of SharePoint Designer 2010 to edit sites
Deploying Custom SharePoint Solutions
SharePoint Designer includes functionality that enables you to package the SharePoint items you have created and edited, so that you can deploy them to another server or across the enterprise, or open them in Visual Studio 2010 for additional development. The Save as Template feature enables you to save a solution as a SharePoint solution package (.wsp) file. You determine what is saved in the .wsp file. It can contain the entire contents of your site, including data sources and structure, views and forms, workflows, and Web Parts, or you can save individual components, such as a list, a view, or a workflow.
This ability to save SharePoint items in .wsp files that can be opened in Visual Studio 2010 means that a designer can create the SharePoint items in the familiar, intuitive SharePoint Designer interface and then hand it off to a developer for further development in Visual Studio 2010, a tool that developers are familiar with. Or, if you are a developer, you can use SharePoint Designer for rapid application development, knowing you do not have to redo your work because you can easily port it to Visual Studio 2010.
Read More About Customizing SharePoint Online Using SharePoint Designer 2010
Developing SharePoint Online Solutions
SharePoint Online introduces the concept of the SharePoint Online administrator. The SharePoint Online administrator is the user who has permissions to perform administrative tasks for a company’s sites within SharePoint Online. (This is in contrast to farm administration duties, which in SharePoint Online are performed by Microsoft.) Because SharePoint Online administrators own and administer site collections in SharePoint Online, instead of entire farm installations, the development approach to SharePoint Online is necessarily scoped to the site collection. Because of this, two developer features form the foundation of developing for SharePoint Online:
- Sandboxed solutions A specialized type of the SharePoint solutions framework, sandboxed solutions provide a framework for developers to create, and for SharePoint Online administrators to upload and activate, custom code solutions to SharePoint Online. Sandboxed solutions run in an environment that has access to a core subset of the server object model. The sandboxed solutions framework gives developers access to the major objects at and below the site collection level.
Figure 1 shows these development options: use the server object model available to sandboxes solutions, or employ the client object model and client-side code to access additional data that is available through the SharePoint web services, or data from external sources.
Figure 1. SharePoint Online development options
Notice that the SharePoint Web Part actually runs in SharePoint Online. However, the client-side code it references is downloaded to and executes on the client, employing the SharePoint client object model to connect back to SharePoint Online for data transfer.
Sandboxed Solutions in SharePoint Online
For SharePoint Online development, you use the same framework to package and deploy your custom-coded solutions that you would for an on-premises SharePoint installation: the solutions framework. When developing for SharePoint Online, you create a specific type of solution, known as a sandboxed solution. A sandboxed solution enables SharePoint Online administrators to upload their own custom code solutions.
A sandboxed solution works in much the same way as a farm (full-trust) solution. For example, sandboxed solutions enable you to bundle all the components that can be used to extend SharePoint Online into a single new file, which is called a solution file. A sandboxed solution is a deployable, reusable package that can contain a set of Features, site definitions, and assemblies that apply to sites, and that you can enable or disable individually. You can use the sandboxed solution file to deploy the contents of a Web Part package, including assemblies, class resources, Web Part description (.dwp) files, and other package components.
Sandboxed solutions differ from farm solutions primarily in how they are deployed, and the extent of access they have to the server object model. As mentioned earlier, sandboxed solutions run in a separate process that has access to a core subset of the server object model. A solution gallery is used to store all sandboxed solutions.
In addition, sandboxed solutionsare assigned a custom code access security (CAS) policy with the following permissions:
For more information about CAS policies, see Using Code Access Security with ASP.NET and Security Guidelines: .NET Framework 2.0.
Components Available in Sandboxed Solutions
You can include the following programmatic or declarative items in your sandboxed solutions:
- Code components:
- Feature receivers
- Event receivers
- Web Parts (if derived from the WebPartclass)
|To use Visual Studio 2010 to create visual Web Parts that can be deployed as part of a sandboxed solutions, you must first install the Visual Studio 2010 SharePoint Power Tools. These tools are a a set of templates and extensions that provides additional functionality to SharePoint developers, and contain an item template that enables you to use a visual designer to create SharePoint Web Parts that can be deployed in a sandboxed solutions.
- Microsoft InfoPath forms logic
- SharePoint Designer workflow activities
- Sandboxed solutions workflow activities
- Declarative components:
- Declarative workflows
- Content types, site columns
- Lists and list definitions
- Visual and nonvisual Web Parts
- Custom actions, ribbon extensions
- Client-side technologies
- Web templates, site pages, page layouts, and master pages
The following capabilities and elements are not supported in sandboxed solutions:
- Access to the Internet to make web service calls
- Access to a hard disk to read or write filesYou can, of course, read and write to lists and libraries within SharePoint Online.
- Web application-scoped or farm-scoped Features
- Adding assemblies to the global assembly cache
- Running security-related functionality; for example, RunWithElevatedPrivileges or other SPSecurity methods
- Custom Action groups
- HideCustomAction element
- Content type binding
- Web Part connections
SharePoint Online Solution Development Process
The following are the basic steps in the process of creating, deploying, and activating a sandboxed solution on SharePoint Online:
- Develop and test the solution.To create or customize SharePoint Online solutions, you must develop the solution on a local computer where SharePoint Server 2010 or SharePoint Foundation 2010 is installed. This includes debugging the solution; you will not be able to debug the solution directly on SharePoint Online.
After you set up your development environment, you can use Visual Studio 2010 to create your sandboxed solutions. As a tool for promoting rapid development of SharePoint solutions, Visual Studio 2010 provides such features as advanced debugging tools, IntelliSense, statement completion, and project templates. Visual Studio 2010 provides a range of specialized templates for creating SharePoint items to include in your sandboxed solutions, such as site and list definitions, workflows, Web Parts, event receivers, and content types. In addition, Visual Studio 2010 can open and edit solution package (.wsp) files that are created in SharePoint Designer 2010, enabling designers and developers to tightly collaborate on solutions through a common framework.
For more information about setting up your development environment, including hardware recommendations, operating system and Hyper-V options, and prerequisites, see Setting Up the Development Environment for SharePoint 2010 on Windows Vista, Windows 7, and Windows Server 2008.
For information about how to use and customize Visual Studio 2010 to maximize your efficiency, see Using Visual Studio for SharePoint Development.
- Deploy and activate the solution.After you create and debug your sandboxed solutions on your local computer, you must hand that solution off to your SharePoint Online administrator, if you do not have SharePoint Online administration permissions. The SharePoint Online administrator uploads the solution package (.wsp) file to the Solution Gallery for activation.
For more information, see Deploying a Sandboxed Solution.
To make the solution available to users, you must activate it. If your sandboxed solution package contains a Feature that is scoped to the site collection level, it is activated automatically. Any Feature that is scoped to the site level must be activated on the Manage site features page located at
- Monitor the activitated solution.Activated solutions are monitored in terms of the resources they consume. Solution performance can be monitored by using multiple types of measures including CPU execution time, memory consumption, and database query time.
Figure 2 shows the main steps of the sandboxed solution development process for SharePoint Online.
Figure 2. Sandboxed solution development in SharePoint Online
Additional Solution Restrictions in SharePoint Online
Because it is a multi-tenant environment, when you upload a sandboxed solution to the Solution Gallery, SharePoint Online performs a further round of validation checks, in addition to those performed by on-premise SharePoint installations. A sandboxed solution cannot be activated if it contains code calling any of the following namespaces:
In addition, the following types and members cannot be called from code in a sandboxed solution in SharePoint Online:
Read More About Sandboxed Solutions
Accessing SharePoint Data Through the Client Object Models
SharePoint Online includes three client object models, each of which provides roughly the same subset of the server object model that is defined in Microsoft.SharePoint.dll. The ECMAScript, .NET Framework managed, and Silverlight client object models each include objects that correspond to major objects at the site-collection level or lower in the SharePoint hierarchy. The object models provide a consistent and easy-to-use, object-oriented system for interoperating with SharePoint data from a remote client or server.
Because code written against the client object models runs remotely on the client, it is not subject to the same restrictions as sandboxed solutions, and can, for example, access external data sources.
To improve security and performance, the client object models contain only the most relevant APIs for client development, not all the types and members that are represented in the server object model. 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. In addition, the new APIs are designed to minimize the number of roundtrips that must be implemented for common actions.
Figure 3. SharePoint client object model architecture
The client object models share structural design traits, such as object model hierarchy, object identity, data retrieval semantics, client context, infrastructural client objects, collections, and exception handling. The object models are consistent with the server object model. So, if you are familiar with the server-side API, you can quickly learn to use the client .NET Framework managed, Silverlight, or ECMAScript API. In addition, the client object models generally have parity with each other, so when you learn one subset of the server object model, you have also learned most of the other subsets.
Programs running on the client, and using one of the client object models, can add and remove lists, add, update, and delete list items, modify documents in document libraries, create sites, manage permissions of items, add and remove Web Parts from a page, and much more.
Some supported development areas include:
- Site collections and sites
- Lists, list items, views, and list schemas
- Files and folders
- Web, list, and list item property bags
- Web Parts
- Content types
- Site templates and site collection operations
Using the Silverlight Client Object Model in SharePoint Online
You can use Silverlight, and the Silverlight client object model, to create rich, sophisticated applications within SharePoint Online. You can host your Silverlight (.xap) application in its own ASPX page, or in a Web Part. SharePoint Online includes a default Silverlight Web Part, or you can create a custom Web Part as part of a sandboxed solution.
To use the SharePoint Silverlight object model within a Silverlight Web Part, you can create a Silverlight application in Visual Studio 2010, and add your code to the Page class in the default Page.xaml.cs file of your project. After you build your project, upload the project’s application package (.xap) file to any document library you choose. Insert a Silverlight Web Part into a Web Parts page and point the URL source of the Web Part to the .xap file’s path location in the document library. The Web Part can contain custom properties that are sent to Silverlight via the InitParameters property.
Use forms-based authentication (FBA) to authenticate users against SharePoint Online.
In addition, you can use Visual Studio 2010 to create a single solution (.wsp) file that performs the following actions when deployed and activated:
- Deploys a Web Part, based on the default Silverlight Web Part, to host your Silverlight application
- Deploys the Silverlight application package (.xap) file, packaged as a module, to the specified document library location
- Creates pages, which contain your Web Part embedded in them, in the site pages collection
After the solution is activated, the user can navigate to the created pages and interact with the Web Part hosting the Silverlight application. The application itself can make use of the SharePoint Silverlight object model to access SharePoint Online data remotely, even though it appears to the user to be hosted within SharePoint Online.
Using the ECMAScript Object Model in SharePoint Online
You can employ the ECMAScript object model in SharePoint Online in a similar way. You can include custom code that uses the ECMAScript object model within a script block on an .aspx page, or you can create a separate .js file to include your code and reference it from the .aspx page. For more information, see Setting Up an Application Page for ECMAScript.
Read More About SharePoint Client Object Models
SharePoint Web Services Available in SharePoint Online
Table 1 lists the default Web services that are available in SharePoint Online. Although these, as with any external data connection, are not available for use in sandboxed solutions, you can access them through client applications such as Silverlight and ECMAScript.
Table 1. Web services available in SharePoint Online
||Provides methods for working with alerts for list items in a SharePoint site.
||Provides services for copying files within a SharePoint site and between SharePoint sites.
||Provides methods for managing Document Workspace sites and the data they containThe following method is not available in SharePoint Online:
||Provides methods that enable you to create and manage picture libraries.
||Provides methods for working with SharePoint lists, content types, list items, and files.The following method is not available in SharePoint Online:
||Provides methods that enable you to create and manage Meeting Workspace sites.
||Provides methods for associating user identifiers (IDs) with security groups for site permissions.
||Provides methods for working with the permissions for a site or list.
||Provides methods that return metadata or list data from sites or lists.
||Provides methods for returning information about the site templates for a site collection
||Provides methods for accessing Search results from client applications and web applications outside of the context of a SharePoint site.
||Provides methods for working with users and groups.
||Provides methods for working with file versions in SharePoint document libraries.
||Provides methods for creating, deleting, or updating list views in SharePoint Online.
||Provides methods for working with Web Parts.The following methods are not available in SharePoint Online:
||Provides methods for working with sites and subsites.The following method is not available in SharePoint Online:
SharePoint REST Interface
SharePoint Online also includes a Representational State Transfer (REST) interface that provides access to lists and libraries as a relational data service. A core concept of any RESTful interface is the resource, and in SharePoint Online, lists and items are represented as HTTP resources that can be addressed by remote URLs.
Operations in the SharePoint REST interface constitute a standard set of operations for RESTful web services. Read, Create, Update, and Delete operations are mapped directly to GET, POST, PUT, and DELETE HTTP verbs, which eliminates the need for intermediate layers between client and server.
The REST interface uses flexible URL conventions for querying data, which enable you to filter, sort, and select information from SharePoint lists directly from the browser. You can also retrieve information from SharePoint lists through multiple representations, including support for JSON, Atom, and AtomPub standards.
For more information, including example URLs that implement the REST interface, see SharePoint Foundation REST Interface.
Developers can also access the Excel Services REST API in SharePoint Online. This API enables developers to access workbook parts or elements directly through a URL. This allows for a flexible, secure, and simpler mechanism to access and manipulate Excel Services content.
The discovery mechanisms built into the Excel Services REST API also enable developers and users to explore the content of the workbook manually or programmatically by supplying an Atom feed that contains information about the elements that reside in a specific workbook. Some examples of the resources that you can access through the REST API are charts, PivotTables, and tables.
Using the Atom feed provided by the REST API is an easier way to get to the data that you care about. The feed contains traversable elements that enable any piece of code to discover what elements exist in a workbook.
For more information, see Excel Services REST API.
Comparison of SharePoint Online Features and SharePoint Server Features
The following table lists the developer features available in SharePoint Online, as compared to those available in SharePoint Server 2010.
Table 2. Developer Features Comparison: SharePoint Online and SharePoint Server 2010
||SharePoint Server 2010 (on-premises)
|SharePoint Designer customization
||Create data-rich interfacesManage business processes through workflow
Connect to data inside and outside of SharePoint
Design and brand
|Create data-rich interfacesManage business processes through workflow
Connect to data inside and outside of SharePoint
Design and brand
Business Connectivity Services
||Farm solutionssandboxed solutions
|Client Object Models
||Silverlight.NET Framework managed
|Silverlight.NET Framework managed
|Silverlight Web Part
||Subset of .NET SharePoint web servicesREST API
Excel Services REST API
|All .NET SharePoint web servicesREST API
Excel Services REST API
||sandboxed solutions forms
||sandboxed solutions formsAdministrative forms
||Declarativesandboxed solutions workflow activities
||Declarativesandboxed solutions and farm workflow activities
SharePoint Online provides a compelling and flexible option for companies that want the powerful collaborative platform of SharePoint, without the operational costs that come with hosting software on-premises. And it delivers a robust, flexible development surface for developers.
This article provides a brief overview of the development options available to developers in SharePoint Online. For more information about a particular area, follow the links in this article. Also, visit the SharePoint Online Developer Resource Center frequently for updated links to more resources, including articles, training, and videos.
For more information, see the following resources:
SharePoint Designer Resources
Sandboxed Solution Resources
Client Object Model Resources