Sviluppare app per office

33
VS002 - Sviluppare App per Office Fabio Franzini – SharePoint MVP

description

How to develop app for office

Transcript of Sviluppare app per office

Page 1: Sviluppare app per office

VS002 - Sviluppare App per Office

Fabio Franzini – SharePoint MVP

Page 2: Sviluppare app per office

• SharePoint MVP

• Senior Consultant and Software Engineer

• MCT Trainer

• MCPD Web Applications, MCTS SharePoint 2010/2007

• Official Ignite Trainer for SharePoint 2013 & 2010 in Italy

• Over 10 years experience in IT as a software engineer

• Twitter: @franzinifabio

• Email: [email protected]

• Web: www.fabiofranzini.com

About Me

Page 3: Sviluppare app per office

“SharePoint 2013 App Model Succinctly”SharePoint 2013 App Model Succinctly is a hands-on approach to

learning how to develop SharePoint apps.

Author Fabio Franzini introduces readers to the concepts that make

SharePoint 2013 simpler and easier to use than previous development

models.

You’ll learn to develop both on-premises and cloud applications in

Visual Studio 2013, then enable your apps to communicate with

SharePoint using the client-side object model (CSOM) or the

representational state transfer (REST) API

http://bit.ly/1ytzthl

Page 4: Sviluppare app per office

Agenda

• Introduction

• Document-based Apps

• Mail Apps

• Distribution

Page 5: Sviluppare app per office

Introduction

Page 6: Sviluppare app per office

Microsoft Vision: Modernizing the PlatformToday’s Market

Today’s TrendsMicrosoft Principles

Page 7: Sviluppare app per office

Types of Office AppsTask Pane App Content App Mail App

• Assist user working with one or

more documents

• Works in Word,Excel, PowerPoint

and Project

• Adds embedded

content/functionality to documents

• Only in Excel and Excel web app

• Extends message and appointments

with custom UI and behavior

• Used in Outlook and Outlook Web

App

Page 8: Sviluppare app per office

Anatomy of an Office App

Each App for Office is based on XML-based manifest

• Points to a web page

• Defines the type of the App for Office

• Defines which Office applications it supports

• Defines required capabilities

8

Page 9: Sviluppare app per office

• Cross Platform

• Designed from the ground up, Abstraction, Async

• Cross App

• Common objects and methods across apps (selection, tables, settings)

• Web Standards

• ECMAScript 5

• Performance

• Async, limits

Principles

Page 10: Sviluppare app per office

ServerClient

Bro

wse

r Hos

t

Common App ArchitectureW

eb S

erver Host

SharePoint

& Exchange

APP

Clie

nt A

PIs

Server A

PIs

Oth

er D

evic

es

& C

lients

3rd

Part

y S

erv

ices

Office

Page 11: Sviluppare app per office

Office Javascript API Overview

Document

Office.context

CustomXmlParts

Bindings

Settings

R/W Selection

Mailbox

Properties & Settings

User Profile

EWS

Item

Project

Tasks

Project Info

Page 12: Sviluppare app per office

Document-based Apps

Page 13: Sviluppare app per office

• Apps for Office code run in separate sandboxed process

• Sandbox infrastructure leverages Web Control from IE9/IE10

• App for Office support for HTML5 and CSS3 consistent with IE9/IE10 support

• Browser-rendered Apps based• Works across all popular browsers (might require the latest version)

• App runs its it own iFrame inside outer an iFrame with WEF runtime

• Communications between iFrames relies on HTML5 postMessageAPI

Office Application Architecture

Page 14: Sviluppare app per office

• Document-based Apps for Office have common objects• Used to read and write content to and from document

• Used to create bindings and event handlers

A common API for document-based Apps

Common Objects x-Office!

Text Table Matrix

Charts

Shapes

Picture

Hyperlink

Word ArtXML

Parts

Clip Art

Page 15: Sviluppare app per office

Core API Objects

Page 16: Sviluppare app per office

• All data access starts through document object

• Read/write access to user selection

• Event handler for selection change event

• Three data types are supported

• Text

• Matrix

• Table

Interacting With Document Content

Page 17: Sviluppare app per office

Working with Selections

Current selection

Task Pane App reads current selection and translates

Content App reads current selection and translates

Page 18: Sviluppare app per office

App Bindings

Bound range of stock symbols

App handles SelectionChanged event associated with the binding to retrieve news associated with stock symbol

Page 19: Sviluppare app per office

• You can read/write document settings

• ReadDocument

• You have read access to document

• You can subscribe to change events

• WriteDocument

• Write content into document

• ReadWriteDocument

• ReadDocument + WriteDocument

• FullAccess

• All Permissions + use of Silverlight & Flash

Requested Capabilities

Page 20: Sviluppare app per office

Document-based Apps - Demo

Page 21: Sviluppare app per office

Mail Apps

Page 22: Sviluppare app per office

• Write once, run anywhere Outlook runs

• Same Mail App runs on Outlook and OWA

• Development model based on activation rules

• Activation rules run whenever user selects item

• Activated mail apps are added into Outlook UI

• Designed to be secure

• Mail apps run in an isolated, sandboxed process

• Mail apps run with a three-tier permission model

Mail Apps

Page 23: Sviluppare app per office

• Mail Apps require Exchange 2013

• Exchange Server hosts users mailbox

• Exchange Server hosts app manifest files

• Web server hosts HTML for Mail App

• Mail App can make callback to Web server

• Mail App can call Exchange Web Services (EWS)EWS calls can be brokered through Web server

Mail App Hosting

EWS

Page 24: Sviluppare app per office

• Exchange detects specific entities• Exchange 2013 inspects each incoming message for text, such as postal addresses, URLs, etc.

• These entities are stamped on each item as a property.

Extracted Entities

Entity Type Text Detected

Address US postal addresses (1 Microsoft Way, Redmond WA, 98052)

EmailAddress Any SMTP address

MeetingSuggestion A reference to an event or meeting (Let’s meet next Tuesday for lunch.)

Contact A personal name related to other entities (Randy Byrne, 1 Microsoft Way, Redmond WA, 98052)

PhoneNumber US telephone numbers (555) 867-5309

TaskSuggestion Actionable sentences in an email, Please install office 2013 on my computer.

Url A filename or web address

Page 25: Sviluppare app per office

• RuleCollection• Groups multiple rules together using AND or OR

• Rule Collections can be nested within each other

• ItemHasAttachment• Checks whether the item has an attachment

• ItemHasRegularExpressionMatch• Checks for matches to the reg ex against body, subject

or sender’s email address

• ItemHasKnownEntity• Checks whether the item has the specified entity

Activation rules

Page 26: Sviluppare app per office

Interact with Mailbox & Item properties.mailbox:

• userProfile

• item

• display forms

• user token

• call EWS

Office.context:

• roamingSettings

• displayLanguage

.item

.userProfile:

• name

• time zone

• email address

(Message)

• message properties

• entities

• reg ex matches

• custom props

(Appointment):

• appt properties

• entities

• reg ex matches

• custom props

Page 27: Sviluppare app per office

Low trust: end-user can install for self

High trust: Exchange administrator must install

• Restricted

• Use only extracted item entities but no custom regular expressions

• Partial OM access and no access makeEWSRequestAsync

• ReadItem

• Use custom regular expressions

• Full JSOM access except no access to makeEWSRequestAsync

• Read & write properties for current item

• ReadWriteMailbox

• Use Exchange Web Services (EWS) operations

• Create, read, write items & folders

• Send items

Permissions and CapabilitiesRead/write

mailbox permission

Read item permission

Restricted permission

Page 28: Sviluppare app per office

Mail Apps - Demo

Page 29: Sviluppare app per office

Distribution

Page 30: Sviluppare app per office

Publication to App Catalog

• App for Office distribution/deployment model based on App Catalogs

• Apps for Office are published by uploading its manifest to an App Catalog

• Different App Catalogs• Office Store

• SharePoint App Catalog

• File share App Catalog

• Exchange 2013 App Catalog (mail apps only)

Page 31: Sviluppare app per office

Office Store

Page 32: Sviluppare app per office

For more info…

• http://dev.office.com

• https://code.msdn.microsoft.com/officeapps/Apps-for-Office-code-d04762b7

Page 33: Sviluppare app per office

Contatti OverNet Education

OverNet Education

[email protected]

www.overneteducation.it

Tel. 02 365738

@overnete

www.facebook.com/OverNetEducation

www.linkedin.com/company/overnet-solutions