Archive for November 9th, 2009
Why the Adobe/RIM announcement is important
jParse: jQuery XML Parse Plugin
jParse is a jQuery plugin that allows you to quickly and easily parse XML file that has been fetched with an Ajax request. jParse gives you options for custom output, limit, count of items and the ability to run functions before and after jParse is finished. It is lightweight and cross browser code that has been tested with Firefox 2+, IE 6+, Safari 3+ and Opera 9+.

Since jQuery ajax method does not allow for cross domain AJAX requests; the XML that you would like to parse using jParse must be on the same domain from which you are working. Using jParse is fairly simple and you can easily use it to pull value of an XML node, the value of an attribute of an XML node, or the number of <items> in an XML document.
Developed by Kyle Rush; jParse jQuery Plugin is available for download under MIT License. You can find further information, demos & download on jParse Website.
Similar Posts:
- Let DOM Object Follow Your Page With Scroll Follow
- jQuery PageSlide Plugin
- jQuery Color Picker Plugin
- Dynamic Behavior Based on Page Scrolling With ScrollSpy
- PageEar – Free Page Peel Script
You can also stay updated by following us on Twitter, becoming a fan on Facebook or by subscribing to our FriendFeed.
Announcing the new Microsoft SDK for Facebook Platform
Today, as part of our ongoing collaboration with Facebook, we released a very exciting new developer resource: the Microsoft SDK for Facebook Platform (http://www.microsoft.com/facebooksdk). This SDK combines the power of Web, client and social technologies to enable millions of developers to transform their imagination into next generation application experiences. We look forward to seeing the creative applications that developers will create for Facebook that will open up new avenues for users to share and connect with their friends.
WPF NewsFeed sample control
Since 2007, Microsoft has been working to provide developers with the option to quickly and efficiently build Facebook applications across the breadth of our portfolio, ranging from Visual Studio to Zune, Xbox Live, Windows Messenger and Live Search.
Additionally, in April 2009, we participated in the Facebook Technology Tasting event where we demoed two applications that showcased the ease of viewing photos with an application built in Silverlight and .NET (highlighted in an article by Jason Kincaid/TechCrunch: http://www.techcrunch.com/2009/05/01/microsoft-shows-off-the-power-of-facebooks-new-apis/).
This latest release of the Facebook SDK (Toolkit) combines the latest in Web and Client platform innovations with leading Social technologies (services) together to enable millions of developers and designers to transform their imagination into the next generation application experiences.
Intellisense for the Facebook API
No matter what your application flavor is, the Microsoft SDK for Facebook Platform supports the development of applications across Silverlight, WPF, ASP.NET, ASP.NET MVC, and Windows Forms, enabling easy consumption of Facebook services delivered through the Facebook Open Stream API (http://wiki.developers.facebook.com/index.php/Using_the_Open_Stream_API).
Sound daunting? It’s not – the SDK contains a wide range of samples, controls, templates and help documentation which means using the tools is a cinch. Let your imagination fly! With more than 300 million users and more than 1 million developers on Facebook, and 6M Microsoft software developers there is a whole new world waiting for you.
Get started today at www.microsoft.com/facebooksdk.
StructureMap and SharePoint
I’ve started doing some SharePoint development and have brought some of my favorite tools and practices with me. Like unit tests. And IoC. And that other SOLID stuff.
I’m writing a very basic WebPart to get started with SharePoint – this web part will display a list of links to other applications that the user is authorized to use. The source of this data (names, URLs, etc.) comes from an external-to-SharePoint system, accessed through another C# assembly. Once the web part gets the data there is some more processing to be done – we need to do more than just blindly display a list of URLs. Rather than get into details I’m just going to do some handwaving here and say that “if you have access to X, then {stuff happens}, or if you have access to Y then {other stuff happens}.” You know, business logic, stuff that is good to test.
the first thing I need to do is get business logic out of the WebPart and into something that I can write without having to reset AppPools over and over, not to mention have some unit tests to verify I’m going in the right direction. So, I created a standard application service class which has a dependency on the external authorization system, via constructor injection.
public class AuthorizedAppsService : IAuthorizedAppsService { private readonly ExternalAuthorizeService authService; public AuthorizedAppsService( ExternalAuthorizeService authService) { this.authService = authService; } public AuthorizedApplications GetAuthorizedApplications( string userName) { var allApps = authService.AuthorizedApplications(userName); // business logic stuff happens here return thoseResultsWeJustFiguredOut; } }
Next, I created a StructureMap Registry class to scan my assemblies, as well as adding in the details of how to create this external authorize service, using the typical method:
public class MyRegistry : Registry { public MyRegistry() { Scan(scanner => { scanner.TheCallingAssembly(); scanner.AssemblyContainingType(typeof(MyRegistry)); scanner.WithDefaultConventions(); }); ForRequestedType<ExternalAuthorizeService>() .AsSingletons() .TheDefault.Is.ConstructedBy(c => Provider.GetService()); // other dependency configuration... } public static void InitializeForSharepoint() { ObjectFactory.Initialize(init => init.AddRegistry<MyRegistry>()); ObjectFactory.AssertConfigurationIsValid(); } }
And then, what remains is to have SharePoint call my StructureMap initialization when my SharePoint application starts up. In an MVC or WebForms app, I’d just add code to the appropriate place in Global.asax.cs, but in SharePointLand, this is looked down on. Instead, the preferred mechanism seems to be to use an HttpModule and a FeatureReceiver to plug the Module into the app’s web.config.
public class MyStartupModule : IHttpModule { public void Init(HttpApplication context) { ConfigureOtherStuff(); MyRegistry.InitializeForSharepoint(); } public void Dispose() { } }
And then the FeatureReceiver to alter the app’s Web.Config looks something like this (note I borrowed most of this code from another sample SharePoint project:
// // this is borrowing heavily from http://www.codeplex.com/SPAXO // public class StartupFeatureReceiver : SPFeatureReceiver { public override void FeatureActivated( SPFeatureReceiverProperties properties) { var webApp = properties.Feature.Parent as SPWebApplication; AddWebConfigEntry(webApp); UpdateApp(webApp); } public override void FeatureDeactivating( SPFeatureReceiverProperties properties) { var webApp = properties.Feature.Parent as SPWebApplication; RemoveWebConfigEntry(webApp); UpdateApp(webApp); } private static void AddWebConfigEntry(SPWebApplication webApp) { SPWebConfigModification mod = GetModification(); var existingModifications = new List<SPWebConfigModification>( webApp.WebConfigModifications); if (existingModifications.FindIndex( value => value.Name == mod.Name && value.Value == mod.Value && value.Owner == mod.Owner) == -1) { // If the modifcation does not already exist // add the entry to the config webApp.WebConfigModifications.Add(mod); } } private static void RemoveWebConfigEntry( SPWebApplication webApp) { SPWebConfigModification mod = GetModification(); webApp.WebConfigModifications.Remove(mod); } private static SPWebConfigModification GetModification() { string asmName = typeof(StartupModule).AssemblyQualifiedName; string typeName = typeof(StartupModule).FullName; return new SPWebConfigModification { Path = "configuration/system.web/httpModules", Name = String.Format(CultureInfo.InvariantCulture, "add[@name='{0}'][@type='{1}']", typeName, asmName), Sequence = 0, Owner = asmName, Type = SPWebConfigModification. SPWebConfigModificationType.EnsureChildNode, Value = String.Format(CultureInfo.InvariantCulture, "<add name='{0}' type='{1}' />", typeName, asmName) }; } private static void UpdateApp(SPWebApplication webApp) { // Update the Web App and apply the changes // to all servers in the farm webApp.Update(); webApp.Farm.Services .GetValue<SPWebService>() .ApplyWebConfigModifications(); } }
Happy 5th birthday, Firefox!
Five years ago today, Firefox 1.0 was released. Thank you (and Safari, Opera, and other modern browsers) for changing the Web.
Join the celebration at Five Years Of Firefox.
Posted in Browsers.