ebook img

Pro Office 365 Development: Second Edition PDF

366 Pages·2014·18.637 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Pro Office 365 Development: Second Edition

BOOKS FOR PROFESSIONALS BY PROFESSIONALS® Collins Mayberry Pro Office 365 Development Pro Office 365 Development, Second Edition, is a practical, hands-on guide to RELATED building applications for the cloud with Office 365. Combine Office 365 features out of the box with custom code to make the most of what this increasingly powerful and flexible platform has to offer. As an Office 365 developer, you have an amazing range of technologies at your fingertips. Build custom SharePoint apps in Visual Studio using HTML5, CSS, and jQuery. Create declarative workflow applications with Visio and SharePoint Designer. Use Access Web Database to publish your data on the web, or write Exchange and Lync applications. All these possibilities and more are covered. You also have unprecedented control and flexibility over how you use these technologies in your applications. With a powerful set of Office 365 APIs, you can now access and integrate Office 365 data directly into your web or native applications, with full control of authentication, authorization and discovery. No prior cloud experience is necessary. Sample projects are designed to bring the reader up-to-speed quickly, with full step-by-step instructions to maximize your success across the whole Office 365 suite. Whether you want to build desktop client applications or browser-only solutions, Pro Office 365 Development will show you how to do it. In this book, you’ll learn to: • Build a public website using the authoring environment provided by Office 365 • Implement declarative workflows in SharePoint • Build your own cloud connector for SharePoint, Exchange and Lync • Develop integrated applications using the new Office 365 APIs Shelve in ISBN 978-1-4842-0245-6 Applications/MS Office 54999 User level: SECOND Intermediate EDITION SOURCE CODE ONLINE 9781484202456 www.apress.com For your convenience Apress has placed some of the front matter material after the index. Please use the Bookmarks and Contents at a Glance links to access them. Contents at a Glance About the Authors ���������������������������������������������������������������������������������������������������������������xv About the Technical Reviewer ������������������������������������������������������������������������������������������xvii Acknowledgments �������������������������������������������������������������������������������������������������������������xix Introduction �����������������������������������������������������������������������������������������������������������������������xxi ■ Chapter 1: Introducing Office 365 for Developers �������������������������������������������������������������1 ■ Chapter 2: Creating Your Web Presence ��������������������������������������������������������������������������23 ■ Chapter 3: Developing SharePoint Apps in Visual Studio ������������������������������������������������59 ■ Chapter 4: Creating Declarative Workflows with Visio and SharePoint Designer ���������103 ■ Chapter 5: Creating a Web Database with Access 2013 ������������������������������������������������157 ■ Chapter 6: Developing Exchange Online Solutions ��������������������������������������������������������211 ■ Chapter 7: Developing Lync Applications ����������������������������������������������������������������������233 ■ Chapter 8: Consuming Data with Office 365 APIs ���������������������������������������������������������253 ■ Chapter 9: Authentication, Authorization, and Discovery Service ���������������������������������267 ■ Chapter 10: Integrating Office 365 Technologies with REST APIs and MVC ������������������287 ■ Appendix A: SharePoint Primer �������������������������������������������������������������������������������������325 ■ Appendix B: SharePoint Designer’s Text-Based Workflow Editor ����������������������������������337 Index ���������������������������������������������������������������������������������������������������������������������������������345 v Introduction Office 365 brings together a fully integrated suite of office automation tools including the key server components – SharePoint, Exchange, and Lync. Volumes have been written on each of these products. In addition, there is an impressive list of client applications that can be leveraged including: • Access • Excel • Visio • SharePoint Designer • Visual Studio There is so much that you can do with this platform that it’s not possible to cover every aspect in a single book. However, we have tried to pack in as much as possible and demonstrate the features that will be most useful. The topics cover a wide range of subjects, including web databases, declarative workflows, custom Lync and Exchange applications, and public-facing web sites. How This Book Is Structured Each chapter presents a solution that leverages one or more features of the Office 365 platform using one of the various development tools that are available to you. These were carefully chosen to demonstrate a good cross-section of the platform capabilities as well as presenting a broad overview of the toolset. Chapter 1 provides an overview of the Office 365 platform, explaining the various server and client components. In Chapter 2 you’ll use the site designer to create a public-facing web site. Chapters 3, 6, and 7, use Visual Studio 2013 to build custom applications. In Chapter 3 you’ll create a SharePoint app using HTML, CSS, and JavaScript. Chapters 6 and 7 each create a WPF app that show you how to build custom Exchange and Lync applications, respectively. Chapter 4 takes you through the process of creating a workflow application using Visio and SharePoint Designer. This also demonstrates some of the key SharePoint concepts such as content types. In Chapter 5, you’ll use Access 2013 to create a web-enabled database application. In the final three chapters, we’ll explain how to use the new REST APIs to integrate the data in your Office 365 site with a wide-range of client applications. This API provides a uniform developer experience when accessing cloud-based SharePoint, Exchange, and Lync servers. Each chapter invites you to work through the exercise yourself with step-by-step instructions. You can simply read the chapter and learn a great deal. But following along yourself will be even more beneficial. During this process we’ll explain some of the hows and whys. xxi ■ IntroduCtIon Prerequisites To work through the exercises in this book you will need an Office 365 account. A few of the solutions will require one of the Enterprise plans but most can be implemented on any plan. Some of the chapters will require additional Office products such as Access or Excel. These are included with some of the Office 365 plans and can be added to others for a monthly fee. ■ Tip You can get a free 30-day trial subscription for either the small Business or enterprise plan. If you need more time you can generally get a 30-day extension. Also, the small Business plan is a monthly subscription and you can cancel it at any time. You will also need Visual Studio 2013 to work through the coded solutions. Some of the exercises require other free products and these will be explained in the appropriate chapters. xxii Chapter 1 Introducing Office 365 for Developers Office 365 provides lots of opportunities for developers to build custom applications. In this book, we’ve selected some of the most useful development technologies such as Visual Studio, SharePoint Designer, and Access. We’ve also chosen some of the more common customization scenarios including workflows, SharePoint lists, Exchange and Lync integration, and web databases. Each chapter then pairs these together to demonstrate how to build a working application. Our goal is to present a fairly broad spectrum of both tool sets and applications so you’ll have a good sense of what you can accomplish in an Office 365 environment. Before you dive into developing some nifty applications on Office 365, we want to first explain what Office 365 is and how it works. Office 365 Architecture Office 365 is an interesting collection of both server and client applications that allows you to experience a fully integrated Office solution. This is provided as a hosted solution, which requires little or no IT infrastructure. Traditional Office Server Environment To fully explain Office 365, I need to start by describing the traditional on-premise Office server environment. If you had an unlimited budget and installed all of the Office server products, your network might look something like Figure 1-1. 1 Chapter 1 ■ IntroduCIng offICe 365 for developers Figure 1-1. The traditional Office server environment You would have • An Exchange server to handle incoming and outgoing e-mails. • One or more file servers for storing documents. • A SharePoint server for collaboration features such as shared documents and task lists. • A Lync server to support instant messaging and online meetings. For larger organizations you would likely cluster these servers to provide redundancy as well as increased capacity. So instead of a single Exchange server, for example, you might have two or more. You may also need to support geographically distributed scenarios. You can see that the number of servers you would need could become extensive. You would also have a public-facing web site for your online presence. This would provide basic content for your customers such as details provided on the Contact Us page; your company’s mission statement, core values, products, or services offered; company history; and so on. On each of the client workstations you would install the Office client applications such as Outlook, Word, Excel, and One Note. To support remote users, you would need to provide a virtual private network (VPN), which would allow them to connect into your network and work just like the local users. You would also need to allow for the growing use of mobile devices. The Office 365 Environment All of the functionality described in Figure 1-1 can be easily provisioned on Office 365. The same feature set implemented on Office 365 would look like Figure 1-2. 2 Chapter 1 ■ IntroduCIng offICe 365 for developers Figure 1-2. The Office 365 solution The most obvious change in this environment is that the servers have been moved to a hosted environment. Instead of an on-site server running Exchange Server 2013, for example, you’ll use Exchange Online 2013, which is hosted on a remote server farm. These online versions of the Office server products are implemented with the same code base as their on-site counterparts. When you set up an Outlook client, you must specify the location of the Exchange server. In an Office 365 environment, you provide the URL that was specified when your Office 365 account was created. The fact that the server is now hosted off-site is essentially transparent. You can send and receive e-mails, check the calendars of team members, and schedule meetings just like you would in a traditional on-site Exchange solution. The file servers are removed from this diagram because the SharePoint server is used for this purpose. The document libraries in SharePoint are a great place to store most of your files for both on-premise and browser-based users. ■ Note there are some limitations regarding the size of files you can store on office 365. for more details, see the article at http://office.microsoft.com/en-us/sharepoint-online-enterprise-help/sharepoint-online-soft- ware-boundaries-and-limits-HA102694293.aspx. There are a couple of really nice benefits that are inherent in a cloud-based solution: support for remote users and role-based access. Notice that there is no VPN support in Figure 1-2 because it is not needed. Clients access the Office 365 servers (Exchange Online 2013, SharePoint Online 2013, and Lync Online 2013) through an Internet connection. Office 365 doesn’t care whether you are connecting from work, your home, the public library, or your favorite coffee shop. 3 Chapter 1 ■ IntroduCIng offICe 365 for developers ■ Note You will need to be authenticated in order to access these servers, which is typically done through a login and password. If you are on an active directory domain, you can synchronize your ad users with office 365, which will enable a single sign-on to your domain. once authenticated in ad, you can access office 365 without supplying your credentials. Providing access to remote users in Office 365 is really easy. There’s no need for VPN software or firewalls. Best of all, there’s no threat of a remote user infecting your network with viruses or malware because they are not connected to your network. The other inherent benefit is a little more subtle. In the network described in Figure 1-1, a public-facing web site was implemented using a dedicated web server that is separated from your internal network with a firewall. This is a standard practice that provides protection from someone hacking into the web server and accessing the internal network. In Office 365, the public-facing web site is implemented as a SharePoint site hosted on the same SharePoint Online server that is hosting your internal sites. In a hosted environment, a SharePoint farm will contain potentially hundreds of sites. This is referred to as a multi-tenant environment. So how does [email protected] have access to their site while [email protected] does not? Providing separation of customer data is a core competency of hosting services. It is accomplished through advanced technology, including Active Directory, state-of-the-art anti-virus solutions, and continual monitoring and auditing. As a result, you can create a public-facing SharePoint site that non-authenticated users can access while your internal sites are kept safely hidden. You can create multiple sites and configure each user’s access using role-based security. Office 365 Client Applications In addition to hosting the server components you can also use the web-based Office applications. Your e-mails, for example, are stored in the Exchange Online server and you can access them either through the Outlook client application or the Outlook Web App that is available in the Office 365 environment. You can configure this differently for each user. You can also use both. A typical configuration would use the Outlook application from an on-site PC while using the web app from a remote laptop or mobile device, as demonstrated in Figure 1-3. 4 Chapter 1 ■ IntroduCIng offICe 365 for developers Figure 1-3. Accessing Exchange Online The key point to remember here is that the data is stored in the cloud. Whichever application you use, it is accessing the same data. ■ Tip In Chapter 6, we will show you how to build your own custom e-mail client. While the user experience will be different, the data resides on the server and can still be accessed through the other e-mail client applications. Office 365 also provides a lightweight web-based version of Word, Excel, OneNote, and PowerPoint, called Office Web apps. These have a limited feature set compared to their client-based counterparts but read and write files in the same format. This allows you to create, view, and edit a file using the web app and then open it with the client application to perform advanced editing capabilities. Other users can then view the modified documents. Storing Documents in SharePoint Office 365 is designed to support browser-only clients. In this configuration there are no local applications; the client is simply a web browser. The benefit of this approach from an IT perspective is that there is no software to install or maintain and no data that needs to be backed up. From an application perspective, this means that all your documents must be stored in the cloud. Office uses SharePoint Online as the document repository. When you create documents using the web apps, Office 365 automatically stores them in a document library on the SharePoint site. You can set up multiple document libraries configuring different levels of access to each. Libraries can also contain a hierarchy of subfolders so you can 5

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.