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.
- 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
- Visual Studio 2015 + ASP.NET Core 1.0
- 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
- 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.
- Locate Microsoft.CobaltCore.dll (you can find it in the GAC of the OWA server):
C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.CobaltCore\
- Install NuGet Package Explorer
- Create new package, drop the dll in it and add some metadata
- Put the .nupkg to your local NuGet feed
WopiHost.Web\Properties\launchSettings.json
WopiHostUrl
- used by URL generatorWopiClientUrl
- 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 clientWopiFileProviderAssemblyName
- name of assembly containing implementation of WopiHost.Abstractions interfacesWopiRootPath
- 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...
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
andWopiHost.Web
. You can set them both as startup projects
- make sure you run both
- run it from the
cmd
- navigate to the WopiHost folder and run
dotnet run
- navigate to the WopiHost folder and 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
toclr
and the value ofdnx-version
to1.0.0-rc1
- in the same window, add all the configuration settings
- navigate to the WopiHost folder and run
Testing the application requires an operational WOPI client. WOPIHost is tested and compatible with:
- Office Web Apps 2013 SP1 (deployment guidelines)
- Office Online Server 2016 (deployment 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 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
.
TODO
TODO
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 :)
- Check out open issues
https://msdn.microsoft.com/en-us/library/ms229042(v=vs.110).aspx
- LICENSE.txt - License for my part of the project
- ORIGINAL_WORK_LICENSE.txt - License for Marx Yu's part of the project. This project is based on Marx Yu's project.
- NOTICE.txt - additional notes to how the licenses are applied
- !!! 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
- https://github.com/OfficeDev/PnP-WOPI + video https://www.youtube.com/watch?v=9lGonu0eoGA
- https://msdn.microsoft.com/en-us/library/dd956775(v=office.12).aspx
- https://channel9.msdn.com/Events/Open-Specifications-Plugfests/Redmond-Interoperability-Protocols-Plugfest-2015/FSSHTTP-File-Synchronization-over-HTTP
- Content roadmap for Office Web Apps Server
- 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