sharepoint-hosted app alexander krupsky artur kukharevich

21
SharePoint-hosted app Alexander Krupsky Artur Kukharevich

Upload: tucker-hayford

Post on 11-Dec-2015

225 views

Category:

Documents


4 download

TRANSCRIPT

  • Slide 1

SharePoint-hosted app Alexander Krupsky Artur Kukharevich Slide 2 SharePoint-hosted app Cross-domain calls Localization 2 . Slide 3 . : 1. 2. 3. SharePoint-hosted app Slide 4 -Workflow ( ) - Event Receiver - JS . Slide 5 . app ? MSDN: In some cases, the app will require certain information or choices to be provided before the app can function. When your app requires information before it can function, you should provide a user experience that guides the user to the settings page to update the configuration. You should add the settings page URL to the apps top-right menu if appropriate so that users can find it easily. If your app has a getting started experience or other settings, you can add those also. For more information, see How to: Use the client chrome control in apps for SharePoint. . Slide 6 , . app, , SharePoint API : 1. 2. Date Overlap . Slide 7 : iFrame . Client Web Parts Slide 8 iframe var resizeMessage = ' resize({Width}, {Height}) '; resizeMessage = resizeMessage.replace("{Sender_ID}", senderId); resizeMessage = resizeMessage.replace("{Height}", newHeight); resizeMessage = resizeMessage.replace("{Width}", newWidth); window.parent.postMessage(resizeMessage, "*"); SenderId , query string. !!! , Client Web Part () . . Client Web Parts Slide 9 workflow? . Workflow Slide 10 , , ) MSDN: Do not use the WebTemplate element in the app manifest to designate any of the built-in SharePoint site definition configurations as the app web's site type. We do not support using any of the built-in site definition configurations, other than APP#0, for app webs. Slide 11 Using REST ( AppWebProxy.aspx): $.getScript(scriptbase + "SP.RequestExecutor.js", execCrossDomainRequest); function execCrossDomainRequest() { var executor; 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 } ); } Cross-domain calls Slide 12 Cross-domain calls. Architecture Slide 13 Using REST ( AppWebProxy.aspx): var context = new SP.ClientContext(_appweburl); var factory = new SP.ProxyWebRequestExecutorFactory(_appweburl); context.set_webRequestExecutorFactory(factory); var appContextSite = new SP.AppContextSite(context, _hostweburl); // context.executeQueryAsync(); : https://spsitepro.sharepoint.com/sites/apps Cross-domain calls Slide 14 ) AppManifest Visual Studio . Localization. Slide 15 (Lists, ContentTypes ..), App Web : $Resources:Resource_key; Localization. App Web Slide 16 App Client Web Part, Ribbon Actions. : $Resources:Resource_key; : Localization. Hosted-Web Slide 17 4.Copy these resource-related Relationship elements and save them in a text file outside the package so you can reuse them in a later step. 5.Close the AppManifest.xml.rels file. 6.In the _rels folder, open the featureGUID.xml.rels file. This file specifies the OPC relationships of the featureGUID.xml file and all its child files, such as elements.xml files, to other files in the package. 7.Paste into the Relationships element all of the Relationship elements that you copied from the AppManifest.xml.rels file. Its OK to use the same relationship IDs because you are pasting them into a different parent Relationships element. 8.Save (as UTF-8) and close the file. 9.Close the.zip file and then remove the ".zip" from the end of the file name. The app package can now be installed on your test SharePoint website. Localization. Hosted-Web"> Microsoft : To add OPC relationship markup to the app package 1.Append a.zip extension to the app package. 2.In the.zip file, open the folder named _rels. 3.Open the AppManifest.xml.rels file. This file specifies the OPC relationships of the AppManifest.xml file to other files in the package. The file contains a Relationship element for the Resources.resx file and for each of the Resources.LL-CC.resx files. The following are examples: 4.Copy these resource-related Relationship elements and save them in a text file outside the package so you can reuse them in a later step. 5.Close the AppManifest.xml.rels file. 6.In the _rels folder, open the featureGUID.xml.rels file. This file specifies the OPC relationships of the featureGUID.xml file and all its child files, such as elements.xml files, to other files in the package. 7.Paste into the Relationships element all of the Relationship elements that you copied from the AppManifest.xml.rels file. Its OK to use the same relationship IDs because you are pasting them into a different parent Relationships element. 8.Save (as UTF-8) and close the file. 9.Close the.zip file and then remove the ".zip" from the end of the file name. The app package can now be installed on your test SharePoint website. Localization. Hosted-Web Slide 18 Msdn AddRelsToAppPackage (http://msdn.microsoft.com/en-us/library/fp179919.aspx)http://msdn.microsoft.com/en-us/library/fp179919.aspx Deploy!!!!! Localization. Hosted-Web Slide 19 , deploy publish. .csproj : : Localization. Hosted-Web Slide 20 Localization. UI alert ??? Slide 21 ;)