Download the UriTree stable release at CodePlex.com.
UriTree is the name of an idea documented in 2006, “The Resource Location Manager: A Tiny C# Application That Solves the “Favorites Problem.” Now that this ‘tiny’ application has a name, UriTree, it has matured and stabilized into a more concise expression. This document highlights the following changes:
Songhay.Xml.Manager class featured in January is replaced by the Songhay.Xml.XmlUtility static class, taking advantage of new features in .NET 2.0—and the Songhay.Xml.XObjectUtility static class, taking advantage of new features in .NET 3.5, namely LINQ to XML.Songhay.Wpf.Mvvm namespace is defined and holds Songhay.Wpf.Mvvm.View.AboutView a centralized, XAML-based About… dialog box that can be used with any WPF application.Browse this code base for release 2.x at CodePlex.com.
WPF offers the MenuItem control. When this element is used with the Hardcodet.Wpf.TaskbarNotification libraries from Philipp Sumi, we obtain all of the visual effects and experiences that we expect from professional Windows applications:
By the way, just to illustrate (yet again) why XML is so cool, note that the UriTree links you see in the screenshot are pulled from the same remote location that the AJaX-based kinté links page uses on kintespace.com.
The XML format that UriTree uses is a subset of OPML 2.0; you can download and examine the source XML to see whether it is “valid”—and to see what portion of OPML 2.0 is being used. The schema referenced in this XML set, that provides IntelliSense in Visual Studio 2005 among other benefits, is also available for download.
It is worth mentioning that an InfoPath 2007 form was designed based on our schema—and it is used to edit OPML data. Significant performance problems were found when the XML set when upwards of a one hundred elements. Of course it works quite well when the XML is small. Designers experienced with InfoPath should know that sharing OPML data generated by InfoPath can cause problems since most of the OPML “validators” in the wild are not prepared to parse the namespace prefixes that must be present.
XSD mavens may wonder why our schema does not declare anyURI for the OPML url attribute. This is because UriTree is a Windows Desktop application and needs to handle more than Web protocols. To assist in this design goal the app.config file for UriTree allows you to specify a local and remote XML set—this asserts a convention where a local XML set can contain desktop specific links and a remote set can contain “public” Web links. In the applicationSettings block for UriTree.exe.config, we have the settings ResourcesLocal and ResourcesRemote respectively. This convention makes UriTree eliminate the conceptual differences between local and remote links, the proprietary Windows desktop and the Word Wide Web. The following table highlights the kind of local resources you can put in UriTree:
| Local Resource | Remarks |
<outline text="Development Server" type="link" url="http://%ComputerName%/"/>
|
This is the link to my local Web server. UriTree takes advantage of the Environment.ExpandEnvironmentVariables() member during Resource parsing. |
<outline text="Device Manager" type="link" url="%SystemRoot%\System32\DEVMGMT.MSC"/>
|
This item links to the Windows XP Device Manager. |
<outline text="Edit HOSTS File" type="link" url="%ProgramFiles%\Notepad++\notepad++.exe %SystemRoot%\System32\DRIVERS\ETC\HOSTS"/>
|
This is a link to the Windows XP HOSTS file. |
<outline text="Event Viewer" type="link" url="%SystemRoot%\System32\eventvwr.msc /s"/>
|
This is a link to the Windows XP Event Viewer. |
<outline text=".NET 2.0 SDK Folder" type="link" url="%ProgramFiles%\Microsoft Visual Studio 8\SDK\v2.0\Bin" />
|
This is a link to the .NET 2.0 SDK Folder. |
<outline text=".NET Global Assembly Cache" type="link" url="%SYSTEMROOT%\assembly" />
|
A quick link to the .NET Global Assembly Cache. |
The image at right summarizes the static class Songhay.Xml.XmlUtility. UriTree depends heavily on this “helper” class. This definition instances the workhorse of all XML-related activities for Songhay System enterprise data solutions. The design goals include:
XmlDocument and XPathDocument. This reduces lines of code—especially when writing overloads that erroneously distinguish these types. In the Songhay.Xml.XmlUtility definition, you will see members with IXPathNavigable XSet among the arguments.GetInstance<T>(String XmlPath) and GetInstanceRaw<T>(String XmlString) members are generic de-serialization methods that are designed to handle all of the de-serialization tasks required by Songhay System solutions. Their featured use case is when an XML configuration file needs to be loaded from disk and instanced into a .NET type.XPathDocument “factory” code. Songhay System makes the XPathDocument the premiere, .NET 2.0 XML data type. It follows that the XPathNavigator is the premiere XML data set. We can find no near-fatal flaws with this Microsoft innovation! The GetXpDoc(), GetXpNode() and GetXpNodes() members of Songhay.Xml.XmlUtility express this sentiment. This ‘sentiment’ might be considered ridiculous for the seasoned, .NET 1.x, XML maven. This is because such experienced folk may have overlooked the sentence, “The XPathNavigator class has been updated to include editing capabilities…” in the MSDN documentation.GetXslResult(), GetXslString(), LoadXslTransform() and WriteXslTransform().GetNamespaceManager() members handle certain XPath node ‘resolution issues’ that are beyond the scope of this document.Our UriTree takes advantage of the ‘XPathDocument factory code’ and the associated namespace routines in Songhay.Xml.XmlUtility. This is a brief introduction of the Songhay.Xml.XmlUtility. Going forward, certainly this topic will come up again as this “helper” class is fundamental to the Songhay System.
| UriTree Source Code | The Visual Studio 2005 Project files. |
| kinté links | The current UriTree XML set. |
| Songhay OPML 2.0 Schema | The current schema behind the UriTree XML set. |
| OPML 2.0 (DRAFT) | It is clear to me why Dave’s specification is not widely available as an XSD: many of his definitions go beyond the features available in XSD and would require the XPath assertions that emerge from Schematron or a similar enforcer like InfoPath. |
| “W3C XML Schema Design Patterns: Dealing With Change” | Dare Obasanjo of Microsoft introduces the concept of ‘schema wildcards’ among others. |
| “How to modify an external schema for an InfoPath form” | Schema wildcards are used to allow InfoPath to leverage the wonderful my: namespace. I thought this feature could be used with OPML 2.0 but I found out that you can’t mix attribute with anyAttribute without unexpected results in InfoPath. |
| Songhay OPML InfoPath Form | A brave attempt. |
| “What’s New in System.Xml” | MSDN details what’s new for XML-related features in the .NET Framework Developer’s Guide. |