Pro office 365 development, 2nd edition

366 145 0
Pro office 365 development, 2nd edition

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

www.it-ebooks.info 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 www.it-ebooks.info 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 www.it-ebooks.info 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 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 provides an overview of the Office 365 platform, explaining the various server and client components In Chapter 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 you’ll create a SharePoint app using HTML, CSS, and JavaScript Chapters and each create a WPF app that show you how to build custom Exchange and Lync applications, respectively Chapter 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 www.it-ebooks.info ■ 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 www.it-ebooks.info Chapter 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 www.it-ebooks.info Chapter ■ 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 www.it-ebooks.info Chapter ■ 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-software-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 www.it-ebooks.info Chapter ■ 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 someone@companyA.com have access to their site while someone@companyB.com 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 www.it-ebooks.info Chapter ■ 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 www.it-ebooks.info ■ index Windows Azure, Windows presentation foundation (WPF), 211 Workflow creation content types, 137 approval task, 138 customization section, 142 fulfillment task, 139 Request group, 140 site columns, 140 Tasks lists, 145 testing, 153 Text-Based Designer, 146 variables, 147 implementation approved request, 128 configuration, 131 custom links, 121 properties dialog, 125 rejected request, 126 running Visio, 120 task process, 129 (see also Task process) text-based designer, 130 testing approval task, 135 e-mail approval, 137 publishing, 132 request list, 134 task section, 136 updated request, 135 workflow instance, 136 Visio benefits, 111 configuration, 119 diagram, 155 HR prescreening stage, 115 intake stage, 114 parallel processing, 115 pre-defined actions, 116 process tab, 113 Request process, 117 single stage diagram, 113 stages, 113 templates, 111 Workflow Editor Components actions, 338 App Step feature, 340 conditions, 339 creation, 337 insertion point, 341 Lookup dialog box, 343 Loop action, 340 Message dialog box, 344 parameters, 342 stages and steps, 339 String Builder dialog box, 343 Workflows ribbon, 340 350 www.it-ebooks.info Pro Office 365 Development Second Edition Mark J Collins Michael Mayberry www.it-ebooks.info Pro Office 365 Development Copyright © 2014 by Mark J Collins and Michael Mayberry This work is subject to copyright All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed Exempted from this legal reservation are brief excerpts in connection with reviews or scholarly analysis or material supplied specifically for the purpose of being entered and executed on a computer system, for exclusive use by the purchaser of the work Duplication of this publication or parts thereof is permitted only under the provisions of the Copyright Law of the Publisher’s location, in its current version, and permission for use must always be obtained from Springer Permissions for use may be obtained through RightsLink at the Copyright Clearance Center Violations are liable to prosecution under the respective Copyright Law ISBN-13 (pbk): 978-1-4842-0245-6 ISBN-13 (electronic): 978-1-4842-0244-9 Trademarked names, logos, and images may appear in this book Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made The publisher makes no warranty, express or implied, with respect to the material contained herein Managing Director: Welmoed Spahr Lead Editor: Gwenan Spearing Development Editor: Douglas Pundick Technical Reviewer: Sahil Malik Editorial Board: Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell, Louise Corrigan, Jim DeWolf, Jonathan Gennick, Jonathan Hassell, Robert Hutchinson, Michelle Lowman, James Markham, Matthew Moodie, Jeff Olson, Jeffrey Pepper, Douglas Pundick, Ben Renow-Clarke, Dominic Shakeshaft, Gwenan Spearing, Matt Wade, Steve Weiss Coordinating Editor: Melissa Maldonado Copy Editor: Lori Cavanaugh Compositor: SPi Global Indexer: SPi Global Artist: SPi Global Cover Designer: Anna Ishchenko Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013 Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc) SSBM Finance Inc is a Delaware corporation For information on translations, please e-mail rights@apress.com, or visit www.apress.com Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use eBook versions and licenses are also available for most titles For more information, reference our Special Bulk Sales–eBook Licensing web page at www.apress.com/bulk-sales Any source code or other supplementary material referenced by the author in this text is available to readers at www.apress.com For detailed information about how to locate your book’s source code, go to www.apress.com/source-code/ www.it-ebooks.info To my precious wife, Donna—Every day with you is a treasured gift! —Mark J Collins To Camille—yesterday brings happiness, today excites, and tomorrow stirs anticipation —Michael Mayberry www.it-ebooks.info Contents About the Authors��������������������������������������������������������������������������������������������������������������� xv About the Technical Reviewer������������������������������������������������������������������������������������������ xvii Acknowledgments������������������������������������������������������������������������������������������������������������� xix Introduction����������������������������������������������������������������������������������������������������������������������� xxi ■■Chapter 1: Introducing Office 365 for Developers�������������������������������������������������������������1 Office 365 Architecture�����������������������������������������������������������������������������������������������������������������1 Traditional Office Server Environment������������������������������������������������������������������������������������������������������������������� The Office 365 Environment���������������������������������������������������������������������������������������������������������������������������������� Office 365 Client Applications�������������������������������������������������������������������������������������������������������������������������������� Storing Documents in SharePoint�������������������������������������������������������������������������������������������������������������������������� Office 365 and Windows Azure������������������������������������������������������������������������������������������������������6 Office 365 Online Servers�������������������������������������������������������������������������������������������������������������7 SharePoint Online 2013����������������������������������������������������������������������������������������������������������������������������������������� Exchange Online 2013����������������������������������������������������������������������������������������������������������������������������������������� 16 Lync Online 2013������������������������������������������������������������������������������������������������������������������������������������������������� 18 Summary�������������������������������������������������������������������������������������������������������������������������������������21 ■■Chapter 2: Creating Your Web Presence��������������������������������������������������������������������������23 Designing a Web Site������������������������������������������������������������������������������������������������������������������23 Collecting the Content����������������������������������������������������������������������������������������������������������������������������������������� 23 Designing the Overall Site����������������������������������������������������������������������������������������������������������������������������������� 29 Modifying the Home Page����������������������������������������������������������������������������������������������������������������������������������� 36 Making the Website Public���������������������������������������������������������������������������������������������������������������������������������� 38 vii www.it-ebooks.info ■ Contents Advanced Editing�������������������������������������������������������������������������������������������������������������������������40 SharePoint Content���������������������������������������������������������������������������������������������������������������������������������������������� 40 Modifying the Style Sheet������������������������������������������������������������������������������������������������������������������������������������ 45 Employing Search Engine Optimization��������������������������������������������������������������������������������������������������������������� 47 Adding Videos������������������������������������������������������������������������������������������������������������������������������51 Creating a Video Library�������������������������������������������������������������������������������������������������������������������������������������� 51 Linking to a Hosting Service�������������������������������������������������������������������������������������������������������������������������������� 52 Uploading Your Own Videos��������������������������������������������������������������������������������������������������������������������������������� 54 Adding Videos to Your Page��������������������������������������������������������������������������������������������������������������������������������� 57 Summary�������������������������������������������������������������������������������������������������������������������������������������58 ■■Chapter 3: Developing SharePoint Apps in Visual Studio������������������������������������������������59 Enabling the Developer Feature��������������������������������������������������������������������������������������������������59 Creating a SharePoint List�����������������������������������������������������������������������������������������������������������63 Creating the Visual Studio Project����������������������������������������������������������������������������������������������������������������������� 63 Exploring the Project Elements���������������������������������������������������������������������������������������������������������������������������� 65 Adding a List�������������������������������������������������������������������������������������������������������������������������������������������������������� 67 Modifying the List Definition�������������������������������������������������������������������������������������������������������������������������������� 69 Modifying the Default Page��������������������������������������������������������������������������������������������������������������������������������� 76 Testing the App���������������������������������������������������������������������������������������������������������������������������������������������������� 78 Creating a Custom UI�������������������������������������������������������������������������������������������������������������������79 Creating a Book List App������������������������������������������������������������������������������������������������������������������������������������� 79 Implementing a Custom Page������������������������������������������������������������������������������������������������������������������������������ 86 Testing the App���������������������������������������������������������������������������������������������������������������������������������������������������� 90 Adding a Custom Ribbon�������������������������������������������������������������������������������������������������������������92 Creating a Custom App Part��������������������������������������������������������������������������������������������������������95 Adding a Client Web Part������������������������������������������������������������������������������������������������������������������������������������� 95 Designing the Web Part��������������������������������������������������������������������������������������������������������������������������������������� 97 Deploying and Configuring the Web Part������������������������������������������������������������������������������������������������������������� 99 Summary�����������������������������������������������������������������������������������������������������������������������������������101 viii www.it-ebooks.info ■ Contents ■■Chapter 4: Creating Declarative Workflows with Visio and SharePoint Designer���������103 Creating the Requests List��������������������������������������������������������������������������������������������������������104 Installing SharePoint Designer 2013����������������������������������������������������������������������������������������������������������������� 104 Connecting to your Office 365 Site�������������������������������������������������������������������������������������������������������������������� 105 Creating a Custom List�������������������������������������������������������������������������������������������������������������������������������������� 106 Using Visio to Define a Workflow�����������������������������������������������������������������������������������������������111 Designing a Workflow in Visio��������������������������������������������������������������������������������������������������������������������������� 111 Designing the Request Process Workflow��������������������������������������������������������������������������������������������������������� 117 Configuring the Workflow���������������������������������������������������������������������������������������������������������������������������������� 119 Implementing the Workflow������������������������������������������������������������������������������������������������������120 Configuring the Approval Task��������������������������������������������������������������������������������������������������������������������������� 121 Designing a Condition���������������������������������������������������������������������������������������������������������������������������������������� 125 Handling the Rejected Request������������������������������������������������������������������������������������������������������������������������� 126 Handling the Approved Request������������������������������������������������������������������������������������������������������������������������ 128 Understanding a Task Process��������������������������������������������������������������������������������������������������������������������������� 129 Using the Text-Based Designer�������������������������������������������������������������������������������������������������������������������������� 130 Configuring the Workflow Start Options������������������������������������������������������������������������������������������������������������ 131 Testing the Initial Workflow�������������������������������������������������������������������������������������������������������132 Publishing the Workflow������������������������������������������������������������������������������������������������������������������������������������ 132 Processing a Request���������������������������������������������������������������������������������������������������������������������������������������� 133 Reviewing the Results��������������������������������������������������������������������������������������������������������������������������������������� 136 Customizing the Workflow Tasks�����������������������������������������������������������������������������������������������137 Creating New Content Types������������������������������������������������������������������������������������������������������������������������������ 137 Modify the Assign Task Actions������������������������������������������������������������������������������������������������������������������������� 146 Testing the Revised Workflow���������������������������������������������������������������������������������������������������������������������������� 153 Updating the Visio Diagram�������������������������������������������������������������������������������������������������������155 Summary�����������������������������������������������������������������������������������������������������������������������������������155 ix www.it-ebooks.info ■ Contents ■■Chapter 5: Creating a Web Database with Access 2013������������������������������������������������157 Designing the Tables�����������������������������������������������������������������������������������������������������������������157 Data Model Overview���������������������������������������������������������������������������������������������������������������������������������������� 159 Creating the Customer Table����������������������������������������������������������������������������������������������������������������������������� 160 Creating the Phone Table����������������������������������������������������������������������������������������������������������������������������������� 163 Viewing the App in SharePoint�������������������������������������������������������������������������������������������������������������������������� 165 Creating the Address Table�������������������������������������������������������������������������������������������������������������������������������� 166 Creating the Product and Service Tables����������������������������������������������������������������������������������������������������������� 167 Creating the Job Table��������������������������������������������������������������������������������������������������������������������������������������� 168 Creating the JobProduct and JobService Tables����������������������������������������������������������������������������������������������� 168 Creating the Contact Table��������������������������������������������������������������������������������������������������������������������������������� 169 Creating the Queries������������������������������������������������������������������������������������������������������������������170 Implementing the qryJobProduct Query������������������������������������������������������������������������������������������������������������ 170 Implementing the qryJobService Query������������������������������������������������������������������������������������������������������������ 172 Creating the qryJobSummary Query����������������������������������������������������������������������������������������������������������������� 173 Implementing a Data Macro������������������������������������������������������������������������������������������������������175 Creating the Data Macro������������������������������������������������������������������������������������������������������������������������������������ 176 Using the Macro Editor�������������������������������������������������������������������������������������������������������������������������������������� 176 Computing the Job Total������������������������������������������������������������������������������������������������������������������������������������ 179 Updating the Job Table�������������������������������������������������������������������������������������������������������������������������������������� 183 Entering Test Data��������������������������������������������������������������������������������������������������������������������������������������������� 183 Calling the Named Macro���������������������������������������������������������������������������������������������������������������������������������� 185 Testing the Data Macro�������������������������������������������������������������������������������������������������������������������������������������� 185 Designing Forms�����������������������������������������������������������������������������������������������������������������������187 Exploring the Form Designer����������������������������������������������������������������������������������������������������������������������������� 188 Creating the Phone and Address Forms������������������������������������������������������������������������������������������������������������ 189 Creating the Product and Service Forms����������������������������������������������������������������������������������������������������������� 191 Creating New JobProduct and JobService List Form���������������������������������������������������������������������������������������� 194 x www.it-ebooks.info ■ Contents Modifying the Job Form������������������������������������������������������������������������������������������������������������������������������������� 198 Modifying the Customer Form��������������������������������������������������������������������������������������������������������������������������� 202 Creating a Job Summary Form�������������������������������������������������������������������������������������������������������������������������� 206 Summary�����������������������������������������������������������������������������������������������������������������������������������210 ■■Chapter 6: Developing Exchange Online Solutions��������������������������������������������������������211 Creating the Visual Studio Project���������������������������������������������������������������������������������������������211 Designing the Form������������������������������������������������������������������������������������������������������������������������������������������� 212 Preparing the Visual Studio Project������������������������������������������������������������������������������������������������������������������� 213 Connecting to Exchange with Autodiscover������������������������������������������������������������������������������216 Implementing the ExchangeDataContext Class������������������������������������������������������������������������������������������������� 216 Modifying the Code-Behind Class���������������������������������������������������������������������������������������������������������������������� 218 Accessing the Folder Contents��������������������������������������������������������������������������������������������������218 Retrieving Items from Exchange����������������������������������������������������������������������������������������������������������������������� 218 Displaying the Mailbox Items���������������������������������������������������������������������������������������������������������������������������� 219 Testing the Application�������������������������������������������������������������������������������������������������������������������������������������� 221 Checking Availability�����������������������������������������������������������������������������������������������������������������222 Retrieving the Availability Results��������������������������������������������������������������������������������������������������������������������� 223 Displaying the Results��������������������������������������������������������������������������������������������������������������������������������������� 224 Testing the Availability Feature�������������������������������������������������������������������������������������������������������������������������� 225 Subscribing to Notifications������������������������������������������������������������������������������������������������������226 Setting Up Pull Notification�������������������������������������������������������������������������������������������������������������������������������� 227 Using Streaming Notification����������������������������������������������������������������������������������������������������������������������������� 228 Testing the Subscription Functions������������������������������������������������������������������������������������������������������������������� 230 Summary�����������������������������������������������������������������������������������������������������������������������������������232 ■■Chapter 7: Developing Lync Applications����������������������������������������������������������������������233 Creating the Lync Application����������������������������������������������������������������������������������������������������234 Creating the Visual Studio Project��������������������������������������������������������������������������������������������������������������������� 234 Adding a Presence Indicator������������������������������������������������������������������������������������������������������������������������������ 236 Testing the Initial Application����������������������������������������������������������������������������������������������������������������������������� 238 xi www.it-ebooks.info ■ Contents Using Lync Controls�������������������������������������������������������������������������������������������������������������������239 Dynamically Adjusting the Presence Indicator�������������������������������������������������������������������������������������������������� 239 Searching for Contacts�������������������������������������������������������������������������������������������������������������������������������������� 243 Adding a Custom Contact List��������������������������������������������������������������������������������������������������������������������������� 244 Using Lync Automation��������������������������������������������������������������������������������������������������������������245 Adding the Docking Host Location��������������������������������������������������������������������������������������������������������������������� 245 Calling Lync Automation������������������������������������������������������������������������������������������������������������������������������������ 247 Testing the Application�������������������������������������������������������������������������������������������������������������������������������������� 251 Summary�����������������������������������������������������������������������������������������������������������������������������������252 ■■Chapter 8: Consuming Data with Office 365 APIs���������������������������������������������������������253 Introducing Office 365 APIs�������������������������������������������������������������������������������������������������������253 More Unified Data Consumption������������������������������������������������������������������������������������������������������������������������ 253 Expanded Application Development������������������������������������������������������������������������������������������������������������������ 254 A New Foundation���������������������������������������������������������������������������������������������������������������������254 New Discovery Service�������������������������������������������������������������������������������������������������������������255 Adding Office 365 APIs to a Visual Studio Project���������������������������������������������������������������������256 Client Libraries�������������������������������������������������������������������������������������������������������������������������������������������������� 256 Installing the Office 365 API Tools for Visual Studio 2013��������������������������������������������������������������������������������� 256 Adding Office 365 APIs to a Project������������������������������������������������������������������������������������������������������������������� 259 Summary�����������������������������������������������������������������������������������������������������������������������������������266 ■■Chapter 9: Authentication, Authorization, and Discovery Service���������������������������������267 Authentication and Authorization����������������������������������������������������������������������������������������������268 Azure Active Directory��������������������������������������������������������������������������������������������������������������������������������������� 268 Test Authentication Application in Visual Studio������������������������������������������������������������������������������������������������ 276 Authentication Uncovered��������������������������������������������������������������������������������������������������������������������������������� 280 Discovery Service����������������������������������������������������������������������������������������������������������������������282 Overview������������������������������������������������������������������������������������������������������������������������������������������������������������ 282 Summary�����������������������������������������������������������������������������������������������������������������������������������286 xii www.it-ebooks.info ■ Contents ■■Chapter 10: Integrating Office 365 Technologies with REST APIs and MVC������������������287 The Plan������������������������������������������������������������������������������������������������������������������������������������287 The Setup����������������������������������������������������������������������������������������������������������������������������������288 Products������������������������������������������������������������������������������������������������������������������������������������������������������������ 288 Sales Contacts��������������������������������������������������������������������������������������������������������������������������������������������������� 290 Sales Leads������������������������������������������������������������������������������������������������������������������������������������������������������� 292 The Sales Lead MVC Application�����������������������������������������������������������������������������������������������293 Create a New ASP.NET MVC Application������������������������������������������������������������������������������������������������������������ 294 Build MVC Application using Office 365 APIs����������������������������������������������������������������������������������������������������� 300 Summary�����������������������������������������������������������������������������������������������������������������������������������324 ■■Appendix A: SharePoint Primer�������������������������������������������������������������������������������������325 Columns������������������������������������������������������������������������������������������������������������������������������������325 Text Columns����������������������������������������������������������������������������������������������������������������������������������������������������� 326 Date & Time Columns���������������������������������������������������������������������������������������������������������������������������������������� 327 Person or Group Columns���������������������������������������������������������������������������������������������������������������������������������� 328 Choice Columns������������������������������������������������������������������������������������������������������������������������������������������������� 328 Lookup Columns������������������������������������������������������������������������������������������������������������������������������������������������ 329 Calculated Columns������������������������������������������������������������������������������������������������������������������������������������������� 330 Task Outcome Columns������������������������������������������������������������������������������������������������������������������������������������� 331 Site Columns Collection������������������������������������������������������������������������������������������������������������������������������������� 332 Content Types����������������������������������������������������������������������������������������������������������������������������333 Lists and Libraries���������������������������������������������������������������������������������������������������������������������333 Supporting Content Types���������������������������������������������������������������������������������������������������������������������������������� 334 Views����������������������������������������������������������������������������������������������������������������������������������������������������������������� 334 Subsites������������������������������������������������������������������������������������������������������������������������������������336 xiii www.it-ebooks.info ■ Contents ■■Appendix B: SharePoint Designer’s Text-Based Workflow Editor����������������������������������337 Creating the Workflow Editor Components��������������������������������������������������������������������������������337 Actions��������������������������������������������������������������������������������������������������������������������������������������������������������������� 338 Conditions���������������������������������������������������������������������������������������������������������������������������������������������������������� 339 Stages and Steps����������������������������������������������������������������������������������������������������������������������������������������������� 339 Special Components������������������������������������������������������������������������������������������������������������������������������������������ 340 Using the Editor Features����������������������������������������������������������������������������������������������������������341 Using the Insertion Point����������������������������������������������������������������������������������������������������������������������������������� 341 Defining Parameters������������������������������������������������������������������������������������������������������������������������������������������ 342 Summary�����������������������������������������������������������������������������������������������������������������������������������344 Index���������������������������������������������������������������������������������������������������������������������������������345 xiv www.it-ebooks.info About the Authors Mark J Collins has been developing software solutions for over 30 years Some of the key technology areas of his career include NET, SQL Server, and SharePoint He currently serves as a senior architect for multiple high-tech organizations He has authored numerous books on NET and SharePoint You can see more info on his web site, www.TheCreativePeople.com For questions and comments, contact Mark at markc@thecreativepeople.com Michael Mayberry has been developing software with Microsoft technologies for over 14 years Over those years he has consistently adopted new solutions and tools to solve increasingly larger problems Michael has always valued team building and sharing his knowledge with others Recently, he expanded his focus to include writing and reviewing He has written or coauthored other books and has been a technical reviewer for many projects When he is not working, Michael enjoys spending time with his beautiful wife and five children For questions and comments, contact Michael at michael.mayberry@outlook.com xv www.it-ebooks.info About the Technical Reviewer Sahil Malik, the founder and principal of Winsmarts.com, has been a Microsoft MVP and INETA Speaker for the past 10 years, author and reviewer of many books and numerous articles in both the NET and SharePoint space, consultant and trainer who delivers training and talks at conferences internationally Sahil has trained for the best names in the Microsoft technology space, and has architected and delivered SharePoint based solutions for extremely high-profile clients Sahil has worked in 16 countries, continents, and has authored 15 books on topics ranging from NET, SQL Server, and SharePoint 2007, 2010, and 2013 xvii www.it-ebooks.info Acknowledgments First and foremost, I acknowledge my Lord and Savior, Jesus Christ The divine and eternal perspective on life, which can only be found in Him, is an anchor, steadfast and sure I humbly conclude that His hand has guided me, often carrying me, through every endeavor, great and small I want to say a very big thank you to my beautiful wife, Donna I can honestly say that I would not be who I am if it were not for what you have sown into my life I am truly blessed to be able to share my life with you Thank you for your loving support and for making life fun! Also, I want to thank Michael Mayberry for his tremendous help on this project As with every project that we have done together, I believe the result is always greater than the sum or our efforts Next, I’d like to thank all the people at Apress who made this book possible and for all their hard work that turned it into the finished product you see now Everyone at Apress has made writing this book a pleasure —Mark J Collins I first bow my head in thanks to Jesus Christ for giving meaning to life In a world that so desperately needs love, you showed us how much God loves us all I thank my wife Camille You make our home a great place to work, write and play Thank you for your encouragement and support Mark Collins, working with you is always a joy You always raise the bar and then help me to reach it With so many books published, one might think that books just happen The truth is, even the writing is just one of the many moving parts of the process Thank you to everyone at Apress who worked so hard to make this project happen I truly appreciate your effort in making this book possible —Michael Mayberry xix www.it-ebooks.info ... 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. .. like Figure 1-4 Figure 1-4.  Using Office 365 and Azure www.it-ebooks.info Chapter ■ Introducing Office 365 for Developers The Office 365 platform provides the office automation and team collaboration... 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

Ngày đăng: 27/03/2019, 14:59

Mục lục

  • Pro Office 365 Development

    • Contents at a Glance

    • About the Technical Reviewer

    • Chapter 1: Introducing Office 365 for Developers

      • Office 365 Architecture

        • Traditional Office Server Environment

        • Storing Documents in SharePoint

        • Office 365 and Windows Azure

        • Office 365 Online Servers

          • SharePoint Online 2013

            • Using Custom Applications

            • Adding an App Part

            • Developing Solutions in Visual Studio 2013

            • Exchange Online 2013

              • Customization Scenarios

              • Lync Online 2013

                • Lync Architecture

                • Chapter 2: Creating Your Web Presence

                  • Designing a Web Site

                    • Collecting the Content

                      • Uploading Images

                      • Managing Images with Windows Explorer

                      • Designing the Overall Site

                        • Changing the Logo

                        • Hiding the Search Box

                        • Modifying the Home Page

                        • Making the Website Public

                        • Advanced Editing

                          • SharePoint Content

                            • Using Reusable Content

                            • Using the Pages Library

                            • Modifying the Style Sheet

                            • Employing Search Engine Optimization

                              • Adding Meta Tags

Tài liệu cùng người dùng

Tài liệu liên quan