ublic Link GetLink([FromUri] FileRequest fileRequest)
{
if (ModelState.IsValid)
{
var xml = WebConfigurationManager.AppSettings[ "appDiscoveryXml" ];
var wopiServer = WebConfigurationManager.AppSettings[ "appWopiServer" ];
bool updateEnabled = false ;
bool .TryParse(WebConfigurationManager.AppSettings[ "updateEnabled" ], out updateEnabled);
WopiAppHelper wopiHelper = new WopiAppHelper(HostingEnvironment.MapPath(xml), updateEnabled);
var result = wopiHelper.GetDocumentLink(wopiServer + fileRequest.name);
var rv = new Link
{
Url = result
};
return rv;
}
throw new ApplicationException( "Invalid ModelState" );
}
|