Skip to content

Latest commit

 

History

History
131 lines (108 loc) · 8.04 KB

README.md

File metadata and controls

131 lines (108 loc) · 8.04 KB

Introduction

Build status codecov

This project is an example implementation of a WOPI host. Basically, it allows developers to integrate custom datasources with Office Web Apps / Office Online Server (or any other WOPI client app) by implementing a few of interfaces.

Features / improvements

  • clean WebAPI built with ASP.NET Core MVC, no references to System.Web
  • automatically discovers capabilities of a WOPI client and acts accordingly
  • can be self-hosted or run under IIS
  • file manipulation is extracted to own layer of abstraction (there is no dependency on System.IO)
    • example implementation included (provider for Windows file system)
    • file identifiers can be anything (doesn't have to correspond with the file's name in the file system)
  • generation/validation of access tokens is also extracted to its own layer
  • concrete implementations are loaded using Autofac
  • URL generator
  • Configuration done via Microsoft.Framework.Configuration
  • all references are NuGets

Usage

Prerequisites

  1. Visual Studio 2015 + ASP.NET Core 1.0
  2. Following NuGet sources:
  • api.nuget.org (https://api.nuget.org/v3/index.json)
    • default NuGet source
  • Local (e.g. C:\Users\username\Documents\NuGet)
    • this will contain your Microsoft.CobaltCore.15.0.0.0.nupkg
  1. Microsoft.CobaltCore.15.0.0.0.nupkg. One of the dependencies is Microsoft.CobaltCore.dll. This DLL is part of Office Web Apps 2013 / Office Online Server 2016 and its license doesn't allow public distribution and therefore it's not part of this repository. Please make sure your OWA/OOS server and user connecting to it have valid licenses before you start using it.
  2. Locate Microsoft.CobaltCore.dll (you can find it in the GAC of the OWA server): C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.CobaltCore\
  3. Install NuGet Package Explorer
  4. Create new package, drop the dll in it and add some metadata
  5. Put the .nupkg to your local NuGet feed

Configuration

WopiHost.Web\Properties\launchSettings.json

  • WopiHostUrl - used by URL generator
  • WopiClientUrl - used by the discovery module to load WOPI client URL templates

WopiHost\Properties\launchSettings.json

  • WopiClientUrl - used by the discovery module to identify capabilities of WOPI client
  • WopiFileProviderAssemblyName - name of assembly containing implementation of WopiHost.Abstractions interfaces
  • WopiRootPath - provider-specific setting used by WopiFileSystemProvider (which is an implementation of IWopiFileProvider working with System.IO)
  • server.urls - hosting URL(s) used by Kestrel. Read more...

Running the application

Once you've successfully built the app you can:

  • run it directly from the Visual Studio using IIS Express or selfhosted.
    • make sure you run both WopiHost and WopiHost.Web. You can set them both as startup projects
  • run it from the cmd
    • navigate to the WopiHost folder and run dotnet run
  • run it in IIS (tested in IIS 8.5)
    • navigate to the WopiHost folder and run dnu publish --runtime active
    • copy the files from WopiHost\bin\output to your desired web application directory
    • run the web.cmd file as administrator, wait for it to finish and close it (Ctrl+C and y)
    • create a new application in IIS and set the physical path to the wwwroot in the web application directory
    • make sure the site you're adding it to has a binding with port 5000
    • go to the application settings and change the value of dnx clr to clr and the value of dnx-version to 1.0.0-rc1
    • in the same window, add all the configuration settings

Testing & Compatibility

Testing the application requires an operational WOPI client. WOPIHost is tested and compatible with:

The deployment requires the server to be part of a domain. If your server is not part of any domain (e.g. you're running it in a VM sandbox) it can be overcame e.g. by installing DC role. After it's deployed you can safely remove the role and the OWA server will remain functional. To test your OWA server follow the instructions here. To remove the OWA instance use Remove-OfficeWebAppsMachine.

Using in your web project

TODO

Extending

TODO

Known issues / TODOs

There is plenty of space for improvements in the overall architecture, implementation of the [MS-*] protocols or just finishing the TODOs in the code. Lot of refactoring still needs to be done and also the code style has to be unified. So please feel free to help me out with it :)

Contributing

https://msdn.microsoft.com/en-us/library/ms229042(v=vs.110).aspx

License

Useful resources

Building WOPI Host

FSSHTTP

Other relevant resources

Building WOPI Client