Skip to content

FeodorFitsner/WopiHost

 
 

Repository files navigation

Introduction

Build status

This project is an example implementation of a WOPI host. It's based on Marx Yu's project. WOPI host allows Office Web Apps or any other WOPI client to consume documents. Basically, it allows developers to connect Office Web Apps to any thinkable source of data. (Requires implementation of a few interfaces.)

Motivation

The intention was to try out the new technologies like ASP.NET 5 and MVC 6 in some useful way.

Features / improvements

  • clean WebAPI built with MVC 6, no references to System.Web
  • automatically discovers capabilities of a WOPI client and acts accordingly
  • can be hosted as a web app as well as a windows application
  • 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.ConfigurationModel
  • all references are NuGets

Usage

Prerequisites

  1. Visual Studio 2015 + ASP.NET 5 beta 6
  2. Following NuGet sources:
  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 and its license doesn't allow public distribution and therefore it's not part of this repository. Please make sure you have a valid license to OWA 2013 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\v4.0_15.0.0.0__71e9bce111e9429c
  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

SampleWeb\Properties\launchSettings.json

  • WopiHostUrl - used by URL generator
  • WopiClientUrl - used by discovery module and for URL generation
  • WopiFileProviderAssemblyName - name of assembly containing implementation of WopiHost.Contracts interfaces
  • WopiRootPath - provider-specific setting used by WopiFileSystemProvider (which is an implementation of IWopiFileProvider working with System.IO)

WopiHost\Properties\launchSettings.json

  • WopiClientUrl - used by discovery module and for URL generation
  • WopiFileProviderAssemblyName - name of assembly containing implementation of WopiHost.Contracts interfaces
  • WopiRootPath - provider-specific setting used by WopiFileSystemProvider (which is an implementation of IWopiFileProvider working with System.IO)

Running the application

Once you've successfully built the app you can:

  • run it directly from the Visual Studio (in IIS Express or selfhosted web command)
  • run it from the cmd
    • navigate to the WopiHost folder and run dnx . web

Testing

Testing the application requires an operational WOPI client. I use Office Web Apps and I'm not sure if there is any other client. When deploying OWA 2013 please follow the guidelines. 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 remove the role and the OWA will remain functional.

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

!!! NEW & SUPERCOOL Documentation: https://wopi.readthedocs.org/ http://blogs.msdn.com/b/officedevdocs/archive/2013/03/20/introducing-wopi.aspx http://blogs.msdn.com/b/scicoria/archive/2013/07/22/building-an-office-web-apps-owa-wopi-host.aspx https://code.msdn.microsoft.com/office/Building-an-Office-Web-f98650d6

Other relevant resources

http://www.asp.net/web-api/overview/formats-and-model-binding/parameter-binding-in-aspnet-web-api https://weblog.west-wind.com/posts/2009/Feb/05/Html-and-Uri-String-Encoding-without-SystemWeb http://blogs.msdn.com/b/scicoria/archive/2013/06/24/office-web-apps-wopi-host-and-url-paths.aspx http://weblogs.asp.net/imranbaloch/k-kvm-kpm-klr-kre-in-asp-net-vnext

Building WOPI Client

http://www.sharepointcolumn.com/edition-1-wopi-client-in-sharepoint-2013/ http://www.wictorwilen.se/sharepoint-2013-building-your-own-wopi-client-part-2

About

No description, website, or topics provided.

Resources

License

Unknown, BSD-3-Clause licenses found

Licenses found

Unknown
LICENSE.txt
BSD-3-Clause
ORIGINAL_WORK_LICENSE.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 48.5%
  • C# 45.7%
  • PowerShell 5.3%
  • Other 0.5%