The Artima Developer Community
Sponsored Link

Weblogs Forum
Flex Sample - A rich RDF/RSS reader in 50 lines of code

1 reply on 1 page. Most recent reply: Feb 20, 2006 10:34 AM by san kr

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Sean Neville

Posts: 29
Nickname: psneville
Registered: Jun, 2003

Flex Sample - A rich RDF/RSS reader in 50 lines of code (View in Weblogs)
Posted: Dec 2, 2003 7:41 AM
Reply to this message Reply
Summary
Christophe has provided sample Flex and MXML source worth a peek. While crafting a browser-based RSS reader is not exactly a likely use case, it is more interesting than yet another Hello World intro, and it illustrates just how much can be accomplished in Flash with a few lines of MXML.
Advertisement

I wouldn't look to replace NetNewsWire or FeedDemon (I'm one of those guys who wears out carpet and the swivel feature of his chair by working simultaneously on a Mac and a PC all day long) but what's encouraging to me about this example is just how much can be accomplished with a few declarations using MXML and the Flash components bundled in Flex. It reminds me a bit of how I sometimes feel using Ruby or Python for certain tasks in a Java-dominated server world, in that while not appropriate in every tier -- it seems to excel in the web presentation tier -- it's refreshingly simple without sacrificing power.

Link: http://www.markme.com/cc/archives/003901.cfm

Screenshot:

Source:

<?xml version="1.0" encoding="iso-8859-1"?>

<mx:Application width="900" height="600" xmlns:mx="http://www.macromedia.com/2003/mxml">

    <mx:Style src="main.css"/>

    <mx:Script>
        var selectedBlog;
        var selectedEntry;

        function treeItemSelected(evt) {
            // When a new blog is selected in the tree, use the HTTPService to get the feed
            var url=evt.target.selectedItem.attributes.url;
            if (url!=null) {
                selectedBlog=url;
                feed.send();
            }
        }
    </mx:Script>

    <!-- an XML document containing the list of blogs I read -->
    <mx:XML id="treeModel" src="tree.xml"/>

    <!-- The HTTP Service used to get the feeds  -->
    <mx:HTTPService id="feed" url="{selectedBlog}"/>

    <mx:HBox>
        <!-- The tree displaying blogs organized by categories -->
        <mx:Tree width="250" heightFlex="1" change="treeItemSelected(event);">
            {treeModel}
        </mx:Tree>

        <mx:VBox>
            <!-- The blog header -->
            <mx:VBox verticalGap="0" backgroundColor="#EEF5EE" borderStyle="outset" widthFlex="1">
                <mx:Label styleName="title">
                    {feed.result.rss==null?feed.result.RDF.channel.title:feed.result.rss.channel.title}
                </mx:Label>
                <mx:Label>
                    {feed.result.rss==null?feed.result.RDF.channel.date:feed.result.rss.channel.lastBuildDate}
                </mx:Label>
                <mx:Link click="getUrl('mailto:'+event.target.label)">
                    {feed.result.rss==null?feed.result.RDF.channel.link:feed.result.rss.channel.link}
                </mx:Link>
            </mx:VBox>

            <!-- A datagrid displaying the post titles for the selected blog -->
            <mx:DataGrid widthFlex="1" height="220" change="selectedEntry=event.target.selectedItem"
                dataProvider="{feed.result.rss==null?feed.result.RDF.item:feed.result.rss.channel.item}"
                columnNames="{feed.result.rss==null?['title','date']:['title','pubDate']}"/>

            <!-- The post excerpt -->
            <mx:TextArea id="description" widthFlex="1" heightFlex="1" html="true" wordWrap="true" editable="false">
                {selectedEntry.description}
            </mx:TextArea>

            <!-- A link to the article in the original blog -->
            <mx:Link id="itemLink" click="getUrl(event.target.label, '_blank')">
                {selectedEntry.link}
            </mx:Link>

        </mx:VBox>

    </mx:HBox>

</mx:Application>



san kr

Posts: 1
Nickname: devilsan
Registered: Feb, 2006

Re: Flex Sample - A rich RDF/RSS reader in 50 lines of code Posted: Feb 20, 2006 10:34 AM
Reply to this message Reply
can anyone please provide me the simple source code to retrieve rdf feed using vb.net ? & how to check whether the feed is rdf or RSS feed ? please help !!!
i need it very important .

Flat View: This topic has 1 reply on 1 page
Topic: OpenOffice 2.0 passes the first trial-by-fire Previous Topic   Next Topic Topic: Where is Thinking in Java, 4th Edition?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use