Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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));
        }