Coding, content and startups

James Crowley

Archive for March, 2004

The Coolest DHTML Grid Widget

with 2 comments

Came across another great DHTML Widget on SourceForge today (thanks to my good friend Thushan Fernando for pointing it out to me!). It’s a cross-browser grid called ActiveUI, complete with client-side sorting, resizable columns and icons! Very cool. Take a look at http://www.activeui.net/.

Written by james.crowley

March 19th, 2004 at 10:45 pm

Posted in Uncategorized

The Coolest DHTML Calendar Widget…

with 2 comments

Just came across a very cool DHTML Calender control that – guess what – allows you to select dates/times and stick them in an input field! Obviously its client-side, so its nice and fast, customizable, released under LGPL, and best of all works in almost any browser (Internet Explorer, Opera, Mozilla, Safari …).


http://dynarch.com/mishoo/calendar.epl


Definitely worth a look :,,)

Written by james.crowley

March 9th, 2004 at 10:10 am

Posted in Uncategorized

New RSS Feed for Developer Fusion

with 6 comments

Well, I’ve finally gotten around to publishing an RSS feed for the articles on Developer Fusion . You can get it here – http://www.developerfusion.com/rss/contentrss.aspx?type=articles&language=all .


For anyone who’s interested in the code behind it – I just wrote this simple helper class.

/// <summary>
/// Enables the generation of an RSS feed
/// </summary>
public class RSSFeedGenerator
{
    XmlTextWriter writer;
    public RSSFeedGenerator( System.IO.Stream stream, System.Text.Encoding encoding )
    {
        writer = new XmlTextWriter(stream, encoding);
        writer.Formatting = Formatting.Indented;
    }
    public RSSFeedGenerator( System.IO.TextWriter w )
    {
        writer = new XmlTextWriter(w);
        writer.Formatting = Formatting.Indented;
    }
    /// <summary>
    /// Writes the beginning of the RSS document
    /// </summary>
    public void WriteStartDocument()
    {
        writer.WriteStartDocument();
        //writer.WriteComment(“Generated by Developer Fusion RSS feed at ” + DateTime.Now.ToString(“r”));
        writer.WriteStartElement(“rss”);
        writer.WriteAttributeString(“version”,”2.0″);
    }
    /// <summary>
    /// Writes the end of the RSS document
    /// </summary>
    public void WriteEndDocument()
    {
        writer.WriteEndElement(); //rss
        writer.WriteEndDocument();
    }
    /// <summary>
    /// Closes this stream and the underlying stream
    /// </summary>
    public void Close()
    {
        writer.Flush();
        writer.Close();
    }
    /// <summary>
    /// Begins a new channel in the RSS document
    /// </summary>
    /// <param name=”title”></param>
    /// <param name=”link”></param>
    /// <param name=”description”></param>
    public void WriteStartChannel(string title, string link, string description, string copyright )
    {
        writer.WriteStartElement(“channel”);
        writer.WriteElementString(“title”,title);
        writer.WriteElementString(“link”,link);
        writer.WriteElementString(“description”,description);
        writer.WriteElementString(“language”,”en-gb”);
        writer.WriteElementString(“copyright”,copyright);
        writer.WriteElementString(“generator”,”Developer Fusion RSS Feed Generator v1.0″);
        writer.WriteElementString(“webMaster”,”James Crowley”);
        writer.WriteElementString(“lastBuildDate”,DateTime.Now.ToString(“r”));
        writer.WriteElementString(“ttl”,”20″);
       
    }
    /// <summary>
    /// Writes the end of a channel in the RSS document
    /// </summary>
    public void WriteEndChannel()
    {
        writer.WriteEndElement(); //channel
    }
    /// <summary>
    /// Writes an item to a channel in the RSS document
    /// </summary>
    /// <param name=”title”></param>
    /// <param name=”link”></param>
    /// <param name=”description”></param>
    /// <param name=”author”></param>
    /// <param name=”publishedDate”></param>
    /// <param name=”category”></param>
    public void WriteItem(string title, string link, string description, string author, DateTime publishedDate, string subject)
    {
        writer.WriteStartElement(“item”);
        writer.WriteElementString(“title”,title);
        writer.WriteElementString(“link”,link);
        writer.WriteElementString(“description”,description);
        writer.WriteElementString(“author”,author);
        writer.WriteElementString(“pubDate”,publishedDate.ToString(“r”));
        //writer.WriteElementString(“category”,category);
        writer.WriteElementString(“subject”,subject);
        writer.WriteEndElement();
    }
}


and then it was *really* simple to generate the RSS! :)

// set the content type
Page.Response.ContentType = “text/xml”;
// create a RSS feed generator for the output
RSSFeedGenerator gen = new RSSFeedGenerator(Page.Response.Output);
gen.WriteStartDocument();
gen.WriteStartChannel(“Developer Fusion RSS Feed”,
“http://www.developerfusion.com/”,
“Summary of the latest articles published on Developer Fusion”,
“Copyright © Developer Fusion Ltd, 1999-2004″);
// generate the items here
gen.WriteItem(“Some Great Article,”http://www.developerfusion.com/show/10/”,”description”,”James Crowley”,DateTime.Now, “ASP.NET”);
// clear up
gen.WriteEndChannel();
gen.WriteEndDocument();
gen.Close();

Oh – and if anyone can show me how to post this code correctly on these weblogs, then please drop me a line!

Written by james.crowley

March 1st, 2004 at 5:50 pm

Posted in Uncategorized