Tuesday, May 5, 2009

DNN Core Team Not Working on Improving Internal Syndication

by Phil ‘iwonder’ Guerra (Countryside, KS) -

I finally got a response to my question about what was being done to improve DNN’s internal syndication. The answer: N-O-T-H-I-N-G. That’s right nada, zip. I guess there are too many other pressing matters to deliver a commercial version of DNN that doesn’t have the many holes that the ‘community edition’ has in it.

Ah, well, I guess I’ll do my own thing, even if it breaks with every new release. It’s really a shame that I hear DNN needs help with this and that, and folks offer to help, and never get any contact from the gods on the mountain. Makes me wonder why anyone is trying to do anything for DNN for free.

Thursday, April 30, 2009

DNN News v4.0.01 Custom XSL - pubDate Sorting

by Phil 'iwonder' Guerra (Happy Rock, MO) -

First, in order to provide aggregation features to the module, all feeds used in the News module must be converted to an RSSv2.0 type of feed, which I'll call a DNN_RSSv2.0 format. The intention and goal was to allow different formats of feed sources to be aggregated, and rendering such a diverse collection called for some type of standard format, and RSSv2.0 was chosen.

So, how do you render a feed sorted by pubDate? Well, here' s where some of that sanitation and validation of source news feeds pays off. The News module takes an incoming news feed source, validates it, and transforms it into a new RSS feed, and one of the elements used in this process is a special custom namespace element called, pubDateParsed. This element is created during the transformation process, and turns out to be handy for providing a simple way to sort the item elements by it. You can see the feed that the module creates by looking at the database table for the News module, and looking at the data in the Cache attribute. I suggest copying an example, and pasting it into a text file for review, but here's what an example item element contains:

<item>
<description>Polish prosecutors are raising the death toll from a fire that ripped through a homeless shelter in mid-April to 23 after DNA ...<p>
<a href="http://feedads.g.doubleclick.net/~at/RWMBZpjtAANqdf4thEFQrwJI_pI/0/da"><img src="http://feedads.g.doubleclick.net/~at/RWMBZpjtAANqdf4thEFQrwJI_pI/0/di" border="0" ismap="true">
</img>
</a>
<br/>
<a href="http://feedads.g.doubleclick.net/~at/RWMBZpjtAANqdf4thEFQrwJI_pI/1/da"><img src="http://feedads.g.doubleclick.net/~at/RWMBZpjtAANqdf4thEFQrwJI_pI/1/di" border="0" ismap="true">
</img>
</a>
</p>
<img src="http://feeds2.feedburner.com/~r/usatoday-NewsTopStories/~4/O6aWvd6_g_Q" height="1" width="1"/>
</description>
<link>http://rssfeeds.usatoday.com/~r/usatoday-NewsTopStories/~3/O6aWvd6_g_Q/2009-04-30-poland_N.htm</link>
<pubDate>Thu, 30 Apr 2009 15:16:07 GMT</pubDate>
<pubDateParsed xmlns="http://www.dotnetnuke.com/modules/news">2009-04-30T15:16:07</pubDateParsed&gt;
<title>DNA results in; Poland raises fire death toll to 23</title>
</item>

The pubDateParsed element uses the pubDate information to convert it to a sortable format date, although there is no real support for its use yet, we can create a custom XSL to 'activate' it. All we have to do is add the sort statements to the default.xsl and save it as a custom xsl.

Here's how it works. We use the pubDateParsed element and define a custom namespace to declare it. Then, add the sort function call, feed it the sort key, and sort order. Resulting in the XSL that follows...

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dnn="http://www.dotnetnuke.com/modules/news">
<!-- DNNv4.0.1 pubDateSortDSC -->
<!-- by Phil 'iwonder' Guerra -->
<!-- 2008-11-23 -->
<!-- Use with attribution please -->
<xsl:output method="html" indent="yes"/>
<xsl:param name="ItemsToShow"/>
<xsl:param name="ShowItemDetails"/>
<xsl:param name="ShowItemDate"/>
<xsl:param name="Locale"/>
<xsl:template match="rss">
<xsl:for-each select="channel/item[position()&lt;=$ItemsToShow or $ItemsToShow&lt;1]">
<xsl:sort
select="dnn:pubDateParsed"
data-type="text"
order="descending"/>
<p class="DNN_News_ItemLink">
<a href="{link}" target="_main"> <xsl:value-of select="title"/>
</a>
</p>
<xsl:if test="$ShowItemDate='true'">
<p class="DNN_News_ItemDate">
<xsl:value-of select="pubDate"/>
</p>
</xsl:if>
<xsl:if test="$ShowItemDetails='true'">
<p class="DNN_News_ItemDetails">
<xsl:value-of select="description" disable-output-escaping="yes"/>
</p>
</xsl:if>
</xsl:for-each>
</xsl:template></xsl:stylesheet>

I just create 2 custom XSL files, one to sort ascending and the other sorts descending. Then, I choose which one I want to use in the module instance setup. It's pretty simple once you understand what the module is emitting and giving you.

Hopefully, the next version will add support in the setup to allow passing a sort order, and the option to sort. Until then, you'll need to create two versions, one that sorts ascending and another to sort descending. Of course, you could add support to the News module yourself, which I did, but I would not advise it, as custom work done once to a DNN module needs to be done over and over as new versions are released. Sometimes the effort is worth it, others may not be. This is one of those times where it's not really a good idea, in my opinion, I am comfortable with having the two versions handy, all I have to do to change the sort order, is just specify the desired custom XSL in the module setup.

Wednesday, April 29, 2009

DNN News Module - Bridging the Gap

by Phil 'iwonder' Guerra (Avondale, MO)

"I know nothing is perfect, but..." That's a line I hear so much in my day to day work. Seems my job as a Technical Coordinator, System Administrator, System Analyst, Programmer, and Technology Trash man is knowing enough about imperfection to provide workarounds for those times when software or circumstances fail to reach their mark, and leaves a huge gap. Most of these moments come to me at the 11th hour in a project that I knew nothing about, because Directors or Project Managers didn't think I would be needed at the early project meetings. Anyhow, if you work in IT, you know what I'm talking about. So, what has this to do with the DNN News module?

Well, though the News v4.x module is a ambitious step forward, there are a few gaps that folks have pointed out. (Read the DNN News forum) I've been openly critical of some of these gaps, only with the intent of making it better. I have the utmost respect for the project leader, Peter. I know the personal and professional challenges in taking on any project with such a huge following, having too few resources to help, and the politics of not being able to bring innovation too quickly. So it is with the News module.

I've had a little custom XSL hanging about unpublished, as I thought maybe the gap would be filled with the next release, and it still might be. The real question is when, though. Since, I've gotten enough email about the issue, I decided, I'd go ahead and publish a solution. This custom XSL is my little innovation to bridge one gap, the lack of a sorting routine, which hopefully is in the works.

I will present a way to provide sorting by a news feed's pubDate element, using a custom XSL specifically for the DNN News v4.0.1 module in the next post.

Monday, March 30, 2009

DNN Internal Syndication - Branding Syndicated Content

by Phil 'iwonder' Guerra - (Avondale, MO) - As you’ve probably seen, the latest versions of browsers provide a quick interface to syndicate newsfeeds and present them with just a few clicks of a button. It’s a nice feature, and for those folks that don’t want to use a stand-alone news reader, it offers a quick link to keep up with their favorite web sites. The one problem with using a browser to present a news feed is most do not support use of your site’s Channel details to be rendered. That’s an unfortunate situation, as it takes away one of the primary reasons for creating syndicated content. No doubt many companies would like their company icon and a brief note about what they offer, displayed with their syndicated content. However, browser technology is deciding what to render, whether you like it or not, and your site's channel details are often left out. The end result is you may be missing out of a marketing opportunity to brand your syndicated content when it is used with browsers.

Using Microsoft’s Internet Explorer and Apple’s Safari, you get a feed rendered, and only the Channel Title is displayed. With the FireFox browser, you may get the site title and description. So, what can you do about the situation?

The simple solution with DNN is to always include an entry that contains that information. However, that approach may not be possible if the module you are syndicating doesn’t give you an opportunity to do it. This simple solution may be impractical depending on how many module instances you have that offer syndicated content because you have to add an entry item for each one. Implementation of internal syndication varies by DNN module, so there is no one set way to achieve the solution.

Another approach that I took involves adding a bit of code to the DNN core, RSSHandler.vb. You’ll find this code in the /Library/Services/Syndication folder, with DNNv5.0.0. The bit I’ve added calls a simple routine to always add an item to syndicated content, which includes the Portal title, description, and you could add graphics if you choose to do it. Now, when a users clicks the syndicate icon, and their browser renders it, they will get the Site branding displayed as a newsfeed item.

The code I’ve added may not be best practices, but it’s working for me, and the client is happy, and that’s the most important item of all. Here’s the code, and note after you’ve added it, you can just choose to build the library from VS2005 or VS2008 to implement it. I place the call to the routine right about the line that checks searchResults, this way I always add my site branding item, even if there are no other items available. In fact, RSS v2.0 specifications state that there should always be at least 1 item in a feed, so this makes DNN internal syndication more RSS v2.0 compliant.

Channel.Items.Add(AddSiteBranding())

If searchResults IsNot Nothing Then….

Next, the routine that adds the site branding item:


Private Function AddSiteBranding() As GenericRssElement

Dim item As GenericRssElement = New GenericRssElement()
item("title") = GetPortalSettings.PortalName
item("description") = GetPortalSettings.Description
item("link") = AddHTTP(GetDomainName(Request))
item("pubDate") = Now().ToUniversalTime.ToString("r")
item("guid") = AddHTTP(GetDomainName(Request))
Return item

End Function

Now, be sure that you add only item tags that match what the feed is already adding to maintain consistency in your newsfeed. The result gives you a syndicated feed that displays your Portal Name, along with the Description of your portal. Now, when folks syndicate it in a browser, you’ll have a bit of a marketing edge always available. I’ve thought of some other variations of this type of branding, including adding some database items and using a routine to fetch items randomly. Otherwise, what is being displayed actually comes from your Portal’s information. Hopefully, you are using the Host Administration page to add your portal description, which is the source for this information. You can even add an image to the Portals description textbox to add more branding to your feed.

Here’s what an example implementation looks like in IE8, the first item in the feed is the branding item.






Of course, you might want to make the other core code changes I’ve mentioned in previous installments on my blog to get other enhancements. I use a slightly modified version of the Announcements v4.0.1 and vw_Search SQL view in conjunction with this change.

Sunday, March 29, 2009

News v4.x Module Recommendation

by Phil 'iwonder' Guerra - (Mission, KS) - I can’t say I’m a big fan of the new version of the DNN News v4.x module. It’s not the effort, as the DNN News project team has done quite a bit of work on this module updating it, adding features that a lot of the DNN community was asking to be included. The trouble for me is more with certain aspects of the implementation of the changes, and the lack of any support for the previous version of the module. One of the major additions to the module was the inclusion of the feature to aggregate many news feed sources into one News module instance. This aggregation feature comes at a price, and the old expression, ‘be careful what you wish for’, rings out again.

The main trouble with the DNN RSSv2.0 custom newsfeed translation is the lack of support for foreign namespaces, and support for all of the tags in the RSS v2.0 specification. The result of the custom newsfeed is a compromise that is made to make the aggregation of news sources with differing news specifications structure possible. The News module was intended to support RSSv0.91, RSSv2.0, Atom, and OMPL news feeds. However, testing and the News Forums are full of reports of the module failing to present Atom, OPML, and some RSS feeds that worked with the previous version News v3.0.1.

Why is there so much trouble with the News v4.x version of the module? Good question, and there are a variety of answers. Perhaps the single point of failure is in the underlying validation and translation methods of the module. Remember, the module must take and translate feeds from a variety of feed types, and translate it into a version of a feed that can be readily consumed. The compromises made required only a minimalist approach in producing a RSS v2.0 compatible news feed. RSS feed types vary widely in their use and availability of XML tags used in their news feeds. Some like the pubDate element do not exist in the Atom or OPML item elements, and others like author, have a strict definition in the RSSv2.0 specification. During the initial read of a news feed source, the module must be able to rely on the RSSv2.0 specification to help transform or reject the incoming elements to produce the resulting custom DNN RSSv2.0 news feed that is ultimately presented. Sadly, even news feed providers do not follow strict adherence to RSSv2.0 specification, as in the cases of the tags, pubDate, and author. If an incoming news feed source cannot be validated it will be rejected the newsfeeds fails to be presented, which generates the most common error, ‘feed failed to download’.

Another issue with the new module is the lack of support for the previous version. If you have a number of news feeds already in use on a site using the News v3.x version, updating to the new version wipes them out and converts them to using the new methods. This type of upgrade effectively creates issues as the new validation methods most often will fail, especially in cases where custom XSL was used to present a feed. The process results in the news feeds used previously not to be rendered. This situation is due to the forced usage of the new methods even for cases where no aggregation of feeds is needed. A better approach would be to allow the module to specify a usage flag to indicate whether the module is being used in a ‘single’ or ‘aggregation’ mode. If the ‘single’ mode was chosen, the simple presentation model of the older module could be used without disrupting existing usage on a site.

While the News project team did try to relax the validation of the pubDate element, it’s not always possible to fix the issue with this type of method. Many other elements have a strict usage specification, and cause news feeds to fail. In practice, there are very few RSS feeds that can be used with the News v4.0.1 module without errors of some type, or missing essential attributes. So, what’s to be done?

Well, my recommendation is to avoid using the News v4.x module entirely, and use the XML/XSL module in its place for presenting single news feeds on a DNN website. Of course, you can remove the module and load the older News v3.0.1 version of the module, too. Both of these alternatives allow use of custom XSL files to present a newsfeed. However, even this approach will not please everyone, as some insist on having the aggregation features. For those circumstances, the alternative module Feed Explorer can be used, but it is harder to implement, and browser issues exist.

The above recommendation may anger some, but the number of issues being posted on the DNN News forums, are an indicator of the lack of success of the module in practical usage. Hopefully, the DNN project team will overcome the issues in the near future, or someone will offer a suitable replacement.

Wednesday, March 25, 2009

News v4.x Alternating color background...

by Phil 'iwonder' Guerra - (Mission, KS) - Sometimes you would like to change the look of your news feed presentation. One such possibility is alternating background color of a news feed item. It's fairly easy to do, but with the new version of the News module v4.x you must remember to fashion your new custom xsl to respect the parameters used in the module setup.

The simplest way to develop a custom xsl for the News v4.x module is to just copy the existing default.xsl which resides in the ~/DesktopModules/News/transformations folder. Use your favorite text editor and make whatever changes you need. Be careful to keep the parameters that are used in the default.xsl that match what is setup in the News v4.x module.

Now, after modifying your custom xsl, save the new file to your portals/n folder and change the module setting to use the new xsl. Always test your new xsl, either using a suitable XML/XSL editor, or in a test instance of your DNN site. Also, I find it works best to place your test News module in a special page of it's own, to avoid causing issues. If your test module fails to display with your new xsl, it could cause your site to 'freeze' or lock up, so you do not want to test a new moduel setup on your 'home' page.

Here's an example xsl that alternates the background of the items in a feed. Try it out and make it your own.

<?xml version="1.0" ?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<!-- alternating background color -->
<!-- for use with DNN News module v4.x -->
<!-- by Phil 'iwonder' Guerra' -->
<!-- 2008-09-21 -->
<xsl:output method="html" indent="yes" />
<xsl:param name="ItemsToShow" /> <xsl:param name="ShowItemDetails" /> <xsl:param name="ShowItemDate" />
<xsl:param name="Locale" />
<xsl:template match="rss">
<xsl:for-each select="channel/item[position()<=$ItemsToShow or $ItemsToShow<1]">
<div>
<xsl:if test="position() mod 2 != 0"> <xsl:attribute name="style">background-color: #F5F5F5</xsl:attribute>
</xsl:if>
<p class="DNN_News_ItemLink"> <a href="{link}" target="_blank">
<xsl:value-of select="title" /> </a>
</p>
<xsl:if test="$ShowItemDate='true'">
<p class="DNN_News_ItemDate">
<xsl:value-of select="pubDate" />
</p>
</xsl:if>
<xsl:if test="$ShowItemDetails='true'">
<p class="DNN_News_ItemDetails">
<xsl:value-of select="description" disable-output-escaping="yes" />
</p>
</xsl:if>
</div>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

Sunday, March 15, 2009

Back In the Saddle…

by Phil ‘iwonder’ Guerra

(Mission, KS)

Been awhile since, I last blogged.  Short explanation, I’ve had pneumonia, and slowly I  am getting back to feeling up to working on extra projects.  So, look for more blogs at regular intervals, hopefully, I can do at least one a week, but will really try to do more.

Sunday, January 4, 2009

Updating the RSSHandler and vw_Search

by Phil 'iwonder' Guerra

--- (Mission, KS) - I've wanted a better DNN internally generated news feed for quite some time. I had so much work in my queue that updating the DNN core code was one project held back. For the most part, I left the project up to the Core Team, afterall it is core code.

Well, I'm not satisified with the progress, and the DNN CT certainly has their priorities, and I'm not going to criticize the lack of attention, but I'm moving forward with taking on the project. It's not a very easy set of tasks to undertake, though. There's a lot involved, due to the coupling of the RSS feed generation to the Search mechanism, but I was surprised at how relatively fast I could deploy an improved news feed with a few minor changes to the RSSHandler, and the vw_Search SQL view. The results yield a much more rich RSSv2.0 feed, giving your public feed branding and support for many of the standard RSSv2.0 tags, not all mind you, but enough to allow you to syndicate with the internal methods, rather than a custom approach.

There's a lot more to be done, as I've only been targeting one module to incorporate the changes, the Announcements module. The enhanced approach requires some tweaking of a module's support of RSS, which is seriously deficient in most modules. I don't understand why most module's even have the ability to syndicate without providing support for it. Oh, well, that's another story.

I'll post more about the effort and provide the code in another post. Right now, it's time to celebrate my son's 21st birthday.

Cheers

Saturday, January 3, 2009

DNN v5.0.0 Internal Syndication - Part 2

by Phil 'iwonder' Guerra

(Denver, CO) - Don't know if folks recognized this issue just yet, because it seems to be new with the DNNv5.0.0 release. In the Announcements module, I noticed that my generated newsfeed had changed somewhat. In previous versions, an syndicated news item had the following format: ModuleTitle - AnnouncementTitle. So, if you had setup an Announcements module to syndicate, what you got when you clicked on the syndicate icon was something like this:

Announcements - My Actual Announcement Title

In fact, I read a recent post on the Announcements forums where someone asked how to change that format, getting rid of the ModuleTitle. He was told by the project lead that it was not possible. Huh? Now, I don't mean to be disrespectful, because as a former DNN Core Team Memeber, I did not advocate changing DNN Core Code, unless there was a good business reason to do so. Changing Core Code means there's impact when the code is eventually upgraded, your mod will need to be redone at the very least, at worst- your mod will not buy you anything because the method you altered might be obsolete.

However, I knew there was a piece of code that could be tweaked to do it, so I set off on getting rid of this annoyance. Before I started work on it, I loaded up an Announcements module, put in some content, and hit the syndicate icon. Lo and behold, what did I see? Well, instead of the ModuleTitle - AnnouncementTitle being rendered as the Title in the news feed, I was getting just the ModuleTitle for every Announcement in the feed. Oh, man what a terrible implementation. I had to do something.

Anyways, I went about making the small tweak in the Announcements module I was set to do, because, it looked like that was something that still needed to be done. I really don't think folks want the ModuleTitle as part of any syndicated content, at least in the items listed. From what I could see this type of concatenated string was being populated into the SearchItem table, and at least I could change that piece.

Long story short, I made the change, and although, I could see that the SearchItem table reflected the change, the resulting news feed was unaffected. Now that set me off on a long search for the culprit. I was about to give up for the night, I simply could not find anything in the code that could cause this new format to be rendered. I decided to take another approach.

I brought up the database, and looked at the stored procedures, thinking maybe a call to one of those procs was responsible. Still no luck. Then, I thought, maybe there's a View causing this issue. Well, it didn't take long to verify my thinking (there aren't many views setup in the DNN database). I found the following View, vw_SearchItems that contained the following:

SELECT
si.SearchItemID,
m.PortalID,
tm.TabID,
m.ModuleID,
m.ModuleTitle As Title,
si.Description,
si.Author,
si.PubDate,
si.SearchKey,
si.Guid,
si.HitCount,
si.ImageFileId,
u.DisplayName AS AuthorName,
FROM

dbo.dnn_SearchItem AS si
LEFT OUTER JOIN

dbo.dnn_Users AS u ON si.Author = u.UserID
INNER JOIN
dbo.dnn_Modules AS m ON si.ModuleId = m.ModuleID
INNER JOIN
dbo.dnn_TabModules AS tm ON m.ModuleID = tm.ModuleID

As you can see, the offending line, in bold and red, was responsible. Instead of using the information directly from the SearchItem table for the item title element, the module name was being substituted. Well, I changed the view to use the si.title data, and the results were immediate. Now, my announcement's news feed was correctly displaying the Announcement Title as the newsfeed item 'title' element. Something like this example:

My Actual Announcement Title

Now, you'll have to make the change in the code and recompile for every module that you want to show up without the ModuleTitle in the 'title' element, and that's a heavy chore. I'm hoping that the DNN CT will listen to an appeal to change this implementation. In case you want to look for the code for the Announcements, look at the code:

Announcements\Components\AnnouncementsController.vb

Search for the Function GetSearchItems, and in that routine is a line:

SearchItem = New SearchItemInfo(ModInfo.ModuleTitle & " - " & .Title, strDescription, .CreatedByUser, .PublishDate, ModInfo.ModuleID, .ItemId.ToString, strContent, "ItemId=" & .ItemId.ToString)

Change it to this line, which gets rid of the concatenation of the ModuleTitle '-' to the .Title:

SearchItem = New SearchItemInfo(.Title, strDescription, .CreatedByUser, .PublishDate, ModInfo.ModuleID, .ItemId.ToString, strContent, "ItemId=" & .ItemId.ToString)

Compile the Announcements solution, and replace the existing Announcements.dll with the newly created one. Then, make your change to the SQL database View as described above.

You can do this change yourself, as well if you want, but it does alter the Core code, so unless the CT decides that this is a better approach, your change will get lost when you upgrade.

Also, from what I can tell, any module that assigns a 'title' that isn't the module name will be changed as well, becuase the View change is a global.

Friday, January 2, 2009

vs2005 Error - The project type is not supported

by Phil 'iwonder' Guerra

(Mesa, AZ) - As if there aren't enough problems to sort out... This morning on my development workstation, which has worked fine until today, vs2005 studio is giving me the following error message - 'The project type is not supported in this installation.' Now, I'm not sure what it is that changed a project over the holidays, while I was away, but last week, I had no trouble loading this project.

Oh, well, happy new year. More on the issue, when I've found a fix. Until then, keep your workstation unplugged when not is use, avoid those pesky Microsoft Updates.

Thursday, January 1, 2009

DNN v5.0.0 Internal Syndication

by Phil 'iwonder' Guerra

--- (Phoenix, AZ) - With the New Year underway, I thought I'd start out right by installing and testing the new version of DNN v5.0.0. Installation went without a hitch, so no worries there. However, I'm just putting in some test content using the Announcements module to see what the DNN internal RSS news syndication is doing. Having been away from looking into that side of syndication with DNN, I was curious to see if anything new is available to us. Sadly, I can report that DNN internal RSS syndication is below par and is a real disappointment from an otherwise improved look and feel release.

Does anyone really think that a DNN news feed is worth anything? It's the barest form of RSS, and the implementation of what gets syndicated is really confusing. For example, the Announcements module has taken some strides in allowing a bit more flexibility, giving the user the ability to specify how much of the text content is used in the syndicated description. Trouble is - you can change this field, but it only affects items added after the change. Probably a caching issue somewhere, and not the Announcements module's fault, as there is no real indication that there is anything that limiting in the tables for it.

The other frustrating issue is how the syndicated content is built. With the Announcements module, the DNN created feed uses the module's Name for every entry as the title element. instead of the title of the actual announcement title, which is what I would expect. With this type of usage a DNN internal syndicated feed offers very little in the way of driving traffic to your site with it's lack of syndication features. Small wonder, then, that many DNN projects have gone to creating their own syndication routines. That's at least something, but it's not the best of world's. What is really needed is a standard syndication API that is followed by all DNN project module developers. Without this kind of API, DNN default projects and DNN syndication will always remain a mystery to users.

As I've blogged previously, there is a serious need to overhaul all of the default DNN standard modules to include better support of syndication. Every module capable of implementing syndication ought to have the basics information available to syndicate, title, pubDate, author, and description are really needed for a bare bones syndicated content. There are many many other useful options available, it's a real shame to see DNN so far behind in news syndication.

So far, I give it a failing grade, and hope that someone is working on improving it.

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.

Saturday, November 8, 2008

Why No Standard DNN Module RSS Generator?

by Phil 'iwonder' Guerra

(Mission, KS) - Ok, I'm bringing up a old can of worms, I admit straight away, but it's a topic that really gives me a royal pain in the a**. Of all the support questions I get about DNN and news feeds the one that seems to always at the top of the list: 'Why does the newsfeed module fail to render my site's syndicated content?' Well, the answer depends on which module you are using and how the syndicated content is generated.

A long time ago, in a far-away galaxy, I was a member of the DNN Core Team, and ever so briefly was the News Feeds (RSS) project's Team Leader. In that capacity, one of the first assignments I tackled was to begin the process of improving the internal RSS syndication methods. Now, the difficulty here was that the syndication process is tied to the internal search mechanism, which we all know by now, is constantly changing, and seems to never work the way you would suppose it to work. That being said, I could only address the internal process in a very controlled and limited way. I could improve certain aspects, but adding needed features, including the use of custom namespaces was vetoed. The wisdom of the sages was at a point in DNN evolution that wanted to delay these efforts as not to 'break' anything that would negatively impact the spread of DNN to bigger and larger stakeholders. It was probably a wise choice not to let some newbie upstart impact such a central area of DNN.

Now, the ages pass, and DNN is firmly established as a well known and well received entity among the large and respected houses of the Internet applications world. Maybe, it's time to wonder about why there is no standard RSS syndication generation API that is required by all DNN projects. Some projects have gone their own way with generating syndicated content for their projects, while others just use the in-bred methods. Which is best? In a word, neither!

The losers in all of this patchwork of syndication generation is the DNN community at large, who probably don't even realize that the ability to transform and present syndicated content varies with which module and version is being used. Of course, this most often shows up when the poor RSS Newsfeeds (RSS) module is being used by folks expecting things to work correctly out of the box. Sorry Virginia, but the DNN Santa Claus is not well and won't be addressing your needs in this version! There simply is no guarantee that the default news module will present your DNN site's syndicated content. In fact, even so-called improved custom RSS generators contained in some project modules do not even adhere to the syndicated format specs they supposedly follow.

Just like other non-DNN syndicated content, the appearance of a a specs version in the feed does not always guarantee that the spec used is faithfully followed. Elements like dates, author, and others my not follow the spec used and it's up to the consumer or their application to make provision for any errors in syndication. Pretty terrible situation. Imagine if you had the same lack of conformity with the automobile manufactures.

I come from the old school that requires no negative opposition to existing methods and procedures without presenting plausible alternate solutions. So, here's my plausible alternative.
DNN should commit to syndication method that holds developers to using it. In the simpliest transition possible, there could be at minimum, an indentification tag added to their custom methods that indicate which rss generator is being used. In RSS specs there exists an optional channel element tag 'generator', which can effectively identify at bare minimum something like this:

<generator>DNN v4.0.9 Internal RSS Syndication Generator v1.0.x<\generator>
or
<generator>DNN Blog v4.0.x Custom RSS Syndication Generator v2.0.x<\generator>

Inclusion of this information would at least help those who provide 'FREE' support for the benefit of the DNN community a way to quickly troubleshoot the issues being reported daily. Some of us do support and help the DNN community because we believe in the open source project. Can't the DNN Core Team and DNN Corporate members take this small step? We will see.

I'm not even going to go into what improvements in the internal syndication methods are needed, but would love to provide my views sometime when someone is actually going to listen.

Wednesday, November 5, 2008

Forward to the Past

by Phil 'iwonder' Guerra

(Mission, KS) - Well, just a quick note to let folks know that my old fix to the News module actually does work. I can display Atom feeds with my modified News module. Unfortunately, my mod works with the v4.0.0 module, but not the new v4.0.1 version. I'm still trying to understand why. More later, as I step through the code.

Tuesday, November 4, 2008

News v4.0.1 Not Rendering Atom Feeds...

by Phil 'iwonder' Guerra

(Mission, KS) - Had some time to play around with the new release of the News Module. Unfortunately, this release will not render Atom feeds, at least the many that I tried. I'm getting the all-too-familiar 'failed to download' error.

Just wanted to post about it here, and I'll have to look into the code more. Even the 'fix' I had made prior to this release does not help, so I'm lost at this point as to what the duece is going on.

Ah, well, I'll get to it, in the morning...