From 0ca2c88e67c8a60fe7c6cf881b7b80a4ed42b09e Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Wed, 22 Sep 2010 20:46:10 +0000 Subject: [PATCH] UploadInfo page implemented --- Builder/IISMainHandler/build.txt | 2 +- Common/Common.csproj | 1 + Common/URL/UrlManager.cs | 2 ++ Common/URL/upload/Info.cs | 29 +++++++++++++++++++ IISMainHandler/HandlersFactory.cs | 1 + IISMainHandler/IISMainHandler.csproj | 1 + .../handlers/response/UploadInfoHandler.cs | 28 ++++++++++++++++++ templates/Full/UploadInfo.xslt | 18 ++++++++++++ templates/Full/elems/UploadInfo.xslt | 2 +- 9 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 Common/URL/upload/Info.cs create mode 100644 IISMainHandler/handlers/response/UploadInfoHandler.cs create mode 100644 templates/Full/UploadInfo.xslt diff --git a/Builder/IISMainHandler/build.txt b/Builder/IISMainHandler/build.txt index 3bd8434..f6e16be 100644 --- a/Builder/IISMainHandler/build.txt +++ b/Builder/IISMainHandler/build.txt @@ -1 +1 @@ -1492 \ No newline at end of file +1496 \ No newline at end of file diff --git a/Common/Common.csproj b/Common/Common.csproj index 04844c3..1d81187 100644 --- a/Common/Common.csproj +++ b/Common/Common.csproj @@ -165,6 +165,7 @@ + diff --git a/Common/URL/UrlManager.cs b/Common/URL/UrlManager.cs index bd995e6..b01aa7d 100644 --- a/Common/URL/UrlManager.cs +++ b/Common/URL/UrlManager.cs @@ -274,6 +274,8 @@ namespace FLocal.Common.URL { switch(requestParts[1].ToLower()) { case "item": return new upload.Item(requestParts[2], GetRemainder(requestParts, 3)); + case "info": + return new upload.Info(requestParts[2], GetRemainder(requestParts, 3)); case "list": return new upload.List(GetRemainder(requestParts, 2)); case "new": diff --git a/Common/URL/upload/Info.cs b/Common/URL/upload/Info.cs new file mode 100644 index 0000000..d8ed225 --- /dev/null +++ b/Common/URL/upload/Info.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using FLocal.Core; +using FLocal.Common.dataobjects; + +namespace FLocal.Common.URL.upload { + public class Info : AbstractUrl { + + public readonly Upload upload; + + public Info(string uploadId, string remainder) : base(remainder) { + this.upload = Upload.LoadById(int.Parse(uploadId)); + } + + public override string title { + get { + return this.upload.filename; + } + } + + protected override string _canonical { + get { + return "/Upload/Info/" + this.upload.id + "/"; + } + } + } +} diff --git a/IISMainHandler/HandlersFactory.cs b/IISMainHandler/HandlersFactory.cs index 51b1a22..bbad401 100644 --- a/IISMainHandler/HandlersFactory.cs +++ b/IISMainHandler/HandlersFactory.cs @@ -41,6 +41,7 @@ namespace FLocal.IISHandler { { typeof(URL.QuickLink), CreateHandler }, { typeof(URL.Robots), CreateHandler }, { typeof(URL.Static), CreateHandler }, + { typeof(URL.upload.Info), CreateHandler }, { typeof(URL.upload.Item), CreateHandler }, { typeof(URL.upload.List), CreateHandler }, { typeof(URL.upload.New), CreateHandler }, diff --git a/IISMainHandler/IISMainHandler.csproj b/IISMainHandler/IISMainHandler.csproj index f15dd97..693f38f 100644 --- a/IISMainHandler/IISMainHandler.csproj +++ b/IISMainHandler/IISMainHandler.csproj @@ -152,6 +152,7 @@ + diff --git a/IISMainHandler/handlers/response/UploadInfoHandler.cs b/IISMainHandler/handlers/response/UploadInfoHandler.cs new file mode 100644 index 0000000..d4ca37e --- /dev/null +++ b/IISMainHandler/handlers/response/UploadInfoHandler.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using FLocal.Core; +using FLocal.Common; +using System.Xml.Linq; +using FLocal.Common.dataobjects; +using FLocal.Core.DB; +using FLocal.Core.DB.conditions; + +namespace FLocal.IISHandler.handlers.response { + class UploadInfoHandler : AbstractGetHandler { + + protected override string templateName { + get { + return "UploadInfo.xslt"; + } + } + + protected override IEnumerable getSpecificData(WebContext context) { + return new XElement[] { + this.url.upload.exportToXml(context), + }; + } + + } +} diff --git a/templates/Full/UploadInfo.xslt b/templates/Full/UploadInfo.xslt new file mode 100644 index 0000000..dcaebe7 --- /dev/null +++ b/templates/Full/UploadInfo.xslt @@ -0,0 +1,18 @@ + + + + + Àïëîàä + + + + + +
+ + +
+
+
+ +
\ No newline at end of file diff --git a/templates/Full/elems/UploadInfo.xslt b/templates/Full/elems/UploadInfo.xslt index 48d3b83..608c286 100644 --- a/templates/Full/elems/UploadInfo.xslt +++ b/templates/Full/elems/UploadInfo.xslt @@ -12,7 +12,7 @@ - /Upload/Item// + /Upload/Info//