public IActionResult ShowFile(string pid, string fid) { DSActions dsa = new DSActions(_env); var fi = dsa.GetFileInfo(fid); var url = HttpContext.Request.Host.ToString(); string fileurl = "https://" + url + fi["path"]; ViewBag._file = fileurl; ViewBag._doctype = fi["type"]; var docinfo = dsa.GetFileProperties(pid, fid); var _html = docinfo.html; if (docinfo.Count > 0) { if (fi["type"].ToString() == "UNKNOWN") { _html += "<a class='btn btn-primary float-right ml-2' href='/classify/" + pid + "/" + fid + "/" + docinfo[0].docProps["doc.type"].Value.ToString() + "'>Accept Classification</a>"; } else { _html += "<a class='btn btn-primary float-right ml-2' href='/classify/" + pid + "/" + fid + "/" + docinfo[0].docProps["doc.type"].Value.ToString() + "'>Update Classification</a>"; } } ViewBag._html = _html; ViewBag.pID = pid; ViewBag.fID = fid; return(View("File")); }
public IActionResult CheckFileCompliance(string pid, string fid) { DSActions dsa = new DSActions(_env); var fi = dsa.GetFileInfo(fid); var url = HttpContext.Request.Host.ToString(); string fileurl = "https://" + url + fi["path"]; ViewBag._file = fileurl; ViewBag._doctype = fi["type"]; ViewBag._html = dsa.CheckFileProperties(pid, fid); ViewBag.pID = pid; ViewBag.fID = fid; return(View("File")); }
public IActionResult ClassifyFile(string pid, string fid) { DSActions dsa = new DSActions(_env); var fi = dsa.GetFileInfo(fid); ViewBag._file = fi["path"]; docu3cAPIClient d3 = new docu3cAPIClient(); var url = HttpContext.Request.Host.ToString(); string fileurl = "https://" + url + fi["path"]; //Used for testing ONLY. //fileurl = "https://docworksweb.azurewebsites.net/data/1593383499/ACC_XFR_Abraham%20C%20Diaz_.pdf"; var docinfo = d3.ClassifyDocument("comp", fileurl); docinfo.html = docu3cAPIClient.SetDocHTML(docinfo); dsa.SaveFileProperties(pid, fid, docinfo); var _html = docinfo.html; if (docinfo.Count > 0) { if (fi["type"].ToString() == "UNKNOWN") { _html += "<a class='btn btn-primary float-right ml-2' href='/classify/" + pid + "/" + fid + "/" + docinfo[0].docProps["doc.type"].Value.ToString() + "'>Accept Classification</a>"; } else { _html += "<a class='btn btn-primary float-right ml-2' href='/classify/" + pid + "/" + fid + "/" + docinfo[0].docProps["doc.type"].Value.ToString() + "'>Update Classification</a>"; } } ViewBag._html = _html; ViewBag.pID = pid; ViewBag.fID = fid; return(View("File")); }