mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 21:13:35 +08:00
Fixing errors that Live Writer was logging on the client.
Fixing errors that Live Writer was having with our datetime format, that we were having with the datetime string Live Writer was giving us and correctly setting an empty response to metaWeblog.getCategories from Orchard.Tags --HG-- branch : dev
This commit is contained in:
@@ -27,7 +27,8 @@ namespace Orchard.Core.XmlRpc.Controllers {
|
||||
new XElement(XName.Get("clientType", ManifestUri), "Metaweblog"),
|
||||
new XElement(XName.Get("supportsKeywords", ManifestUri), "No"),
|
||||
new XElement(XName.Get("supportsCategories", ManifestUri), "No"),
|
||||
new XElement(XName.Get("supportsFileUpload", ManifestUri), "No"));
|
||||
new XElement(XName.Get("supportsFileUpload", ManifestUri), "No"),
|
||||
new XElement(XName.Get("supportsCustomDate", ManifestUri), "No"));
|
||||
|
||||
foreach (var handler in _xmlRpcHandlers)
|
||||
handler.SetCapabilities(options);
|
||||
|
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using Orchard.Core.XmlRpc.Models;
|
||||
@@ -23,7 +24,9 @@ namespace Orchard.Core.XmlRpc.Services {
|
||||
{"double", x=>new XRpcData<double> { Value = (double)x }},
|
||||
{"dateTime.iso8601", x=> {
|
||||
DateTime parsedDateTime;
|
||||
if(!DateTime.TryParse(x.Value, out parsedDateTime)) {
|
||||
// try parsing a "normal" datetime string then try what live writer gives us
|
||||
if(!DateTime.TryParse(x.Value, out parsedDateTime)
|
||||
&& !DateTime.TryParseExact(x.Value, "yyyyMMddTHH:mm:ss", DateTimeFormatInfo.CurrentInfo, DateTimeStyles.None, out parsedDateTime)) {
|
||||
parsedDateTime = DateTime.Now;
|
||||
}
|
||||
return new XRpcData<DateTime> {Value = parsedDateTime};
|
||||
|
@@ -18,8 +18,8 @@ namespace Orchard.Core.XmlRpc.Services {
|
||||
{typeof(bool), p=>new XElement("boolean", (bool)p.Value?"1":"0")},
|
||||
{typeof(string), p=>new XElement("string", p.Value)},
|
||||
{typeof(double), p=>new XElement("double", (double)p.Value)},
|
||||
{typeof(DateTime), p=>new XElement("dateTime.iso8601", ((DateTime)p.Value).ToString("o"))},
|
||||
{typeof(DateTime?), p=>new XElement("dateTime.iso8601", ((DateTime?)p.Value).Value.ToString("o"))},
|
||||
{typeof(DateTime), p=>new XElement("dateTime.iso8601", ((DateTime)p.Value).ToString("yyyy-MM-ddTHH:mm:ssZ"))},
|
||||
{typeof(DateTime?), p=>new XElement("dateTime.iso8601", ((DateTime?)p.Value).Value.ToString("yyyy-MM-ddTHH:mm:ssZ"))},
|
||||
{typeof(byte[]), p=>new XElement("base64", Convert.ToBase64String((byte[])p.Value))},
|
||||
{typeof(XRpcStruct), p=>Map((XRpcStruct)p.Value)},
|
||||
{typeof(XRpcArray), p=>Map((XRpcArray)p.Value)},
|
||||
|
@@ -41,7 +41,7 @@ namespace Orchard.Tags.Services {
|
||||
switch (context.Request.MethodName) {
|
||||
case "metaWeblog.getCategories": // hack... because live writer still asks for it...
|
||||
if (context.Response == null)
|
||||
context.Response = new XRpcMethodResponse();
|
||||
context.Response = new XRpcMethodResponse().Add(new XRpcArray());
|
||||
break;
|
||||
case "wp.getTags":
|
||||
var tags = MetaWeblogGetTags(
|
||||
|
Reference in New Issue
Block a user