feature(csharp-mvc): forgotten files page

This commit is contained in:
Serik Ibragimov
2024-04-17 13:24:01 +05:00
parent 2f2ef0e65f
commit b1167516d4
7 changed files with 348 additions and 0 deletions

View File

@ -17,6 +17,8 @@
*/
using System;
using System.Collections.Generic;
using System.Collections;
using System.IO;
using System.Web.Mvc;
using OnlineEditorsExampleMVC.Helpers;
@ -31,6 +33,33 @@ namespace OnlineEditorsExampleMVC.Controllers
return View();
}
public ActionResult Forgotten()
{
var files = new List<Dictionary<string, string>>();
var response = TrackManager.commandRequest("getForgottenList", null);
ArrayList keys = (ArrayList)response["keys"];
// fetch forgotten files from the document server
foreach (string key in keys)
{
var file = new Dictionary<string, string>();
var fileResult = TrackManager.commandRequest("getForgotten", key);
file.Add("key", fileResult["key"].ToString());
file.Add("url", fileResult["url"].ToString());
file.Add(
"type",
FileUtility.GetFileType(fileResult["url"].ToString())
.ToString()
.ToLower()
);
files.Add(file);
}
return View("Forgotten", new ForgottenFilesModel(files));
}
// viewing file in the editor
public ActionResult Editor(string fileName, string editorsMode, string editorsType, string directUrl)
{