It's no bother.
I hate to bug you, so late. Where are you located? I am in Rocklin,
California...
On Thu, Apr 19, 2012 at 4:24 PM, Ian Turner <ianatur
...@gmail.com> wrote:
> No, jquery.atd.textarea.js is the meat of it.
> Again forgive me, I don't have the code in front of me (it's after
> midnight and I'm in the bath!)...
> You should be able to set a JavaScript breakpoint inside
> jquery.atd.textarea.js's checkTextArea() function using Firebug (for
> Firefox) or the script debugger in Chrome, then see your textarea replaced
> with a div, and finally a call to the proxy URL via the check() function...
> Or maybe you're calling checkCrossAjax() instead?
> If you like, I can document the front end, illustrating the entire chain
> of function calls (I was thinking of writing a cradle-to-grave article
> aimed at MVC projects tomorrow anyway, and have most of it down)...
> I'll be in the office in 9 hours time, and can send it an hour later.
> Sent from my iPhone4S
> On 20 Apr 2012, at 00:10, Darron Haworth <darron.hawo...@gmail.com> wrote:
> Yes, my service is working fine, I hit it with the data querystring and it
> displays the xml results...
> I am not hitting my proxy right now after making all the changes in the
> MVC piece... I hope this piece is easier, I don't have another couple of
> days on this. ;)
> You mention "for jQuery.ajax calls from the AtD API check method)"
> I was using the jQuery (jquery.atd.textarea.js) Should I be using
> jquery.atd.js instead?
> Thanks!
> On Thu, Apr 19, 2012 at 3:59 PM, Ian Turner <ianatur...@gmail.com> wrote:
>> Well you should already know that your service is working from entering
>> that browser URL while it was running, so all you have to do is join the
>> dots to it from the front end jquery via the proxy. That's the easier bit.
>> I'm testing my version 2 of jquery.atd.textarea.js and will be passing it
>> to the redesign group next week. Hopefully they'll approve my
>> re-architecture of it and we can release the initial version soon.
>> Good luck anyway
>> Cheers
>> Ian
>> Sent from my iPhone4S
>> On 19 Apr 2012, at 23:53, Darron Haworth <darron.hawo...@gmail.com>
>> wrote:
>> Ah, I found it a few minutes ago... I re-read what you wrote and it made
>> total sense. I need some more caffeine!
>> Thanks, you have helped me so much!
>> I tried some other products, wasted half a day on JSpell Evolution for
>> the VP just to find out that it is very buggy. I am going to recommend AtD!
>> I am about to test the complete AtD local server/proxy in my MVC project,
>> I'll let you know how it goes. :)
>> -Darron
>> On Thu, Apr 19, 2012 at 3:50 PM, Ian Turner <ianatur...@gmail.com> wrote:
>>> Exactly - find the variables rpc and rpc_css in jquery.atd.textarea.js
>>> and edit those as shown... Then when you call checkTextArea() it should hit
>>> your proxy class's ProcessRequest method - put a breakpoint in there to see
>>> it get hit
>>> Sent from my iPhone4S
>>> On 19 Apr 2012, at 23:45, Darron Haworth <darron.hawo...@gmail.com>
>>> wrote:
>>> Ian,
>>> I'm not sure I followed the first part of this:
>>> ----------------------------------
>>> In my jquery.atd.textarea.js, I need to configure the rpc (for
>>> jQuery.ajax calls from the AtD API check method) and rpc_css (for
>>> CSSHttpRequest calls from the AtD API checkCrossAJAX method) properties
>>> to hit the proxy on my web server:
>>> rpc: 'CheckSpelling.proxy',
>>> rpc_css: 'CheckSpelling.proxy?data=',
>>> ----------------------------------
>>> I've added the custom route, the web.config stuff, and the proxy but not
>>> sure how to use it... Do I need to edit the jScript files that AtD use?
>>> Thanks,
>>> Darron
>>> On Wed, Apr 18, 2012 at 2:54 AM, Ian Turner <ianatur...@gmail.com>wrote:
>>>> I've seen a few AtD users having issues with the issue of creating a
>>>> proxy for AtD server requests in a c# environment, so I thought I'd post
>>>> mine here.
>>>> I'm running the proxy within an ASP.NET MVC application, using jQuery
>>>> and AtD's checkTextarea API method.
>>>> In my jquery.atd.textarea.js, I need to configure the rpc (for
>>>> jQuery.ajax calls from the AtD API check method) and rpc_css (for
>>>> CSSHttpRequest calls from the AtD API checkCrossAJAX method)
>>>> properties to hit the proxy on my web server:
>>>> rpc: 'CheckSpelling.proxy',
>>>> rpc_css: 'CheckSpelling.proxy?data=',
>>>> Here's the entire proxy class itself (AtDProxyHandler.cs):
>>>> using System.Configuration;
>>>> using System.IO;
>>>> using System.Net;
>>>> using System.Web;
>>>> using System.Web.Routing;
>>>> namespace [YourProjectNamespace].Helpers
>>>> {
>>>> /// <summary>
>>>> /// Definition of the AtDProxyHandler class that receives routing
>>>> requests, as defined in Helpers.RouteMapping, calls the AfterTheDeadline
>>>> server and returns the result.
>>>> /// </summary>
>>>> public class AtDProxyHandler : IHttpHandler, IRouteHandler
>>>> {
>>>> #region Constructor
>>>> /// <summary>
>>>> /// Initializes a new instance of the AtDProxyHandler class.
>>>> /// </summary>
>>>> public AtDProxyHandler()
>>>> {
>>>> ProxiedUrl = string.Format(
>>>> "{0}/{1}?{2}=",
>>>> ConfigurationManager.AppSettings["AtDServer"],
>>>> ConfigurationManager.AppSettings["SpellCheckUrl"],
>>>> ConfigurationManager.AppSettings["SpellCheckDataId"]
>>>> );
>>>> }
>>>> #endregion
>>>> #region Properties
>>>> /// <summary>
>>>> /// Gets or sets the proxied URL that will be called by
>>>> ProcessRequest.
>>>> /// </summary>
>>>> public string ProxiedUrl { get; set; }
>>>> /// <summary>
>>>> /// Gets a value indicating whether the handler IsReusable.
>>>> /// </summary>
>>>> public bool IsReusable
>>>> {
>>>> get { return true; }
>>>> }
>>>> #endregion
>>>> /// <summary>
>>>> /// Implements the ProcessRequest method required by
>>>> IHttpHandler.
>>>> /// </summary>
>>>> /// <param name="context">The HttpContext wrapping the
>>>> request.</param>
>>>> public void ProcessRequest(HttpContext context)
>>>> {
>>>> // assemble a new HTTP request to the proxied URL
>>>> string dataId =
>>>> ConfigurationManager.AppSettings["SpellCheckDataId"].ToString();
>>>> string data = context.Request.RequestType == "GET" ?
>>>> context.Request.QueryString[dataId] : context.Request.Form[dataId];
>>>> string requestStr = string.Format("{0}{1}", ProxiedUrl,
>>>> data);
>>>> HttpWebRequest request =
>>>> (HttpWebRequest)WebRequest.Create(requestStr);
>>>> request.Method = "GET";
>>>> // get the response from the AtD server
>>>> HttpWebResponse response =
>>>> (HttpWebResponse)request.GetResponse();
>>>> StreamReader reader = new
>>>> StreamReader(response.GetResponseStream());
>>>> // return the response, with appropriate encoding
>>>> context.Response.ContentType = context.Request.ContentType
>>>> == "application/x-www-form-urlencoded" ? "text/xml" : "text/css";
>>>> context.Response.StatusCode = 200;
>>>> string responseStr = reader.ReadToEnd();
>>>> context.Response.Write(responseStr);
>>>> context.Response.End();
>>>> }
>>>> /// <summary>
>>>> /// Implements the GetHttpHandler method required by
>>>> IHttpHandler.
>>>> /// </summary>
>>>> /// <param name="requestContext">The HttpContext wrapping the
>>>> request.</param>
>>>> /// <returns>A valid HttpHandler instance.</returns>
>>>> public IHttpHandler GetHttpHandler(RequestContext
>>>> requestContext)
>>>> {
>>>> return this;
>>>> }
>>>> }
>>>> }
>>>> You'll notice in the class constructor that I've tried to make this
>>>> generic, and use a number of web.config setting to abstract the server URL
>>>> (I pick that up later in my Windows service):
>>>> <configuration>
>>>> :
>>>> <appSettings>
>>>> <add key="AtDServer" value="http://127.0.0.1:1049"/>
>>>> <add key="SpellCheckUrl" value="checkDocument"/>
>>>> <add key="SpellCheckDataId" value="data"/>
>>>> </appSettings>
>>>> :
>>>> In order for a request to hit this class (bearing in mind that my
>>>> application is MVC based), you'll need a route configuring in your
>>>> Global.asax.cs RegisterRoutes() method:
>>>> // custom routes
>>>> :
>>>> // spell-checking proxy
>>>> string[] allowedMethods = { "GET", "POST" };
>>>> HttpMethodConstraint methodConstraints = new
>>>> HttpMethodConstraint(allowedMethods);
>>>> routes.Add(
>>>> new Route(
>>>> "{name}/{*everythingelse}",
>>>> new RouteValueDictionary(),
>>>> new RouteValueDictionary(new { name =
>>>> "CheckSpelling.Proxy", httpMethod = methodConstraints }),
>>>> new [YourProjectNamespace].Helpers.AtDProxyHandler()
>>>> )
>>>> );
>>>> // the default controller/action route interpreter for an MVC
>>>> application
>>>> routes.MapRoute(
>>>> "Default", //
>>>> Route name
>>>> "{controller}/{action}/{id}", // URL
>>>> with parameters
>>>> new { controller = "Home", action = "Index", id = string.Empty
>>>> } // Parameter defaults
>>>> );
>>>> And that's it. You can put a breakpoint in the ProcessRequest() method
>>>> and have hours of fun watching your request and response
>>>> :0)
>>>> Regards
>>>> Ian
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "AtD Developers" group.
>>>> To post to this group, send email to atd-developers@googlegroups.com
>>>> To unsubscribe from this group, send email to
>>>> atd-developers+unsubscribe@googlegroups.com
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/atd-developers?hl=en
>>>> You can find more on After the Deadline at
>>>> http://www.afterthedeadline.com/
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "AtD Developers" group.
>>> To post to this group, send email to atd-developers@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> atd-developers+unsubscribe@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/atd-developers?hl=en
>>> You can find more on After the Deadline at
>>> http://www.afterthedeadline.com/
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "AtD Developers" group.
>>> To post to this group, send email to atd-developers@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> atd-developers+unsubscribe@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/atd-developers?hl=en
>>> You can find more on After the Deadline at
>>> http://www.afterthedeadline.com/
>> --
>> You received this message because you are subscribed to the Google Groups
>> "AtD Developers" group.
>> To post to this group, send email to atd-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> atd-developers+unsubscribe@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/atd-developers?hl=en
>> You can find more on After the Deadline at
>> http://www.afterthedeadline.com/
>> --
>> You received this message because you are subscribed to the Google Groups
>> "AtD Developers" group.
>> To post to this group, send email to atd-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> atd-developers+unsubscribe@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/atd-developers?hl=en
>> You can find more on After the Deadline at
>> http://www.afterthedeadline.com/
> --
> You received this message because you are subscribed to the Google Groups
> "AtD Developers" group.
> To post to this group, send email to atd-developers@googlegroups.com
> To unsubscribe from this group, send email to
> atd-developers+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/atd-developers?hl=en
> You can find more on After the Deadline at
> http://www.afterthedeadline.com/
> --
> You received this message because you are subscribed to the Google Groups
> "AtD Developers" group.
> To post to this group, send email to atd-developers@googlegroups.com
> To unsubscribe from this group, send email to
> atd-developers+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/atd-developers?hl=en
> You can find more on After the Deadline at
> http://www.afterthedeadline.com/
--