Tuesday, December 30, 2008

DNN and Podcasting

by Phil 'iwonder' Guerra

- (Mission, KS) - Here's a bit of something I ran across while looking into a question about DNN and whether or not it supports podcasts. First, out of the box, DNN will support podcast with only the XML/XSL module, and you'll need a custom xsl to do it.

Secondly, the presentation and results vary by browser. I created a custom xsl that enables presentation of the information in a newsfeed that point (links) to the actual podcast, which is usually an mp3 or video file of some sort. It's pretty straightforward transformation of the enclosure element, which contains a URL, type, and size. All 3 attributes are important as there are some issues with downloading that content for some browsers, at least that's the case when IE7 is used. Firefox did not have a problem, but I ran into issues when I used IE7. Why?

Well, it took some googling, but here's a link to the secret, IE7 has a 'limit' on the size it will allow to be downloaded. No file larger than 15MB on servers that do not support HTTP range requests. Since, I'm using a test environment built on Windows XP, and using IIS v5.0, I'm not sure if that's the real problem or not. I'll toss the custom XSL I created to test and show how I'm doing this for a particular site, DNN Creative DotNetNuke Podcasts and give me feedback. (I don't have a public DNN website, it's a matter of controlling my expenses, which is why I blog freely.)

Anyway, using FireFox, tells me that DNN will support presentation of news feeds that include podcasts, and that's the good news.

Here's an example XSL to use with the DNN XML/XSL module to present the DNNCreative Podcast newsfeed. Just a couple notes:
1) I'm not advocating adding the ability to include enclosures wholesale on a website. There are a number of security issues with doing so. I provide this example as quick 'how-to' not as a reccommended practice. Above all know your newssource and test on a non-production site to aovid issues.

2) This example was specifically built to transform the DNN Creative DotNetNuke Podcast feed. As such, you would have to modify it for any other use. Also, feeds change formats from time to time, so it may not always work. However, if you are seriously considering doing this type of thing, you'll need to be more than a novice with XML and XSL to get the most of this type of transformation.

3) To use this code, cut and paste it into a text file using a simple text editor. Save it as PodcastEnabled.xsl, and then upload it to you site during the setup conversation of a DNN XML/XSL module. I know the formatting of this code is less than desireable, but that's a function of my blogger app, so sorry. If you have a lot of problems with the xsl example, leave a comment and I'll go over it.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
xmlns:media="http://search.yahoo.com/mrss/"
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" >
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
<!-- phil 'iwonder' guerra - PodcastEnabled.xsl - custom xsl for DnnCreative Podcasts -->
<xsl:template match="/">
<div>
<xsl:apply-templates select="rss/channel"/>
</div>
</xsl:template>
<xsl:template match="rss/channel">
<xsl:apply-templates select="item"/>
</xsl:template>
<xsl:template match="item">

<xsl:variable name="item_link" select="link"/>
<xsl:variable name="podlink" select="enclosure/@url"/>
<xsl:variable name="podmedia" select="enclosure/@type"/>
<xsl:variable name="altmedia" select="feedburner:origLink"/>
<xsl:variable name="item_title" select="description"/>
<div class="rssItemDescription">
<xsl:value-of select="description" disable-output-escaping="yes"/>
</div>
<div class="rssItemSub">
<xsl:if test="enclosure/@url">
<a href="{$podlink}">Listen Now</a> (<xsl:value-of select="$podmedia"/> - Size <xsl:value-of select="enclosure/@length"/>)<br></br>
</xsl:if>
<xsl:if test="not(enclosure/@url)">
<a href="{$altmedia}">See the Video</a>
</xsl:if>

(<xsl:value-of select="pubDate"/>) <hr/>
</div>
</xsl:template>
</xsl:stylesheet>

Wednesday, December 24, 2008

Useful Site Links for RSS Info

by Phil 'iwonder' Guerra

--- (Mission, KS) - I've been asked about how one goes about learning about RSS in general, and how to learn more about DNN's usage of it. I'll post some links to sites, posts, and articles, I've found useful for folks from novice to advanced. Again, links change so frequently, just drop me a comment, or email if one goes sour.

DNN Creative - DNN and RSS content - Lee Sykes developed this site years back. He has a lot of information on RSS and DNN. Some content is free, while other is available via subscription. At last check the RSS information was still free, with some of it culled from DNN forums and smartly organized by Lee. Good info all around for RSS, a nice tutorial for newbies. Although, many of the examples are using the older RSS module, the basic info about RSS is still relevant.

RSS and Atom Specifications

If you are going to work with RSS, you'll want to examine the following sites, which speak to the actual specifications for RSS. DNN, currently uses RSS internally, and the new module is supposed to seamlessly support various RSS specifiations, but as I've mentioned before there are quite a few 'gotchas'. Whenever I'm in doubt about a particular news source's implementation, I refer to these sites for reference.

Now, truthfully, there is wide disagreement over which spec and version to adopt. In the end, the choice as a developer is up to you. The only thing that really matters is that you take the time to follow the specs. Nothing is worse than a feed that says it's a certain RSS or Atom feed implementation, and then does not follow the defined specs.

RSS v2.0 Specifications - Official RSS Advisory Board - The keeper of the specification changed, but the information is the same. Here on this site is a wealth of information about RSS v2.0, including samples, and explainations of the specification. If you are a developer writing a news generator for RSS v2.0, you really have no excuse for not learning all you can, which includes all of the information about what is and what is not valid usage. If you are using RSS newfeeds, you really need to understand the specification to get the most use out of any newsfeed that utilizes RSS v2.0. Other versions of RSS are archived and linked from this site, as well.

Atom v1.0 - This document specifies Atom, an XML-based Web content and metadata syndication format. It's not the user friendly format site, but the RFC document. Again, this spec should be something you know to get the most out of any Atom feed.


Atom Enabled v0.3 and v1.0 - This is a nice site with loads of information. Not as dry as the RFC, but I refer to it becuase it, also, describes the protocol for the publishing world.


Custom Namespaces

Namespace references are utilized within newsfeeds to extend the RSS version specifications. As RSS has evolved, the specs originally conceived with RSS could not envision the many usages that syndication adopters needed. The ability to extend the specifications was a way to offer the ability to allow for the future. Take a look at the source of your newsfeed, and I'd bet you'll find a custom namespace thrown in to use some custom xml tag contained in it. Just like the RSS specs, by definition a custom namespace needs a reference for developers to understand what is and isn't allowed. Most news readers will check the specs and fail to present any unknown tags or invalid usage. It isn't always clear cut, but understanding these custom tags begins with knowing about their implementation.

Dublin Core (DC) - The document in this link summarizes the updated definitions for the Dublin Core metadata elements as originally defined in [RFC2413]. These new definitions will be officially known as Version 1.1. The tags defined are used quite frequently in the more popular newsfeeds.

Newsfeed Validation

Many times you wonder about a news feed source. Especially, using DNN's latest version, which gives almost no worthwhile information if a feed fails. Just getting a 'download error' message does you no good. So, how can you tell what's going on? Well, as Ian Anderson from Jethro Tull proclaimed 'Nothing Is Easy'. If you continue to run into issues. One step I highly recommend is to validate your newsfeed source. You'll get an idea of the kind of errors that are likely to be thrown by a 'good' newsfeed reader.

W3C Feed Validation Service, for Atom and RSS - There are more than a couple of sites that allow validation on-line, and this is the one I use most often. The site pointed to in the above link is useful for Atom and RSS.

Useful Developer Tools

by Phil 'iwonder' Guerra

--- (Mission, KS) - In this blog entry, I'll list some of the tools I use in working with XML and DNN. Due to the fast changing world of the internet, not all links my work, but at the time of this posting, all were functioning. I don't get paid for this kind of endorsement, so don't hound me, if you don't find the tool useful, or if you run into problems with using it. I can't offer any tutorials on them - because as my friend, Morris 'Uncle' Milton would say, 'Like man it's free!'.

1) PFE32 - Basic Text Editor - I use it because it's much handier than any other ascii text editor, including NotePad.

2) Xselerator - XML/XSL Debugging Tool - This is one great tool for developing and debugging XML and XSL. It used to be a free 30 day trial, but now is an open source project. Even if this tool cost money, I would recommend getting it. I use it most everyday. It's available at Sourceforge, so get it as soon as you can.

That's all for now. I'll post more as I think about it.

How to Find the RSS Version of Your Feed

by Phil 'iwonder' Guerra

(Mission, KS) --- Ok, lets talk about some basics. In the best of all worlds, when you setup a newsfeed using the DNN News Feeds (RSS) module, there should be a display of basic RSS feed info to help you understand the type of feed you have, in case you have to troubleshoot it. Now, for the real world. The module only gives you an error message when setting up the feed after you've set it up, and the feed is accessed. If a feed has trouble, you usually, just get an error message - ya, know the one 'Download Error'. Of course, this gives you nothing to go on. What's up? What can you do to investigate and fix the problem? Well, in my real world, I take these approach.

Let's start from square one...

1) Always, use a browser first to check a newsfeed for accessibility, and to determine what version of RSS is being used. You'll save yourself a lot of time, if you take this fist step before setting it up in DNN. I know you shouldn't have to do this type of thing, but believe me, this is the real world side of RSS syndication, not just DNN news syndication presentation.

If you can't get the feed to display in your browser, it has no chance of displaying in DNN, because the module code basically does a download of the feed in a similar manner, though there are some differences behind the scenes.

2) Next, examine the feed news source by using your browser's 'View Source' feature'. The way to do it, depends on the browser being used, though. Using MS IE, just right click while on the content of the page, and your default text editor will display the info. Using FireFox, right click and choose 'View Page Source'. In both these scenarios, the display of the source will largely be unformatted and difficult to decipher. I select all of the text and copy it. Then, I paste it into either my prefferred text editor, PFE32, or in Xselerator (both indespensible tools). With xslerator, I can use the 'tidy' button to display the feed in better fashion.

3) I examine the source looking at the xml tag that defines the RSS version, and has information about any custom namespaces that may be used in to define tags beyond the default RSS version tags. This part is extremely importand when troubleshooting DNN RSS news module setups. The information of interest looks something like this example:

<?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'>

In the example, we see that the feed is an RSS Atom v1.0 feed and uses a custom namespace defined in the Atom namespace.

Another example, this one is from USAToday, and it says it's an RSS v2.0. Note there are 2 custom namespaces used in the feed. One signals it is an RSS v2.0 Feedburner type of feed, and the other calls Microsoft's custom namespace cf. Both, types of namespaces will have tags that are not used in the DNN News Feeds (RSS) module. Although, both are available for use and are syntactically correct.

<?xml version="1.0" encoding="UTF-8"?><rss
xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" version="2.0">

Lastly, though not finally, as there many varieties of news feeds, is the OPML feed. This type of feed is really just a directory style listing of links assembled using the OPML spec, which is a fancy type of XML, as are all newsfeeds. Note, this spec hasn't changed much since it was introduced.

<?xml version="1.0" encoding="UTF-8" ?>
<opml version="1.1">

The above are the 3 most likely types of newsfeeds you'll encounter, although each has a variety of flavors depending on the news source provider. All of these basic types of news feeds are supposed to be supported with the new DNN news module, but there are a lot of gotchas along the way. I'll blog about those in another entry.

4) Again, while using Xselerator, I pull in the default xsl file from DNN, and use the 'green arrow' to translate the feed using the xsl. Now, if all is well, then the feed will display, provided I've set up the necessary paramters for the example with the DNN params used in the RSS module. If the feed does not work, it isn't going to display in DNN, but you're not done. The sad fact is - it may still fail after setting it up in DNN giving you a download error, due to a variety of problems. Notwithstanding, incorrect formatting, missing attributes, or the RSS version is not supported.

5) Validate your news feed source. A newfeed validation service allows you to get a better idea of what kind of errors are being encountered. Most feeds you encounter are going to be either RSS flavored or Atom flavored, and the validation service I find most useful is the W3C Feed Validation Service, for Atom and RSS. This is a very important step, as DNN is going to be more strict about newsfeeds following specifications, even though their internal implementation that generates newsfeed doesn't alway comply either. Strange huh!.

Keep in mind that browsers are a lot more forgiving when they present newsfeeds, and that really has to do more with the differences in a browser application and a web framework like DNN. The browsers are more capable of sanitizing and converting newsfeeds into an acceptable presentation. Why? Well, it's a difficult task to judge a newsfeed's implementation.

The biggest problem with DNN's latest module is attempting to allow aggregation of newsfeeds that use different formats. The idea was interesting, but unfortunately, the process is much too failure prone to be useful. My feeling is that the DNN News Feed (RSS) module needs to forget about being an aggregator altogether, or at least allow only similar formatted newsfeeds sources in any one aggregation. Prior to the latest module's introduction, a very workable aggregator was available with the News Explorer module. Unfortunately, now this is broken.

Now, I know this is a bare bones approach without much in the way of a tutorial, but I don't have a lot of time today, so if you're interested in knowing more, leave a comment, and I'll expand on the topic.

Look for a 'Useful Developer Tools' Blog entry for short descriptions and links to developer tools I use, and why.

Thursday, December 11, 2008

Feed Explorer Broken...

by Phil 'iwonder' Guerra

(Mission, KS) --- I've been using the Feed Explorer module for a bit, so I'm ok with how to set it up and some of the nuances and other tricks using it. However, while investigating an issue for someone else, I've found that there is a problem with it. The Feed Explorer module seems to be busted in v04.09.00 and in v.05.00 rc. I lose the tabs whenever I change the settings for the Feed Explorer's Content Source option. I have to delete the module and recreate it to see them again. Further, this means that I cannot use it for anything other than the default configuration, which is - how do I say it? Very Bogus.

So, it would be helpful to have a Forum for this module, since it is a seperate module, and one that comes with the default setup of DNN. BTW, does anyone else see the same thing in their dnn v04.09.00 and up installs? Losing tabs and inability to configure the module without breaking it.

I did not notice this issue for so long, mainly because I've been so focused on the new release of the News module. Unfortunately, my preference at this stage is to use the Feed Explorer module for situations where I need to aggregate feeds, because I don't like the way that the News modules does it. Now, with this latest issue, I can't use it for DNN sites using versions above v04.06. Hope we can get it fixed soon.

Monday, December 1, 2008

How To Get Help on the DNN Forums

by Phil 'iwonder' Guerra

- (Mission, KS) I know this may sound trivial, but the question gets asked many times, so I thought, it would be worthwhile to revisit the approach I find works best for me. Hope it works for you too!

1. Search for a key phrase. There may be an answer to your issue already out in the ether-land. Try using your favorite search engine and enter a key phrase or keywords to check for other posts or information. Not all hits apply to your specific issue, but it gives a head start on how to zero in on a solution. You just may find a resource that can help, or that your issue is already answered, which means you don't have to duplicate it on the official DNN forums.

2. Include Environment Specifics. It's extremely helpful to those anwering posts for help to know the environment details when you encounter an issue. For example, include the following:
- DNN version
- Operating System (i.e. XP Pro, Server 2003, or whatever you are using)
- Database Info - SQL2005, SQLExpress or whatever.
- Hosted or Non-hosted setup. Is this a test private setup or hosted by an outside vendor?
- Module versions. It really helps to know the module version being used.
- Brief error description, doesn't have to be everything that is dumped to the screen, just the meat without the fat.

3 Keep posts friendly. The DNN forums is not a profit-organization, it's maintained by volunteers, and most often the folks answering are willing to help, and are not getting paid. The folks that respond do so because they are committed to the project.

4. Review Existing Posts and Bug Issues. A lot of issues are tracked in the official bug tracker or can be seen as items on a project's road map. While it may take time to go through the posts, it doesn't help to duplicate posts with reporting similar issues. Duplicates only add to the number of posts others have to review. Again, responders tend to want to answer once, and expect folks to look for the help already offerred.

5. Pay It Forward. If you can help answer a post question, do so. Remember it's a community. Give your expertise to further the project.

6. Be Patient. Responders have their priorities as well. Understand folks will help, but it may take some time to duplicate and test the issue you report.

7. Keep On Subject. Resist the urge to hijack a thread with non-relevant comments. If you have positive responses to aid in the solution, add the information, otherwise, keep it real.

8. Say When. If your issue is resolved, say so, and mark the issue answered. Always give thanks to the folks that helped, they will appreciate it.