From aa003713e65331ee0ad288ed5871e138681ba0ce Mon Sep 17 00:00:00 2001 From: elitsa Date: Mon, 8 Oct 2018 11:57:13 +0200 Subject: [PATCH] Removed files which were added mistakenly discarding merge conflicts. --- .../umbraco/translation/default.aspx | 55 ----- .../umbraco/translation/default.aspx.cs | 211 ------------------ .../translation/default.aspx.designer.cs | 87 -------- .../umbraco/translation/details.aspx | 43 ---- .../umbraco/translation/details.aspx.cs | 107 --------- .../translation/details.aspx.designer.cs | 132 ----------- .../umbraco/translation/preview.aspx | 40 ---- .../umbraco/translation/preview.aspx.cs | 42 ---- .../translation/preview.aspx.designer.cs | 15 -- .../umbraco/translation/xml.aspx | 2 - .../umbraco/translation/xml.aspx.cs | 107 --------- .../umbraco/translation/xml.aspx.designer.cs | 25 --- 12 files changed, 866 deletions(-) delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx.designer.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx.designer.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx.designer.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx.designer.cs diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx deleted file mode 100644 index cf2b31331e..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx +++ /dev/null @@ -1,55 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="../masterpages/umbracoPage.Master" CodeBehind="default.aspx.cs" Inherits="umbraco.presentation.translation._default" %> -<%@ Register TagPrefix="cc1" Namespace="Umbraco.Web._Legacy.Controls" %> - - - - - - - - - - - -

- When you have completed the translation. Upload the edited XML file here. The related translation tasks will automatically be closed when a file is uploaded. -

- - -   - -
- - - -

- -

- -

- <%= Services.TextService.Localize("translation/downloadAllAsXml") %> -     - <%= Services.TextService.Localize("translation/DownloadXmlDTD")%> -

- - - - - "><%#Eval("NodeName") %> - - - - - - - - -
- -
-
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx.cs deleted file mode 100644 index 179e0cac06..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx.cs +++ /dev/null @@ -1,211 +0,0 @@ -using System; -using System.Data; -using System.IO; -using System.Text; -using System.Xml; -using Umbraco.Core.Services; -using Umbraco.Core.IO; -using Umbraco.Core; -using System.Collections.Generic; -using Umbraco.Web.UI.Pages; -using Umbraco.Web._Legacy.BusinessLogic; - -namespace umbraco.presentation.translation -{ - public partial class _default : UmbracoEnsuredPage - { - public _default() - { - CurrentApp = Constants.Applications.Translation; - - } - protected void Page_Load(object sender, EventArgs e) - { - DataTable tasks = new DataTable(); - tasks.Columns.Add("Id"); - tasks.Columns.Add("Date"); - tasks.Columns.Add("NodeId"); - tasks.Columns.Add("NodeName"); - tasks.Columns.Add("ReferingUser"); - tasks.Columns.Add("Language"); - - taskList.Columns[0].HeaderText = Services.TextService.Localize("nodeName"); - taskList.Columns[1].HeaderText = Services.TextService.Localize("translation/taskAssignedBy"); - taskList.Columns[2].HeaderText = Services.TextService.Localize("date"); - - ((System.Web.UI.WebControls.HyperLinkField)taskList.Columns[3]).Text = Services.TextService.Localize("translation/details"); - ((System.Web.UI.WebControls.HyperLinkField)taskList.Columns[4]).Text = Services.TextService.Localize("translation/downloadTaskAsXml"); - - Tasks ts = new Tasks(); - if (Request["mode"] == "owned") - { - ts = Task.GetOwnedTasks(Security.CurrentUser, false); - pane_tasks.Text = Services.TextService.Localize("translation/ownedTasks"); - Panel2.Text = Services.TextService.Localize("translation/ownedTasks"); - } - else - { - ts = Task.GetTasks(Security.CurrentUser, false); - pane_tasks.Text = Services.TextService.Localize("translation/assignedTasks"); - Panel2.Text = Services.TextService.Localize("translation/assignedTasks"); - } - - uploadFile.Text = Services.TextService.Localize("upload"); - pane_uploadFile.Text = Services.TextService.Localize("translation/uploadTranslationXml"); - - foreach (Task t in ts) - { - if (t.Type.Alias == "toTranslate") - { - DataRow task = tasks.NewRow(); - task["Id"] = t.Id; - task["Date"] = t.Date; - task["NodeId"] = t.TaskEntity.EntityId; - task["NodeName"] = t.TaskEntityEntity.Name; - task["ReferingUser"] = t.ParentUser.Name; - tasks.Rows.Add(task); - } - } - - taskList.DataSource = tasks; - taskList.DataBind(); - feedback.Style.Add("margin-top", "10px"); - - } - - protected void uploadFile_Click(object sender, EventArgs e) - { - // Save temp file - if (translationFile.PostedFile != null) - { - string tempFileName; - if (translationFile.PostedFile.FileName.ToLower().Contains(".zip")) - tempFileName = IOHelper.MapPath(SystemDirectories.Data + "/" + "translationFile_" + Guid.NewGuid().ToString() + ".zip"); - else - tempFileName = IOHelper.MapPath(SystemDirectories.Data + "/" + "translationFile_" + Guid.NewGuid().ToString() + ".xml"); - - translationFile.PostedFile.SaveAs(tempFileName); - - // xml or zip file - if (new FileInfo(tempFileName).Extension.ToLower() == ".zip") - { - // Zip Directory - string tempPath = IOHelper.MapPath(SystemDirectories.Data + "/" + "translationFiles_" + Guid.NewGuid().ToString()); - - // Add the path to the zipfile to viewstate - ViewState.Add("zipFile", tempPath); - - // Unpack the zip file - - IOHelper.UnZip(tempFileName, tempPath, true); - - // Test the number of xml files - try - { - StringBuilder sb = new StringBuilder(); - foreach (FileInfo translationFileXml in new DirectoryInfo(ViewState["zipFile"].ToString()).GetFiles("*.xml")) - { - try - { - foreach (Task translation in ImportTranslatationFile(translationFileXml.FullName)) - { - - sb.Append("
  • " + translation.TaskEntityEntity.Name + " " + Services.TextService.Localize("preview") + "
  • "); - } - } - catch (Exception ee) - { - sb.Append("
  • " + ee.ToString() + "
  • "); - } - } - - feedback.type = global::Umbraco.Web._Legacy.Controls.Feedback.feedbacktype.success; - feedback.Text = "

    " + Services.TextService.Localize("translation/MultipleTranslationDone") + "

    " + Services.TextService.Localize("translation/translationDoneHelp") + "

    "; - } - catch (Exception ex) - { - feedback.type = global::Umbraco.Web._Legacy.Controls.Feedback.feedbacktype.error; - feedback.Text = "

    " + Services.TextService.Localize("translation/translationFailed") + "

    " + ex.ToString() + ""; - } - } - else - { - StringBuilder sb = new StringBuilder(); - List l = ImportTranslatationFile(tempFileName); - - if (l.Count == 1) - { - feedback.type = global::Umbraco.Web._Legacy.Controls.Feedback.feedbacktype.success; - feedback.Text = "

    " + Services.TextService.Localize("translation/translationDone") + "

    " + Services.TextService.Localize("translation/translationDoneHelp") + "

    " + Services.TextService.Localize("preview") + "

    "; - } - - else - { - foreach (Task t in l) - { - sb.Append("
  • " + t.TaskEntityEntity.Name + " " + Services.TextService.Localize("preview") + "
  • "); - } - - feedback.type = global::Umbraco.Web._Legacy.Controls.Feedback.feedbacktype.success; - feedback.Text = "

    " + Services.TextService.Localize("translation/MultipleTranslationDone") + "

    " + Services.TextService.Localize("translation/translationDoneHelp") + "

    "; - } - } - - // clean up - File.Delete(tempFileName); - } - } - - private List ImportTranslatationFile(string tempFileName) - { - try - { - List tl = new List(); - - // open file - XmlDocument tf = new XmlDocument(); - tf.XmlResolver = null; - tf.Load(tempFileName); - - // Get task xml node - XmlNodeList tasks = tf.SelectNodes("//task"); - - foreach (XmlNode taskXml in tasks) - { - string xpath = "* [@isDoc]"; - XmlNode taskNode = taskXml.SelectSingleNode(xpath); - - // validate file - Task t = new Task(int.Parse(taskXml.Attributes.GetNamedItem("Id").Value)); - if (t != null) - { - //user auth and content node validation - if (t.TaskEntity.EntityId == int.Parse(taskNode.Attributes.GetNamedItem("id").Value) && (t.User.Id == Security.CurrentUser.Id || t.ParentUser.Id == Security.CurrentUser.Id)) - { - - //TODO: Make this work again with correct APIs and angularized - so none of this code will exist anymore - //// update node contents - //var d = new Document(t.Node.Id); - //Document.Import(d.ParentId, UmbracoUser, (XmlElement)taskNode); - - ////send notifications! TODO: This should be put somewhere centralized instead of hard coded directly here - //ApplicationContext.Services.NotificationService.SendNotification(d.Content, ActionTranslate.Instance, ApplicationContext); - - t.Closed = true; - t.Save(); - - - tl.Add(t); - } - } - } - - return tl; - } - catch (Exception ee) - { - throw new Exception("Error importing translation file '" + tempFileName + "': " + ee.ToString()); - } - } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx.designer.cs deleted file mode 100644 index 9e2985cc89..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx.designer.cs +++ /dev/null @@ -1,87 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.presentation.translation { - - - public partial class _default { - - /// - /// Panel2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.UmbracoPanel Panel2; - - /// - /// feedback control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Feedback feedback; - - /// - /// pane_uploadFile control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane pane_uploadFile; - - /// - /// translationFile control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlInputFile translationFile; - - /// - /// uploadFile control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button uploadFile; - - /// - /// pane_tasks control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane pane_tasks; - - /// - /// lt_tasksHelp control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal lt_tasksHelp; - - /// - /// taskList control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.GridView taskList; - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx deleted file mode 100644 index 8ed685ec35..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx +++ /dev/null @@ -1,43 +0,0 @@ -<%@ Page Title="" Language="C#" MasterPageFile="../masterpages/umbracoPage.Master" AutoEventWireup="true" CodeBehind="details.aspx.cs" Inherits="umbraco.presentation.umbraco.translation.details" %> -<%@ Register TagPrefix="ui" Namespace="Umbraco.Web._Legacy.Controls" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx.cs deleted file mode 100644 index a37a97d02f..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System; -using System.Data; -using System.Web.UI.WebControls; -using Umbraco.Core; -using Umbraco.Core.Services; -using Umbraco.Web.Composing; -using Umbraco.Web._Legacy.BusinessLogic; -using Umbraco.Web; - -namespace umbraco.presentation.umbraco.translation { - public partial class details : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { - - public details() - { - CurrentApp = Constants.Applications.Translation.ToString(); - - } - protected void closeTask(object sender, EventArgs e) { - int translationId = int.Parse(Request["id"]); - Task t = new Task(translationId); - - if (t != null && (t.ParentUser.Id == Security.CurrentUser.Id || t.User.Id == Security.CurrentUser.Id)) { - t.Closed = true; - t.Save(); - Response.Redirect("default.aspx"); - } - } - - - protected void Page_Load(object sender, EventArgs e) { - int translationId = int.Parse(Request["id"]); - Task t = new Task(translationId); - //Document page = new Document(t.Node.Id); - var page = Current.Services.ContentService.GetById(t.TaskEntity.EntityId); - - //Bind meta data and language... - Literal lt = new Literal(); - lt.Text = t.Date.ToLongDateString() + " " + t.Date.ToLongTimeString(); - pp_date.Controls.Add(lt); - pp_date.Text = Services.TextService.Localize("translation/taskOpened"); - - lt = new Literal(); - lt.Text = t.ParentUser.Name; - pp_owner.Controls.Add(lt); - pp_owner.Text = Services.TextService.Localize("translation/taskAssignedBy"); - - //TODO: Make this work again with correct APIs and angularized - so none of this code will exist anymore - //lt = new Literal(); - //lt.Text = Translation.CountWords(t.Node.Id).ToString(); - //pp_totalWords.Controls.Add(lt); - //pp_totalWords.Text = Services.TextService.Localize("translation/totalWords"); - - lt = new Literal(); - - - var umbHelper = new UmbracoHelper(Current.UmbracoContext, Current.Services, Current.ApplicationCache); - lt.Text = umbHelper.ReplaceLineBreaksForHtml(t.Comment).ToString(); - - pp_comment.Controls.Add(lt); - pp_comment.Text = Services.TextService.Localize("comment"); - - lt = new Literal(); - lt.Text = "" + Services.TextService.Localize("download") + ""; - pp_xml.Controls.Add(lt); - pp_xml.Text = Services.TextService.Localize("translation/downloadTaskAsXml"); - - pane_details.Text = Services.TextService.Localize("translation/details"); - panel1.Text = Services.TextService.Localize("translation/details"); - - pane_fields.Text = Services.TextService.Localize("translation/fields"); - pane_tasks.Text = Services.TextService.Localize("translation/translationOptions"); - lt = new Literal(); - lt.Text = "" + Services.TextService.Localize("upload") + ""; - pp_upload.Controls.Add(lt); - pp_upload.Text = Services.TextService.Localize("translation/uploadTranslationXml"); - - if (t.Closed) - pp_closeTask.Visible = false; - else { - pp_closeTask.Text = Services.TextService.Localize("translation/closeTask"); - bt_close.Text = Services.TextService.Localize("close"); - } - - - //Bind page fields - DataTable pageTable = new DataTable(); - pageTable.Columns.Add(Services.TextService.Localize("name")); - pageTable.Columns.Add(Services.TextService.Localize("value")); - - DataRow pageRow = pageTable.NewRow(); - pageRow[Services.TextService.Localize("name")] = Services.TextService.Localize("nodeName"); - pageRow[Services.TextService.Localize("value")] = page.Name; - pageTable.Rows.Add(pageRow); - - //TODO: Make this work again with correct APIs and angularized - so none of this code will exist anymore - //foreach (PropertyType pt in page.ContentType.PropertyTypes) { - // pageRow = pageTable.NewRow(); - // pageRow[Services.TextService.Localize("name")] = pt.Name; - // pageRow[Services.TextService.Localize("value")] = page.getProperty(pt.Alias).Value; - // pageTable.Rows.Add(pageRow); - //} - - dg_fields.DataSource = pageTable; - dg_fields.DataBind(); - } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx.designer.cs deleted file mode 100644 index 75438c010d..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx.designer.cs +++ /dev/null @@ -1,132 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.presentation.umbraco.translation { - - - public partial class details { - - /// - /// panel1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.UmbracoPanel panel1; - - /// - /// pane_details control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane pane_details; - - /// - /// pp_date control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_date; - - /// - /// pp_owner control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_owner; - - /// - /// pp_totalWords control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_totalWords; - - /// - /// pp_comment control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_comment; - - /// - /// pane_tasks control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane pane_tasks; - - /// - /// pp_xml control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_xml; - - /// - /// pp_upload control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_upload; - - /// - /// pp_closeTask control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_closeTask; - - /// - /// bt_close control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button bt_close; - - /// - /// pane_fields control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane pane_fields; - - /// - /// dg_fields control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.DataGrid dg_fields; - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx deleted file mode 100644 index 904b58e56f..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx +++ /dev/null @@ -1,40 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="../masterpages/umbracoPage.Master" CodeBehind="preview.aspx.cs" Inherits="umbraco.presentation.translation.preview" %> - - - - - - - - - - - - - - - -

    Translated version

    Original

    -
    -

    - Please notice that due to templating and unpublished content, the 2 pages can have differences in layout. -

    -
    -
    - - - - - -
    - - - -
    \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx.cs deleted file mode 100644 index 7503f55926..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.Linq; -using Umbraco.Core; -using Umbraco.Web; -using Umbraco.Web._Legacy.BusinessLogic; - -namespace umbraco.presentation.translation -{ - public partial class preview : Umbraco.Web.UI.Pages.UmbracoEnsuredPage - { - public string originalUrl = ""; - public string translatedUrl = ""; - - public preview() - { - CurrentApp = Constants.Applications.Translation.ToString(); - } - - protected void Page_Load(object sender, EventArgs e) - { - - var taskId = int.Parse(Request.GetItemAsString("id")); - - var t = new Task(taskId); - - translatedUrl = string.Format("../dialogs/preview.aspx?id={0}", t.TaskEntity.EntityId); - - var orgRel = Services.RelationService.GetByParentOrChildId(t.TaskEntity.EntityId, "relateDocumentOnCopy").ToArray(); - - if (orgRel.Length > 0) - { - originalUrl = String.Format("../dialogs/preview.aspx?id={0}", orgRel[0].ParentId); - } - else - { - Response.Redirect(translatedUrl); - } - - - } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx.designer.cs deleted file mode 100644 index f1ac9ab84b..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx.designer.cs +++ /dev/null @@ -1,15 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.presentation.translation { - - - public partial class preview { - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx deleted file mode 100644 index 90c37b758e..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx +++ /dev/null @@ -1,2 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="xml.aspx.cs" Inherits="umbraco.presentation.translation.xml" %> - \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx.cs deleted file mode 100644 index 234d38858f..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System; -using System.Collections; -using System.Xml; -using Umbraco.Core; -using Umbraco.Core.Configuration; -using Umbraco.Core.IO; -using Umbraco.Core.Services; -using Umbraco.Core.Xml; -using Umbraco.Web.Composing; -using Umbraco.Web._Legacy.BusinessLogic; - -namespace umbraco.presentation.translation -{ - public partial class xml : Umbraco.Web.UI.Pages.UmbracoEnsuredPage - { - private readonly XmlDocument _xd = new XmlDocument(); - - public xml() - { - CurrentApp = Constants.Applications.Translation.ToString(); - } - - protected void Page_Load(object sender, EventArgs e) - { - Response.ContentType = "text/xml"; - int pageId; - - XmlNode root = _xd.CreateElement("tasks"); - - if (int.TryParse(Request["id"], out pageId)) - { - var t = new Task(pageId); - if (t.User.Id == Security.CurrentUser.Id || t.ParentUser.Id == Security.CurrentUser.Id) - { - XmlNode x = CreateTaskNode(t, _xd); - root.AppendChild(x); - - xmlContents.Text = root.OuterXml; - - Response.AddHeader("Content-Disposition", "attachment; filename=" + t.TaskEntityEntity.Name.Replace(" ", "_") + ".xml"); - } - } - else - { - var nodes = new SortedList(); - int totalWords = 0; - - foreach (Task t in Task.GetTasks(Security.CurrentUser, false)) - { - if (!nodes.ContainsKey(t.TaskEntityEntity.Path)) - { - var xTask = CreateTaskNode(t, _xd); - totalWords += int.Parse(xTask.Attributes.GetNamedItem("TotalWords").Value); - nodes.Add(t.TaskEntityEntity.Path, xTask); - } - } - - // Arrange nodes in tree - var ide = nodes.GetEnumerator(); - while (ide.MoveNext()) - { - var x = (XmlElement)ide.Value; - var parentXpath = "//* [@isDoc and @id = '" + x.SelectSingleNode("//* [@isDoc]").Attributes.GetNamedItem("parentID").Value + "']"; - var parent = _xd.SelectSingleNode(parentXpath); - - if (parent == null) - parent = root; - else - parent = parent.ParentNode; - - parent.AppendChild((XmlElement)ide.Value); - } - - root.Attributes.Append(XmlHelper.AddAttribute(_xd, "TotalWords", totalWords.ToString())); - xmlContents.Text = root.OuterXml; - Response.AddHeader("Content-Disposition", "attachment; filename=all.xml"); - - } - } - - private XmlElement CreateTaskNode(Task t, XmlDocument xd) - { - //var d = new Document(t.Node.Id); - //var x = d.ToPreviewXml(xd);// xd.CreateNode(XmlNodeType.Element, "node", ""); - - var content = Current.Services.ContentService.GetById(t.TaskEntity.EntityId); - - const bool published = false; // no idea really - var x = EntityXmlSerializer.Serialize(Current.Services.ContentService, Current.Services.DataTypeService, Current.Services.UserService, Current.Services.LocalizationService, Current.UrlSegmentProviders, content, published); - - - var xTask = xd.CreateElement("task"); - xTask.SetAttributeNode(XmlHelper.AddAttribute(xd, "Id", t.Id.ToString())); - xTask.SetAttributeNode(XmlHelper.AddAttribute(xd, "Date", t.Date.ToString("s"))); - xTask.SetAttributeNode(XmlHelper.AddAttribute(xd, "NodeId", t.TaskEntity.EntityId.ToString())); - //TODO: Make this work again with correct APIs and angularized - so none of this code will exist anymore - //xTask.SetAttributeNode(XmlHelper.AddAttribute(xd, "TotalWords", cms.businesslogic.translation.Translation.CountWords(d.Id).ToString())); - xTask.AppendChild(XmlHelper.AddCDataNode(xd, "Comment", t.Comment)); - string protocol = UmbracoConfig.For.GlobalSettings().UseHttps ? "https" : "http"; - xTask.AppendChild(XmlHelper.AddTextNode(xd, "PreviewUrl", protocol + "://" + Request.ServerVariables["SERVER_NAME"] + SystemDirectories.Umbraco + "/translation/preview.aspx?id=" + t.Id.ToString())); - // d.XmlPopulate(xd, ref x, false); - xTask.AppendChild(x.ToXmlElement()); - - return xTask; - } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx.designer.cs deleted file mode 100644 index 73982f25c4..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx.designer.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.3053 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.presentation.translation { - - - public partial class xml { - - /// - /// xmlContents control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal xmlContents; - } -}