Example

Below is a quick example of a complete Exyus application that allows authorized users to add, edit, delete HTML documents directly on the web. This was tested using the W3C's Amaya web browser. This browser supports inline-editing and uses PUT w/ Etag support to edit data on the web.

using System;
using Exyus.Web;

namespace Exyus.Editable
{
    // full read/write via PUT w/ ETags
    [UriPattern(@"/editable/(?[^/?]*)?(?:\.xcs)(?:[?])?(?:.*)?")]
    [MediaTypes("text/html")]
    public class editPages : XmlFileResource
    {
        public editPages()
        {
            this.ContentType = "text/html";
            this.UpdateMediaTypes = new string[] { "text/html" };
            this.AllowPost = false;
            this.AllowCreateOnPut = true;
            this.DocumentsFolder = "~/documents/editable/";
            this.StorageFolder = "~/storage/editable/";
            this.XHtmlNodes = new string[] { "//body" };
            this.LocalMaxAge = 600;
            this.ImmediateCacheUriTemplates = new string[]
                {
                    "/editable/.xcs",
                    "/editable/{docid}.xcs"
                };
        }
    }

}