SlideShare une entreprise Scribd logo
1  sur  45
SharePoint 2013 Hosted
     App:
     Deep Dive Implementation
     Roy Kim
     January 2013
     roykimsharepoint.wordpress.com
     @roykimtoronto
     roykimtoronto@gmail.com
roykimsharepoint.wordpress.com
About Me


          • 5 years of SharePoint
          • 10 years of Microsoft .NET platform
          • Previous companies
            Pricewaterhouse Coopers, Infusion, Accenture
          • 2 years in community involvement
            Speaking, blogging, user groups
          • Jack of all trades, expert at one - SharePoint

roykimsharepoint.wordpress.com
Agenda
               The following presentation is about sharing my experience and knowledge in the
               course of building a SharePoint 2013 Hosted App.


           •     App Model Overview
           •     Development Environment
           •     SharePoint App at Runtime
           •     Implementation Insights
           •     Deployment & Publishing
           •     Developer Skill Set & Tools

roykimsharepoint.wordpress.com
App Model




     Look at
roykimsharepoint.wordpress.com
App Model Key Design Theme: Isolation
          • Application runtime isolation
          • Can be hosted away from SP server
          • Security boundary
          • Delegated deployment to site collection administrator
            or site admin
          • Deployment isolation from farm and server level
            repositories – 15 Hive, GAC, IIS, virtual
            folders, web.config


roykimsharepoint.wordpress.com
Consequences of Isolation

          • Push Client Side technologies and concepts (HTML,
            JS, .NET Client OM)
          • API programming model (CSOM, REST+ODATA,)
          • Security: cross domain scripting, app permissions,
            OAuth
          • Remote hosting server (provider hosted/autohosted)
          • Manage application level tenancy for provider hosted
            apps.
          • No UI integration (e.g. client web part iframe)
roykimsharepoint.wordpress.com
Development Environment Setup

                    Visual Studio 2012                     SharePoint Web App           Windows Server 2008
                    / Napa                                                              R2/2012
                                                                    Host Web




                                         SP Hosted
                                                                                               DNS Server
Developer Machine




                           App
                                                                            App Web
                                                                            (subsite)
                                                                                        SharePoint Service
                                                                                        Applications
                    Browser
                                         Provider Hosted                                        Subscription
                    (IE, Chrome, FFX)                                                             Settings
                                                           Web Site (IIS)

                                                                   Custom Web
                                                                   Custom Web                App Management
                                                                    Application
                                                                    Application
SharePoint Hosted App Development Steps
          1. Prerequisites
             SharePoint 2013 Installation
             Visual Studio 2012
             Microsoft Office Developer Tools for VS2012 RTM – Preview (from Web Platform
             installer)
          2. DNS Server: Create wildcard domain for apps
          3. Central Admin: Manage Service Applications
             http://msdn.microsoft.com/en-us/library/fp179923(v=office.15)
          4. Central Admin > App > Configure App Urls
          5. Visual Studio 2012: Create SharePoint 2013 App project
              1. Write your code
              2. Set target deployment Site Url in Project Properties
              3. Right click „Deploy „
          6. SP Site: Go to Site > Site Contents
              1. Add an App

roykimsharepoint.wordpress.com
Web Programming Model
                                          Browser

                                                  HTML/CSS

                                              JavaScript/JQuery

                                              CSOM           $.ajax
                                      OAuth
                                                                R
Client                                           X    JSON
                                                                E
                                                 M
                                                                S     ODATA
                                                 L
Server                                                          T


             SharePoint Server
                                              http://<server>/<site>/_api
                           Endpoint
                                                       client.svc

                                      Web, Lists, Items, Workflows,
                              Search, BCS, Managed Metadata, User Profile

  roykimsharepoint.wordpress.com
Demo: Photo Banner App
         • Photo Banner Rotator displaying a title and caption




         • UI component: Client web part with custom properties
         • Business Logic: Client Side JavaScript
         • Data Access Logic: JavaScript Object Model / REST API
         • Data Store: Photo library, Settings custom list
roykimsharepoint.wordpress.com
Demo: Client Web Part Edit Mode



                                                Client Web Part
                                                Properties




roykimsharepoint.wordpress.com
Demo: Photo Banner App
                                 • Banner Title
                                 • Photo Caption
                                 • Photo Library Source: Host Web or App Web
                                 • Host Web must have Picture Library the following
                                   columns
                                    •   Column             Presented as
                                        Title              Banner Title
                                        Description        Photo Caption
                                        Active             Flag to display photo
                                        (RoutingEnabled)


roykimsharepoint.wordpress.com
Demo: Photo Banner App




   • Styling, Title, Caption Settings
   1) Master Settings (Default Settings list item)
   2) Client Web Part Settings (Override)

roykimsharepoint.wordpress.com
App at Runtime
                  Site Collection
                    Domain: www.portal.com                           Domain: <prefix>.portalapps.com
                            Host Web                                     App Web
                                                                                             Clientwebpart
                                                                             Default.aspx
                                    Home.aspx                                                    .aspx

                                                                             Site Columns
                                                                             Site Columns
                                                                              Site Columns      App.js

                                                                                Photo          Settings
                                                                             Content Type    Content Type

                                    Photo Library                              Photo
                                                                                             Settings List
                                                                               Library

                                                           REST API

                                         Browser
                                          www.portal.com
                                                www.portalapps.com

                                                    Client Web Part
roykimsharepoint.wordpress.com
Project Solution Structure

                          UI                     Client Side       App Web
                                                 Business Logic

                                                       jQuery.js                    AppManifest.
                                 Default.aspx                       Feature.xml
                                                                                       xml

                                                                   elements.xml
                                                                    elements.xml
                             Clientwebpart                                         Site Columns
                                                                                   Site Columns
                                                        App.js                      Site Columns   App Package
                                 .aspx

                                                                      Settings        Photo        (deployment)
                                                                    Content Type   Content Type
                                   App.css
                                                                                      Photo
                                                                   Settings List
                                                                                      Library




roykimsharepoint.wordpress.com               Browser                   SharePoint Server
Solution Structure & Project Items
          • App Manifest
            Properties and metadata of the app for registration and
            installation into the host SharePoint site
          • Client Side Libraries
            Microsoft.Ajax.js
            sp.runtime.js
            sp.js
          • Default.aspx, clientwebpart.aspx
          • Elements.xml, schema.xml
          • No server side C# or VB .NET code

roykimsharepoint.wordpress.com
What is the App Web?

          • Not intended to be a full feature SharePoint site.
          • Just a container for default.aspx page, lists, etc.
          • App Web Site Definition APP#0
          • Chrome (master page) is simplified and locked down.
            No navigation – only link back to host web.
          • Full immersive application



roykimsharepoint.wordpress.com
Default.aspx

          • Landing page in app web
          • Design consideration:
            Can be a place for administrative functionality
            (initialization code or settings page)




roykimsharepoint.wordpress.com
Client Web Part
          • Aka “App Part”
          • ClientWebPart.aspx
          • Expose app within host web pages.
          • Web Part properties are in the form of query string
            parameters
            Reference: Blog Client Webpart Properties
          • Can not interface or communicate with other web
            parts.
          • Generates iFrame with url referring to app web

roykimsharepoint.wordpress.com
API Set in SP 2013




        • http://msdn.microsoft.com/en-us/library/jj164060.aspx
roykimsharepoint.wordpress.com
JavaScript Object Model

          • Request batching instructions into an async http
            request
          • “object oriented”
          • Intellisense capability in VS 2012
          • Data returned as JSON
          • JS Library
             Microsoft.Ajax.js
             sp.runtime.js
             sp.js
roykimsharepoint.wordpress.com
JavaScript Object Model
    var clientContext = new SP.ClientContext(siteUrl);
    this.oWebsite = clientContext.get_web();
    this.oWebsite.set_title('Updated Web Site');                     Batch
    this.oWebsite.set_description('This is an updated Web site.');
    this.oWebsite.update();

    clientContext.load(this.oWebsite, 'Title', 'Description');
    clientContext.executeQueryAsync(
          Function.createDelegate(this, this.onQuerySucceeded),
          Function.createDelegate(this, this.onQueryFailed)
       );
roykimsharepoint.wordpress.com
Photo Banner App
      Client Browser                                                          SharePoint Server API
      App Web:                            CS Logic
      Default.aspx                        AppViewModel.js
      Client Web part.aspx                CPApp object

                       getCoverPhotosListData
                                                Query Settings List (async)


                                                onCheckSettings (callback)



                                                 Query Photo List (async)
                                                                                     Asynchronous
                                                 onGetPhotosList (callback)          calls chained in
                                                                                     call back functions
roykimsharepoint.wordpress.com
REST API
          • Uniform interface for all types of clients and servers to
            access SharePoint.
          • AJAX + RESTful Urls/endpoints + OData + JSON/Atom
          • OData protocol
            • Query string operators to select, filter, order, etc..
            • “kind of like SQL clauses for the web”




roykimsharepoint.wordpress.com
REST API
          • $.ajax( url, type, data, callback function)
          • <server>/_api/web/lists(„<guid>‟)
            <server>/_api/web/lists/getbytitle(„Title‟)
             <server>/_api/web/lists/add
          • JSON Input
                 { "d" : {
                   "results": {
                       "__metadata": { "type": "SP.ListCreationInformation" },
                       "CustomSchemaXml": "…large payload…/",
                        "Description": "desc",
                        "DocumentTemplateType": "1",
                        "TemplateType": "101", "Title": "Announcements" } } }
          • Odata Query
                  /Products?$select=Title,Products/Name&$expand=Products/Name
roykimsharepoint.wordpress.com
REST API vs JSOM



                    REST                                   JSOM
                    More declarative as instructions are in More imperative approach with the
                    JSON                                    object properties and methods.

                    Easy debugging read/GET requests       Intellisense support in VS
                    using browser and/or fiddler




roykimsharepoint.wordpress.com
Cross Domain Call

       • To get around browser same origin policy, the cross-
         domain library is a client-side alternative
       • SP.RequestExecutor.js is hosted in the SharePoint
         website that you can reference in your remote app.
       • Allows you to interact with more than one domain in
         your remote app page through a proxy.
       • AppContextSite object is the “gateway” to the host
         web

roykimsharepoint.wordpress.com
Cross Domain Call : REST

  // Initialize the RequestExecutor with the app web URL.
  executor = new SP.RequestExecutor(appweburl);
  executor.executeAsync( {
              url: appweburl +
              "/_api/SP.AppContextSite(@target)/web/title?@target='" +
               hostweburl + "'",
               method: "GET",
               headers: { "Accept": "application/json; odata=verbose" },
               success: successHandler, error: errorHandler }
  );
roykimsharepoint.wordpress.com
Cross Domain Call : JSOM
 context = new SP.ClientContext(appweburl);
 factory = new SP.ProxyWebRequestExecutorFactory(appweburl);
 context.set_webRequestExecutorFactory(factory);
 appContextSite = new SP.AppContextSite(context, hostweburl);
 this.web = appContextSite.get_web();
 context.load(this.web);

 context.executeQueryAsync(
    Function.createDelegate(this, successHandler),
    Function.createDelegate(this, errorHandler)
 );
roykimsharepoint.wordpress.com
Cross Domain Call

     Reference:
     Code sample: Get the host web title using the cross-domain library
       (REST)

     Code sample: Get the host web title using the cross-domain library
       (JSOM)




roykimsharepoint.wordpress.com
Cross Domain/iFrame Communication
  Domain: www.portal.com
                  Host Web
                                                          <iframe>


                           www.portalapps.com

                                                           SP.RequestExecutor.js
                                        Client Web Part
                                             Page
                                                           iframe postMessage
       REST API




                                                          Send to iFrame:
                                                          iframeWin.postMessage(messageObject,
                                                                                targetDomainString)

                                                          Event receiver in iFrame:

                                         Photo Library
                                                          window.attachEvent(“iFrameWinMessage”,
                                                                             function(e) { e.origin })
roykimsharepoint.wordpress.com
No App Activation Event Receiver

          • No notice of app event receiver for when an app is
            first activated
          • There exists „App Installed‟, „App Uninstall‟, „App
            Upgrade” events, but are executed before creating
            any lists or executes any code.
          • Workaround: On every app load, have some
            conditional initialization logic to do initial setup.



roykimsharepoint.wordpress.com
App Permissions

       • Permission requests are declared in the AppManifest.xml
       • Permissions on objects such as Web, List and other SP
         services on behalf of the user.
       • Permissions Levels : Manage, Full Control, Contribute, Read




roykimsharepoint.wordpress.com
App Permissions

          • Can we request permission on a specific list?
            Have not noticed any proven way to ask permissions for a
            specific object or specific set of objects.
            E.g. App wants only to read only Customer list and
            Documents library.
          • Authorization is facilitated by the SharePoint security
            infrastructure.
          • OAuth is not needed in SharePoint Hosted App



roykimsharepoint.wordpress.com
Debugging

          • Use Chrome/IE Developer Tools, FireBug
          • No ULS logging with JavaScript (of course)
          • Can not find a way to directly update HTML, CSS, JS files in
            App Web (Dev Environment)




roykimsharepoint.wordpress.com
Publishing
Simplistic Deployment Path                  Visual Studio                                    Office 365
                                            2012                                             Napa App
– SharePoint Hosted
                                                                                                    App
                                                  App
                                                                                                    Code
                                                  Code




                                               /bin/publish.app/myApp.app                /Lists/AppPackages/myApp.app



                                                                            myApp.app
                             SharePoint Farm
                                 SharePoint Web App                                     Office 365 (SharePoint)
                                                                                                                  App
                                                     App                                  Host Web               Catalog
                                                                                                                  Site
                                   Host Web         Catalog
                                                     Site
                                                                                                App Web
                                      App Web                                                   (subsite)
                                      (subsite)
roykimsharepoint.wordpress.com
Publishing

            • Visual Studio Solution > Right Click – Publish
            • Output folder: Projects<MyApp>binDebugapp.publish
              Creates an app package file with file extension .app.
              Can rename extension .app to .zip file to see file contents.
              Output folder comes with deployment script and deployment
              configuration files.
            • Deploy to App Catalog in On Premise or Office 365 (cloud)
            • Reference:
              http://msdn.microsoft.com/en-us/library/jj220044.aspx
              http://msdn.microsoft.com/en-us/library/ff356104(VS.110).aspx


roykimsharepoint.wordpress.com
PowerShell Deployment

         •      Import-SPAppPackage -Path "$appPath" -Site $Web -Source $sourceApp

         •      Install-SPApp -Web $Web -Identity $spapp Get-SPAppInstance -
                Web $Web | where-object {$_.Title -eq $AppName}

         • Uninstall-SPAppInstance –Identity $appInstance

         • Import-SPAppPackage -Path "$appPath" -Site $Web -Source $sourceApp

         • Update-SPAppInstance -Identity $appInstance -App $spapp


roykimsharepoint.wordpress.com
Publishing


       $spapp = Import-SPAppPackage -Path Path to app -Site URL -Source Source
       # Imports the app and sets a variable that you can use to identify the app
       when you install it in the next step.

       Install-SPApp -Web URL -Identity $spapp
       # Installs the app to the subweb you specify.




roykimsharepoint.wordpress.com
Gotchas/Issues
         • AppWeb – Access is denied
           Disable loopback check – prevents reflection attack

         • VS Deploy App – Output Window: Failed to install app.
           Error in the xml declarative mark up in the solution files
           Investigate xml syntax errors.
           Troubleshoot by removing, one by one, elements in the
           feature to trace problem area.

         • Deployment Issues with failing to deploy:
           Check if App Management and Subscription Settings Service
           is „started‟ in Central Admin > Manage Service Applications
roykimsharepoint.wordpress.com
Developer Skills & Knowledge

          JavaScript
          • functions, function objects, types,
            comparison operators, object literals,
            variable scope, this keyword
          • null, undefined, NaN
          • JSON
          • JQuery
          • Selectors, $.each, $(document).ready(function() { ... }),
            module pattern
          • $.ajax(...) function, $.get(..), $get.post(..)

roykimsharepoint.wordpress.com
Developer Skills & Knowledge

          HTML
          • <div>, <span>, <ul>, <ol>, <li>, <table>, <input>

          CSS
          • Layout
            display, overflow, float, position, top, left, z-index
          • Structure
            padding, margin, width, height,
          • Styling
            font, color, border, text-overflow, overflow, no-scroll
roykimsharepoint.wordpress.com
Developer Skills & Knowledge
         HTTP
         • Headers, status code, cache headers
         • http verbs (e.g. get, post, put, delete)
         • Same original policy (browser security)
         • REST




roykimsharepoint.wordpress.com
Tools
          Client Side
          • Visual Studio JavaScript Outline Parser
                  http://visualstudiogallery.msdn.microsoft.com/288a2b0f-1357-47b4-8215-1134c36bdf30
          •       Chrome Developer Tools,
                  FireBug.
                  IE Developer Tools
          •       JS Regex
                  http://www.jslab.dk/tools.regex.php
          • jsbeautifier.org
          • Fiddler
          Server Side
          • SharePoint Manager 2013
          • UlSViewer
          • PowerShell Editor: PowerGUI
                  http://powergui.org/downloads.jspa
roykimsharepoint.wordpress.com
Questions

                                 Roy Kim
                                 • Blog
                                       roykimsharepoint.wordpress.com
                                 • Email
                                       roykimtoronto@gmail.com
                                 • Twitter
                                       @roykimtoronto


roykimsharepoint.wordpress.com

Contenu connexe

Tendances

Visio Services in SharePoint 2010
Visio Services in SharePoint 2010Visio Services in SharePoint 2010
Visio Services in SharePoint 2010
Alexander Meijers
 
Sp2013 overview biwug
Sp2013 overview biwugSp2013 overview biwug
Sp2013 overview biwug
BIWUG
 
Sviluppare App per Office 2013 e SharePoint 2013
Sviluppare App per Office 2013 e SharePoint 2013Sviluppare App per Office 2013 e SharePoint 2013
Sviluppare App per Office 2013 e SharePoint 2013
Giuseppe Marchi
 
Understanding SharePoint 2013 Code Deployment Models - Apps vs Solutions - Sh...
Understanding SharePoint 2013 Code Deployment Models - Apps vs Solutions - Sh...Understanding SharePoint 2013 Code Deployment Models - Apps vs Solutions - Sh...
Understanding SharePoint 2013 Code Deployment Models - Apps vs Solutions - Sh...
Nik Patel
 

Tendances (20)

Developer’s Independence Day: Introducing the SharePoint App Model
Developer’s Independence Day:Introducing the SharePoint App ModelDeveloper’s Independence Day:Introducing the SharePoint App Model
Developer’s Independence Day: Introducing the SharePoint App Model
 
Gabriel Gayhart - XML Pointer File Example
Gabriel Gayhart - XML Pointer File ExampleGabriel Gayhart - XML Pointer File Example
Gabriel Gayhart - XML Pointer File Example
 
Introducing the new SharePoint 2013 app model
Introducing the new SharePoint 2013 app modelIntroducing the new SharePoint 2013 app model
Introducing the new SharePoint 2013 app model
 
Designing SharePoint solutions – Big Decisions for Big Success
Designing SharePoint solutions – Big Decisions for Big SuccessDesigning SharePoint solutions – Big Decisions for Big Success
Designing SharePoint solutions – Big Decisions for Big Success
 
Developing SharePoint 2013 apps with Visual Studio 2012 - Microsoft TechDays ...
Developing SharePoint 2013 apps with Visual Studio 2012 - Microsoft TechDays ...Developing SharePoint 2013 apps with Visual Studio 2012 - Microsoft TechDays ...
Developing SharePoint 2013 apps with Visual Studio 2012 - Microsoft TechDays ...
 
Visio Services in SharePoint 2010
Visio Services in SharePoint 2010Visio Services in SharePoint 2010
Visio Services in SharePoint 2010
 
Sp2013 overview biwug
Sp2013 overview biwugSp2013 overview biwug
Sp2013 overview biwug
 
SharePoint Server 2013: to app or not to app?
SharePoint Server 2013: to app or not to app? SharePoint Server 2013: to app or not to app?
SharePoint Server 2013: to app or not to app?
 
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
 
Sviluppare App per Office 2013 e SharePoint 2013
Sviluppare App per Office 2013 e SharePoint 2013Sviluppare App per Office 2013 e SharePoint 2013
Sviluppare App per Office 2013 e SharePoint 2013
 
Getting Started with SharePoint Development
Getting Started with SharePoint DevelopmentGetting Started with SharePoint Development
Getting Started with SharePoint Development
 
Charla desarrollo de apps con sharepoint y office 365
Charla   desarrollo de apps con sharepoint y office 365Charla   desarrollo de apps con sharepoint y office 365
Charla desarrollo de apps con sharepoint y office 365
 
SharePoint 2013 Sneak Peek
SharePoint 2013 Sneak PeekSharePoint 2013 Sneak Peek
SharePoint 2013 Sneak Peek
 
SharePoint 2013 App Provisioning Models
SharePoint 2013 App Provisioning ModelsSharePoint 2013 App Provisioning Models
SharePoint 2013 App Provisioning Models
 
Introduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint WorkshopIntroduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint Workshop
 
Understanding SharePoint 2013 Code Deployment Models - Apps vs Solutions - Sh...
Understanding SharePoint 2013 Code Deployment Models - Apps vs Solutions - Sh...Understanding SharePoint 2013 Code Deployment Models - Apps vs Solutions - Sh...
Understanding SharePoint 2013 Code Deployment Models - Apps vs Solutions - Sh...
 
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 appsChris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
 
Come riprogettare le attuali farm solution di share point con il nuovo modell...
Come riprogettare le attuali farm solution di share point con il nuovo modell...Come riprogettare le attuali farm solution di share point con il nuovo modell...
Come riprogettare le attuali farm solution di share point con il nuovo modell...
 
SharePoint 2013 Search and Creating Dynamic Content Management Solutions
SharePoint 2013 Search and Creating Dynamic Content Management SolutionsSharePoint 2013 Search and Creating Dynamic Content Management Solutions
SharePoint 2013 Search and Creating Dynamic Content Management Solutions
 
Tutorial, Part 4: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 4: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...Tutorial, Part 4: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 4: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
 

En vedette

SharePoint 2013 “App Model” Developing and Deploying Provider Hosted Apps
SharePoint 2013 “App Model” Developing and Deploying Provider Hosted AppsSharePoint 2013 “App Model” Developing and Deploying Provider Hosted Apps
SharePoint 2013 “App Model” Developing and Deploying Provider Hosted Apps
Sanjay Patel
 

En vedette (8)

Javascript cross domain communication
Javascript cross domain communicationJavascript cross domain communication
Javascript cross domain communication
 
SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013
SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013
SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013
 
Developing a provider hosted share point app
Developing a provider hosted share point appDeveloping a provider hosted share point app
Developing a provider hosted share point app
 
Networking For Application Developers by Roy Kim
Networking For Application Developers by Roy KimNetworking For Application Developers by Roy Kim
Networking For Application Developers by Roy Kim
 
SharePoint 2013 “App Model” Developing and Deploying Provider Hosted Apps
SharePoint 2013 “App Model” Developing and Deploying Provider Hosted AppsSharePoint 2013 “App Model” Developing and Deploying Provider Hosted Apps
SharePoint 2013 “App Model” Developing and Deploying Provider Hosted Apps
 
Skylink App - Presentation
Skylink App - PresentationSkylink App - Presentation
Skylink App - Presentation
 
Mobile apps marketing
Mobile apps marketingMobile apps marketing
Mobile apps marketing
 
Build Features, Not Apps
Build Features, Not AppsBuild Features, Not Apps
Build Features, Not Apps
 

Similaire à SharePoint 2013 Hosted App Presentation by Roy Kim

Access share point-2013-data-with-provider-hosted-apps
Access share point-2013-data-with-provider-hosted-appsAccess share point-2013-data-with-provider-hosted-apps
Access share point-2013-data-with-provider-hosted-apps
Alexander Meijers
 
Sp2013 overview
Sp2013 overviewSp2013 overview
Sp2013 overview
BIWUG
 
SharePoint 2013 - What's new for Devs - Belgian IT Bootcamp 2012
SharePoint 2013 - What's new for Devs - Belgian IT Bootcamp 2012SharePoint 2013 - What's new for Devs - Belgian IT Bootcamp 2012
SharePoint 2013 - What's new for Devs - Belgian IT Bootcamp 2012
Joris Poelmans
 

Similaire à SharePoint 2013 Hosted App Presentation by Roy Kim (20)

(Almost) All About Apps for SharePoint 2013
(Almost) All About Apps for SharePoint 2013(Almost) All About Apps for SharePoint 2013
(Almost) All About Apps for SharePoint 2013
 
Deep Dive SharePoint 2013: Developing applications in SharePoint 2013: forget...
Deep Dive SharePoint 2013: Developing applications in SharePoint 2013: forget...Deep Dive SharePoint 2013: Developing applications in SharePoint 2013: forget...
Deep Dive SharePoint 2013: Developing applications in SharePoint 2013: forget...
 
Designing for SharePoint Provider Hosted Apps
Designing for SharePoint Provider Hosted AppsDesigning for SharePoint Provider Hosted Apps
Designing for SharePoint Provider Hosted Apps
 
Access share point-2013-data-with-provider-hosted-apps
Access share point-2013-data-with-provider-hosted-appsAccess share point-2013-data-with-provider-hosted-apps
Access share point-2013-data-with-provider-hosted-apps
 
Getting started with SharePoint 2013 online development
Getting started with SharePoint 2013 online developmentGetting started with SharePoint 2013 online development
Getting started with SharePoint 2013 online development
 
Sp2013 overview
Sp2013 overviewSp2013 overview
Sp2013 overview
 
Apps for SharePoint
Apps for SharePointApps for SharePoint
Apps for SharePoint
 
Tutorial, Part 1: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 1: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...Tutorial, Part 1: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 1: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
 
Enterprise apps in SharePoint 2013
Enterprise apps in SharePoint 2013 Enterprise apps in SharePoint 2013
Enterprise apps in SharePoint 2013
 
SharePoint Server 2013 Workflows
SharePoint Server 2013 WorkflowsSharePoint Server 2013 Workflows
SharePoint Server 2013 Workflows
 
SharePoint in the cloud: Deep Azure apps for SharePoint 2013
SharePoint in the cloud: Deep Azure apps for SharePoint 2013SharePoint in the cloud: Deep Azure apps for SharePoint 2013
SharePoint in the cloud: Deep Azure apps for SharePoint 2013
 
Branding & Design Opportunities/Challenges with SharePoint 2013
Branding & Design Opportunities/Challenges with SharePoint 2013Branding & Design Opportunities/Challenges with SharePoint 2013
Branding & Design Opportunities/Challenges with SharePoint 2013
 
Share point 2013 cop v4
Share point 2013 cop v4Share point 2013 cop v4
Share point 2013 cop v4
 
SharePoint 2013 Sneak Peek
SharePoint 2013 Sneak PeekSharePoint 2013 Sneak Peek
SharePoint 2013 Sneak Peek
 
Real World SharePoint Framework and Azure Services
Real World SharePoint Framework and Azure ServicesReal World SharePoint Framework and Azure Services
Real World SharePoint Framework and Azure Services
 
SharePoint Development with Visual Studio 2012
SharePoint Development with Visual Studio 2012SharePoint Development with Visual Studio 2012
SharePoint Development with Visual Studio 2012
 
SharePoint 2013 - What's new for Devs - Belgian IT Bootcamp 2012
SharePoint 2013 - What's new for Devs - Belgian IT Bootcamp 2012SharePoint 2013 - What's new for Devs - Belgian IT Bootcamp 2012
SharePoint 2013 - What's new for Devs - Belgian IT Bootcamp 2012
 
Ideas for addictive series 40 web apps
Ideas for addictive series 40 web appsIdeas for addictive series 40 web apps
Ideas for addictive series 40 web apps
 
SharePoint in Clouds - Autoprovisioned apps with SharePoint 2013
SharePoint in Clouds - Autoprovisioned apps with SharePoint 2013SharePoint in Clouds - Autoprovisioned apps with SharePoint 2013
SharePoint in Clouds - Autoprovisioned apps with SharePoint 2013
 
Convert your Full Trust Solutions to the SharePoint Framework (SPFx) in 1 hour
Convert your Full Trust Solutions to the SharePoint Framework (SPFx) in 1 hourConvert your Full Trust Solutions to the SharePoint Framework (SPFx) in 1 hour
Convert your Full Trust Solutions to the SharePoint Framework (SPFx) in 1 hour
 

Plus de Roy Kim

Plus de Roy Kim (10)

Microsoft Reactor Toronto 5/5/2020 | Azure Kubernetes In Action - Running and...
Microsoft Reactor Toronto 5/5/2020 | Azure Kubernetes In Action - Running and...Microsoft Reactor Toronto 5/5/2020 | Azure Kubernetes In Action - Running and...
Microsoft Reactor Toronto 5/5/2020 | Azure Kubernetes In Action - Running and...
 
Azure AD App Proxy Login Scenarios with an On Premises Applications - TSPUG
Azure AD App Proxy Login Scenarios with an On Premises Applications - TSPUGAzure AD App Proxy Login Scenarios with an On Premises Applications - TSPUG
Azure AD App Proxy Login Scenarios with an On Premises Applications - TSPUG
 
Azure Key Vault with a PaaS Architecture and ARM Template Deployment
Azure Key Vault with a PaaS Architecture and ARM Template DeploymentAzure Key Vault with a PaaS Architecture and ARM Template Deployment
Azure Key Vault with a PaaS Architecture and ARM Template Deployment
 
Azure App Gateway and Log Analytics under Penetration Tests
Azure App Gateway and Log Analytics under Penetration TestsAzure App Gateway and Log Analytics under Penetration Tests
Azure App Gateway and Log Analytics under Penetration Tests
 
Applying Advanced Techniques to Azure Web Apps
Applying Advanced Techniques to Azure Web AppsApplying Advanced Techniques to Azure Web Apps
Applying Advanced Techniques to Azure Web Apps
 
Big Data Analytics from Azure Cloud to Power BI Mobile
Big Data Analytics from Azure Cloud to Power BI MobileBig Data Analytics from Azure Cloud to Power BI Mobile
Big Data Analytics from Azure Cloud to Power BI Mobile
 
Design and Configure Azure App Service Web Apps
Design and Configure Azure App Service Web AppsDesign and Configure Azure App Service Web Apps
Design and Configure Azure App Service Web Apps
 
SharePoint 2016 Hybrid Overview
SharePoint 2016 Hybrid OverviewSharePoint 2016 Hybrid Overview
SharePoint 2016 Hybrid Overview
 
Microsoft Azure For Solutions Architects
Microsoft Azure For Solutions ArchitectsMicrosoft Azure For Solutions Architects
Microsoft Azure For Solutions Architects
 
SharePoint Saturday 2010 - SharePoint 2010 Content Organizer Feature
SharePoint Saturday 2010 - SharePoint 2010 Content Organizer FeatureSharePoint Saturday 2010 - SharePoint 2010 Content Organizer Feature
SharePoint Saturday 2010 - SharePoint 2010 Content Organizer Feature
 

Dernier

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

SharePoint 2013 Hosted App Presentation by Roy Kim

  • 1. SharePoint 2013 Hosted App: Deep Dive Implementation Roy Kim January 2013 roykimsharepoint.wordpress.com @roykimtoronto roykimtoronto@gmail.com roykimsharepoint.wordpress.com
  • 2. About Me • 5 years of SharePoint • 10 years of Microsoft .NET platform • Previous companies Pricewaterhouse Coopers, Infusion, Accenture • 2 years in community involvement Speaking, blogging, user groups • Jack of all trades, expert at one - SharePoint roykimsharepoint.wordpress.com
  • 3. Agenda The following presentation is about sharing my experience and knowledge in the course of building a SharePoint 2013 Hosted App. • App Model Overview • Development Environment • SharePoint App at Runtime • Implementation Insights • Deployment & Publishing • Developer Skill Set & Tools roykimsharepoint.wordpress.com
  • 4. App Model Look at roykimsharepoint.wordpress.com
  • 5. App Model Key Design Theme: Isolation • Application runtime isolation • Can be hosted away from SP server • Security boundary • Delegated deployment to site collection administrator or site admin • Deployment isolation from farm and server level repositories – 15 Hive, GAC, IIS, virtual folders, web.config roykimsharepoint.wordpress.com
  • 6. Consequences of Isolation • Push Client Side technologies and concepts (HTML, JS, .NET Client OM) • API programming model (CSOM, REST+ODATA,) • Security: cross domain scripting, app permissions, OAuth • Remote hosting server (provider hosted/autohosted) • Manage application level tenancy for provider hosted apps. • No UI integration (e.g. client web part iframe) roykimsharepoint.wordpress.com
  • 7. Development Environment Setup Visual Studio 2012 SharePoint Web App Windows Server 2008 / Napa R2/2012 Host Web SP Hosted DNS Server Developer Machine App App Web (subsite) SharePoint Service Applications Browser Provider Hosted Subscription (IE, Chrome, FFX) Settings Web Site (IIS) Custom Web Custom Web App Management Application Application
  • 8. SharePoint Hosted App Development Steps 1. Prerequisites SharePoint 2013 Installation Visual Studio 2012 Microsoft Office Developer Tools for VS2012 RTM – Preview (from Web Platform installer) 2. DNS Server: Create wildcard domain for apps 3. Central Admin: Manage Service Applications http://msdn.microsoft.com/en-us/library/fp179923(v=office.15) 4. Central Admin > App > Configure App Urls 5. Visual Studio 2012: Create SharePoint 2013 App project 1. Write your code 2. Set target deployment Site Url in Project Properties 3. Right click „Deploy „ 6. SP Site: Go to Site > Site Contents 1. Add an App roykimsharepoint.wordpress.com
  • 9. Web Programming Model Browser HTML/CSS JavaScript/JQuery CSOM $.ajax OAuth R Client X JSON E M S ODATA L Server T SharePoint Server http://<server>/<site>/_api Endpoint client.svc Web, Lists, Items, Workflows, Search, BCS, Managed Metadata, User Profile roykimsharepoint.wordpress.com
  • 10. Demo: Photo Banner App • Photo Banner Rotator displaying a title and caption • UI component: Client web part with custom properties • Business Logic: Client Side JavaScript • Data Access Logic: JavaScript Object Model / REST API • Data Store: Photo library, Settings custom list roykimsharepoint.wordpress.com
  • 11. Demo: Client Web Part Edit Mode Client Web Part Properties roykimsharepoint.wordpress.com
  • 12. Demo: Photo Banner App • Banner Title • Photo Caption • Photo Library Source: Host Web or App Web • Host Web must have Picture Library the following columns • Column Presented as Title Banner Title Description Photo Caption Active Flag to display photo (RoutingEnabled) roykimsharepoint.wordpress.com
  • 13. Demo: Photo Banner App • Styling, Title, Caption Settings 1) Master Settings (Default Settings list item) 2) Client Web Part Settings (Override) roykimsharepoint.wordpress.com
  • 14. App at Runtime Site Collection Domain: www.portal.com Domain: <prefix>.portalapps.com Host Web App Web Clientwebpart Default.aspx Home.aspx .aspx Site Columns Site Columns Site Columns App.js Photo Settings Content Type Content Type Photo Library Photo Settings List Library REST API Browser www.portal.com www.portalapps.com Client Web Part roykimsharepoint.wordpress.com
  • 15. Project Solution Structure UI Client Side App Web Business Logic jQuery.js AppManifest. Default.aspx Feature.xml xml elements.xml elements.xml Clientwebpart Site Columns Site Columns App.js Site Columns App Package .aspx Settings Photo (deployment) Content Type Content Type App.css Photo Settings List Library roykimsharepoint.wordpress.com Browser SharePoint Server
  • 16. Solution Structure & Project Items • App Manifest Properties and metadata of the app for registration and installation into the host SharePoint site • Client Side Libraries Microsoft.Ajax.js sp.runtime.js sp.js • Default.aspx, clientwebpart.aspx • Elements.xml, schema.xml • No server side C# or VB .NET code roykimsharepoint.wordpress.com
  • 17. What is the App Web? • Not intended to be a full feature SharePoint site. • Just a container for default.aspx page, lists, etc. • App Web Site Definition APP#0 • Chrome (master page) is simplified and locked down. No navigation – only link back to host web. • Full immersive application roykimsharepoint.wordpress.com
  • 18. Default.aspx • Landing page in app web • Design consideration: Can be a place for administrative functionality (initialization code or settings page) roykimsharepoint.wordpress.com
  • 19. Client Web Part • Aka “App Part” • ClientWebPart.aspx • Expose app within host web pages. • Web Part properties are in the form of query string parameters Reference: Blog Client Webpart Properties • Can not interface or communicate with other web parts. • Generates iFrame with url referring to app web roykimsharepoint.wordpress.com
  • 20. API Set in SP 2013 • http://msdn.microsoft.com/en-us/library/jj164060.aspx roykimsharepoint.wordpress.com
  • 21. JavaScript Object Model • Request batching instructions into an async http request • “object oriented” • Intellisense capability in VS 2012 • Data returned as JSON • JS Library Microsoft.Ajax.js sp.runtime.js sp.js roykimsharepoint.wordpress.com
  • 22. JavaScript Object Model var clientContext = new SP.ClientContext(siteUrl); this.oWebsite = clientContext.get_web(); this.oWebsite.set_title('Updated Web Site'); Batch this.oWebsite.set_description('This is an updated Web site.'); this.oWebsite.update(); clientContext.load(this.oWebsite, 'Title', 'Description'); clientContext.executeQueryAsync( Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed) ); roykimsharepoint.wordpress.com
  • 23. Photo Banner App Client Browser SharePoint Server API App Web: CS Logic Default.aspx AppViewModel.js Client Web part.aspx CPApp object getCoverPhotosListData Query Settings List (async) onCheckSettings (callback) Query Photo List (async) Asynchronous onGetPhotosList (callback) calls chained in call back functions roykimsharepoint.wordpress.com
  • 24. REST API • Uniform interface for all types of clients and servers to access SharePoint. • AJAX + RESTful Urls/endpoints + OData + JSON/Atom • OData protocol • Query string operators to select, filter, order, etc.. • “kind of like SQL clauses for the web” roykimsharepoint.wordpress.com
  • 25. REST API • $.ajax( url, type, data, callback function) • <server>/_api/web/lists(„<guid>‟) <server>/_api/web/lists/getbytitle(„Title‟) <server>/_api/web/lists/add • JSON Input { "d" : { "results": { "__metadata": { "type": "SP.ListCreationInformation" }, "CustomSchemaXml": "…large payload…/", "Description": "desc", "DocumentTemplateType": "1", "TemplateType": "101", "Title": "Announcements" } } } • Odata Query /Products?$select=Title,Products/Name&$expand=Products/Name roykimsharepoint.wordpress.com
  • 26. REST API vs JSOM REST JSOM More declarative as instructions are in More imperative approach with the JSON object properties and methods. Easy debugging read/GET requests Intellisense support in VS using browser and/or fiddler roykimsharepoint.wordpress.com
  • 27. Cross Domain Call • To get around browser same origin policy, the cross- domain library is a client-side alternative • SP.RequestExecutor.js is hosted in the SharePoint website that you can reference in your remote app. • Allows you to interact with more than one domain in your remote app page through a proxy. • AppContextSite object is the “gateway” to the host web roykimsharepoint.wordpress.com
  • 28. Cross Domain Call : REST // Initialize the RequestExecutor with the app web URL. executor = new SP.RequestExecutor(appweburl); executor.executeAsync( { url: appweburl + "/_api/SP.AppContextSite(@target)/web/title?@target='" + hostweburl + "'", method: "GET", headers: { "Accept": "application/json; odata=verbose" }, success: successHandler, error: errorHandler } ); roykimsharepoint.wordpress.com
  • 29. Cross Domain Call : JSOM context = new SP.ClientContext(appweburl); factory = new SP.ProxyWebRequestExecutorFactory(appweburl); context.set_webRequestExecutorFactory(factory); appContextSite = new SP.AppContextSite(context, hostweburl); this.web = appContextSite.get_web(); context.load(this.web); context.executeQueryAsync( Function.createDelegate(this, successHandler), Function.createDelegate(this, errorHandler) ); roykimsharepoint.wordpress.com
  • 30. Cross Domain Call Reference: Code sample: Get the host web title using the cross-domain library (REST) Code sample: Get the host web title using the cross-domain library (JSOM) roykimsharepoint.wordpress.com
  • 31. Cross Domain/iFrame Communication Domain: www.portal.com Host Web <iframe> www.portalapps.com SP.RequestExecutor.js Client Web Part Page iframe postMessage REST API Send to iFrame: iframeWin.postMessage(messageObject, targetDomainString) Event receiver in iFrame: Photo Library window.attachEvent(“iFrameWinMessage”, function(e) { e.origin }) roykimsharepoint.wordpress.com
  • 32. No App Activation Event Receiver • No notice of app event receiver for when an app is first activated • There exists „App Installed‟, „App Uninstall‟, „App Upgrade” events, but are executed before creating any lists or executes any code. • Workaround: On every app load, have some conditional initialization logic to do initial setup. roykimsharepoint.wordpress.com
  • 33. App Permissions • Permission requests are declared in the AppManifest.xml • Permissions on objects such as Web, List and other SP services on behalf of the user. • Permissions Levels : Manage, Full Control, Contribute, Read roykimsharepoint.wordpress.com
  • 34. App Permissions • Can we request permission on a specific list? Have not noticed any proven way to ask permissions for a specific object or specific set of objects. E.g. App wants only to read only Customer list and Documents library. • Authorization is facilitated by the SharePoint security infrastructure. • OAuth is not needed in SharePoint Hosted App roykimsharepoint.wordpress.com
  • 35. Debugging • Use Chrome/IE Developer Tools, FireBug • No ULS logging with JavaScript (of course) • Can not find a way to directly update HTML, CSS, JS files in App Web (Dev Environment) roykimsharepoint.wordpress.com
  • 36. Publishing Simplistic Deployment Path Visual Studio Office 365 2012 Napa App – SharePoint Hosted App App Code Code /bin/publish.app/myApp.app /Lists/AppPackages/myApp.app myApp.app SharePoint Farm SharePoint Web App Office 365 (SharePoint) App App Host Web Catalog Site Host Web Catalog Site App Web App Web (subsite) (subsite) roykimsharepoint.wordpress.com
  • 37. Publishing • Visual Studio Solution > Right Click – Publish • Output folder: Projects<MyApp>binDebugapp.publish Creates an app package file with file extension .app. Can rename extension .app to .zip file to see file contents. Output folder comes with deployment script and deployment configuration files. • Deploy to App Catalog in On Premise or Office 365 (cloud) • Reference: http://msdn.microsoft.com/en-us/library/jj220044.aspx http://msdn.microsoft.com/en-us/library/ff356104(VS.110).aspx roykimsharepoint.wordpress.com
  • 38. PowerShell Deployment • Import-SPAppPackage -Path "$appPath" -Site $Web -Source $sourceApp • Install-SPApp -Web $Web -Identity $spapp Get-SPAppInstance - Web $Web | where-object {$_.Title -eq $AppName} • Uninstall-SPAppInstance –Identity $appInstance • Import-SPAppPackage -Path "$appPath" -Site $Web -Source $sourceApp • Update-SPAppInstance -Identity $appInstance -App $spapp roykimsharepoint.wordpress.com
  • 39. Publishing $spapp = Import-SPAppPackage -Path Path to app -Site URL -Source Source # Imports the app and sets a variable that you can use to identify the app when you install it in the next step. Install-SPApp -Web URL -Identity $spapp # Installs the app to the subweb you specify. roykimsharepoint.wordpress.com
  • 40. Gotchas/Issues • AppWeb – Access is denied Disable loopback check – prevents reflection attack • VS Deploy App – Output Window: Failed to install app. Error in the xml declarative mark up in the solution files Investigate xml syntax errors. Troubleshoot by removing, one by one, elements in the feature to trace problem area. • Deployment Issues with failing to deploy: Check if App Management and Subscription Settings Service is „started‟ in Central Admin > Manage Service Applications roykimsharepoint.wordpress.com
  • 41. Developer Skills & Knowledge JavaScript • functions, function objects, types, comparison operators, object literals, variable scope, this keyword • null, undefined, NaN • JSON • JQuery • Selectors, $.each, $(document).ready(function() { ... }), module pattern • $.ajax(...) function, $.get(..), $get.post(..) roykimsharepoint.wordpress.com
  • 42. Developer Skills & Knowledge HTML • <div>, <span>, <ul>, <ol>, <li>, <table>, <input> CSS • Layout display, overflow, float, position, top, left, z-index • Structure padding, margin, width, height, • Styling font, color, border, text-overflow, overflow, no-scroll roykimsharepoint.wordpress.com
  • 43. Developer Skills & Knowledge HTTP • Headers, status code, cache headers • http verbs (e.g. get, post, put, delete) • Same original policy (browser security) • REST roykimsharepoint.wordpress.com
  • 44. Tools Client Side • Visual Studio JavaScript Outline Parser http://visualstudiogallery.msdn.microsoft.com/288a2b0f-1357-47b4-8215-1134c36bdf30 • Chrome Developer Tools, FireBug. IE Developer Tools • JS Regex http://www.jslab.dk/tools.regex.php • jsbeautifier.org • Fiddler Server Side • SharePoint Manager 2013 • UlSViewer • PowerShell Editor: PowerGUI http://powergui.org/downloads.jspa roykimsharepoint.wordpress.com
  • 45. Questions Roy Kim • Blog roykimsharepoint.wordpress.com • Email roykimtoronto@gmail.com • Twitter @roykimtoronto roykimsharepoint.wordpress.com

Notes de l'éditeur

  1. DNS Server – Create wild card DNS entry for app web host named sitesApps Service application &amp; Subscription Settings –App Management –These services support apps in your environment by storing the data needed to run apps in the farm. The Subscription Settings service and the App Management Service store app licenses, app principals, app users, app registrations, and so on.
  2. e.g.http://win2008/_api/web/lists/getbytitle(&apos;CoverPhotos&apos;)http://win2008/_api/web/lists/getbytitle(&apos;CoverPhotos&apos;)/items(1)
  3. e.g.http://win2008/_api/web/lists/getbytitle(&apos;CoverPhotos&apos;)http://win2008/_api/web/lists/getbytitle(&apos;CoverPhotos&apos;)/items(1)
  4. http://&lt;appweburl&gt;/_api/SP.AppContextSite(@target)/web/title?@target=&apos;http://win2008‘/PhotoApp/_api/SP.AppContextSite(@target)/web/lists/getbytitle(&apos;CoverPhotos&apos;)/items?$expand=File,ParentList&amp;@target=&apos;http://win2008&apos;