Exyus is an HTTP/REST engine written for the Windows/ASP.NET platform. this blog lists code changes and other important updates to the code base.

2008-02-27

checked in minor changes to exyus

p>i checked in two minor changes to the exyus code tree this evening.

the first is a spelling change for an internal argument for one of the constructors of the HTTPClient class. the second change is the addition of public bool NoCache property to the CollectionRequestor class in the same code file. this does not change the default behavior (defaults to true) but offers the option of turning off the "no-cache" behavior of the CollectionRequestor class.

these are minor, i know. i've been swamped with other things over the last two weeks. i hope to dive back into coding this coming weekend. i have some tutorial articles to finish up as well. maybe i can post one of those before the weekend arrives.

2008-02-17

Update Source and Binaries Posted

I posted an updated set of source & binaries this evening: http://code.google.com/p/exyus/downloads/list

This set has the most recent changes to the SMTPResource as well as updated samples (SendMail and Server-Side Mashup). The SMTPResource might be a bit flaky. I need to complete some tests and update the SendMail sample, too.

As usual, feedback is welcome!

Server-Side Mashups w/ Exyus

i completed a simple server-side mashup example using exyus last night.

this pulls info from two remote sites (National Geographic News and USGS Earthquake Hazards Program) and combines that with some local XML content into a single page. This is done using the XmlPageResouce class. i added a bit of CSS to the thing to spruce it up, but otherwise, there's nothing fancy there. just exyus coolness[g]!

i plan on doing a short tutorial on doing server mashups and posting it to the Articles section of the main site later this evening.

2008-02-16

SMTPResource - take 2

i completed the update of my SMTPResource this evening.

this one has an expanded object model. no longer are you limited to to, from, subject, body elements. now there is a replyto element an the to, cc, bcc elements are all collections of name/email pairs. this offers quite a bit of flexibility. i am also adding a priority and content-type for the body element. i've started testing, but still need to tweak things a bit more.

the text/xml version works fine. however, i need to work up the transforms and validators for application/json and application/x-www-urlencoded versions. not planning on a plain/text or application/atom+xml implementation right now, but that's just more XML/XSD work - no new code.

i hope to have this solid by tomorrow and will roll it into the weekly update release (if all goes well). not too bad, eh?

2008-02-11

SMTPResource class checked in

i checked into the source code a new resource class to exyus this evening. the new SMTPResource class handles the details of accepting POSTed values and using them to send an SMTP email message. this first implementation is very rudimentary (no support for CC/BCC, etc.) but it gets things started. i'll refine it over the next few days and then roll it up into the weekly builds for next weekend.

the code for declaring an instance class is pretty simple. here's my current test version:

using System;
using Exyus.Web;

namespace Exyus.Samples
{
    [UriPattern(@"/sendmail/\.xcs")]
    [MediaTypes("application/x-www-form-urlencoded", "text/xml")]
    class SendMail : SMTPResource
    {
        public SendMail()
        {
            this.AllowPost = true;
            this.ContentType = "text/xml";
            this.DocumentsFolder = "~/documents/sendmail/";
            this.PostLocationUri = "/sendmail/thankyou";
            this.RedirectOnPost = true;
            this.XHtmlNodes = new string[] {"//body"};
        }
    }

    [UriPattern(@"/sendmail/thankyou\.xcs")]
    [MediaTypes("text/html")]
    class SendMailThankyou : StaticResource
    {
        public SendMailThankyou()
        {
            this.Content = Helper.ReadFile("/xcs/content/sendmail/thankyou.html");
        }
    }
}

the redirect to the StaticResource class is an added flourish, but handy. i'm not sure if this will be part of the final release or if i'll roll something else into the base class (like a pointer to a document, etc.).

anyway, i've been wanting to implement an SMTP-based resource for quite some time and i finally sat down and pulled one together. nice to have!

2008-02-09

New Demo Added, Runtime Updated

A new demo app (ZipCheck)is now available. This demo shows how to use HTTP/REST constraints to build web apps that provide immediate feedback without using Ajax or other scripting services. The source is viewable online and is included in the latest exyus runtime. Also, a new version of the exyus runtime install kit has been updated and posted to the exyus googlecode site. This is a minor update that cleans up some utility functions and cookie-handling code.

2008-02-03

Exyus runtime updated : now with JSON inside

i updated the exyus runtime this afternoon. i also updated the exyus main site. finally, i updated the TaskList. i even posted a new article covering a new command-line demo app called TaskList Client. it's been a fun week!

the biggest news for this release is the inclusion of JSON support 'in the box.' now, exyus can accept POST/PUT representations in JSON format. technically, exyus has supported JSON for HTTP GET - it's just a transform [g]. but now exyus has full support for JSON. i was able to do this relatively quickly because i found a solid C# library for JSON called Nii.JSON at the json.org site. not sure who wrote it. i think it was a port from a java library. anyway, it's solid and sweet. i needed to add my own routine to consistently convert incoming JSON into valid XML. took al bit of effort, but it's all cool now.

anyway, the new runtime is up and available. i had a good week!

2008-02-02

Tasklist-cmd Tutorial Posted

i posted a new tutorial (TaskList Client Tutorial) on the exyus site this evening. this one shows how to use the HTTPClient class inside exyus to create full-featured HTTP clients that run on your desktop instead of in your browser.

it was fun to put together. the app was easy (see my previous post on that). writing the tutorial was also pretty cool. not a lot to it, but it all falls together pretty nicely. the app allows you to list, add, edit, and delete records stored on the server. it uses HTTP commands (GET, PUT, POST, DELETE) and works like a champ. here's a sample of the code in the client app.

public XmlDocument GetList()
{
    client.RequestHeaders.Set("cache-control", "no-cache");
    string results = client.Execute(Uri, "get", "text/xml");
    XmlDocument doc = new XmlDocument();
    doc.LoadXml(results);
    return doc;
}

public XmlDocument GetItem(string id)
{
    string results = client.Execute(Uri + id, "get", "text/xml");
    p_etag = client.ResponseHeaders["etag"];
    XmlDocument doc = new XmlDocument();
    doc.LoadXml(results);
    return doc;
}

public void AddItem(string name)
{
    AddItem(name, "0");
}

public void AddItem(string name, string completed)
{
    client.Execute(Uri, "post", "text/xml", string.Format(p_new_task, name, completed));
}

you can check out the entire app (TaskList Client) at the exyus googlecode site.