public override OpenWOPIDocument ViewDocument(string source, OpenWOPIAccessToken accessToken, bool loadMetadata = false) { VisioDocument doc = new VisioDocument(source, accessToken, OpenWOPIProofKey.ReadFromConfiguration(OpenWOPIClientConfiguration.Current)); if (loadMetadata) doc.CheckFileInfo(); doc.GetFile(); string t = doc.ExtractThumbnail(); doc.ConvertEMFToPng(t, 200); return doc; }
public override OpenWOPIDocument ViewDocument(string source, OpenWOPIAccessToken accessToken, bool loadMetadata = false) { OpenWOPITextDocument doc = new OpenWOPITextDocument(source, accessToken, OpenWOPIProofKey.ReadFromConfiguration(OpenWOPIClientConfiguration.Current)); if (loadMetadata) { doc.CheckFileInfo(); } doc.GetFile(); return(doc); }
public OpenWOPIDiscoveryModel() { _zones = new List <OpenWOPIZone>(); OpenWOPIClientConfiguration configuration = OpenWOPIClientConfiguration.Current; string protocols = configuration["protocols"]; InternalBaseUrl = configuration["internal-url"]; ExternalBaseUrl = configuration["external-url"]; ProofKey = OpenWOPIProofKey.ReadFromConfiguration(configuration); if (protocols == "http" || protocols == "both") { if (!String.IsNullOrEmpty(InternalBaseUrl)) { _zones.Add(OpenWOPIZone.InternalHttp); } if (!String.IsNullOrEmpty(ExternalBaseUrl)) { _zones.Add(OpenWOPIZone.ExternalHttp); } } if (protocols == "https" || protocols == "both") { if (!String.IsNullOrEmpty(InternalBaseUrl)) { _zones.Add(OpenWOPIZone.InternalHttps); } if (!String.IsNullOrEmpty(ExternalBaseUrl)) { _zones.Add(OpenWOPIZone.ExternalHttps); } } var types = (from assembly in AppDomain.CurrentDomain.GetAssemblies() from type in assembly.GetTypes() where (type.GetCustomAttributes(typeof(OpenWOPIAppAttribute), true).Length > 0) select type).ToList(); List <OpenWOPIApp> apps = new List <OpenWOPIApp>(); foreach (var type in types) { apps.Add(new OpenWOPIApp(type)); } foreach (var zone in _zones) { zone.Apps = apps; } }
public ActionResult Save(OpenWOPIDocumentPostData data) { TextAppModel model = new TextAppModel(); OpenWOPITextDocument doc = new OpenWOPITextDocument(SourceFile, data.AccessToken, OpenWOPIProofKey.ReadFromConfiguration(OpenWOPIClientConfiguration.Current)); doc.CheckFileInfo(); doc.Content = data.Content; doc.PutFile(); // TODO: handle errors in the WebException view return(Redirect(doc.HostEditUrl)); }