Tony Testa posted on September 21, 2007 00:00

In going with my posting about trying to start back up my personal MySCORM open source project, it jogged my memory about a blog posting I read awhile back.

(Also i realized i've been posting links to a lot of OTHER peoples writings, postings, etc.  I going to try to really make an effort to start posting some of my own demos/examples based on some of the tools/tips/projects i've been blogging about)

Over at Coding Horror, Jeff Atwood was giving $5000 and MS was matching his $5000 to an open source .NET project in an effort to help promote the open source community as well as .NET (which doesn't have a strong presence in the open source community).  The posting itself and the money isn't really whats I find interesting, it is the comments to the posting by readers that I think contains a BUNCH of great open source projects.  I encourage you to take a look through the comments and seeing if any of these projects might help you out, no sense in reinventing the wheel.

Here are a few I feel are worth looking into:

ITextSharp - its a PDF generator

SubSonic - a GREAT DAL/OR Mapper

ZedGraph - a 2d graphing library

Umbraco - CMS that runs on MS SQL

Cuyahoga - Another CMS built on .NET 2.0

#ziplib - a zipping library (i've used this before and it worked great, really came in handy and was easy to use)


Posted in:   Tags:
Tony Testa posted on September 19, 2007 00:00

With my sudden burst of motivation lately I decided I should try to revive my little pet project i've dubbed MySCORM.  Here is a bit of info about it.

What is SCORM?
The Sharable Content Object Reference Model defines a specific way of constructing Learning Management Systems and training content so that they work well with other SCORM conformant systems

Now that description is great and all, but it really doesn't explain what SCORM is to people who don't know about it.  SCORM is a standard for eLearning content that was developed to help aid in consistency across Learning Management Systems.  An example of this eLearning content would be Microsoft eLearning courses.  A user signs up to take the course.  The user then takes the course at their own pace.  During the course, data is collected about the users experience while taking the course, such as where they left off, answers to questions, etc.  The SCORM standard is used so that developers can create systems to play/record this content in their custom learning management systems.  Essentially an eLearning content creator can create their learning module and adhere to the SCORM standard and feel confident that their eLearning will work in any Learning Management System that is SCORM compliant.

Why would I pick this to work on?  At a previous employeer I was tasked with making our custom learning management system SCORM compliant.  To this day i'm not 100% happy with my implementation of it, so since then I've been wanting to prove to myself that I can make a quality SCORM compliant system.  I originally coded it in ASP/VBScript (I had no say in that matter) but wanted to code it in .NET because it offers a MUCH better platform for creating a SCORM compliant module, plus I use .NET everyday.  Another big reason for this project is because there really isn't a decent open-source SCORM compliant system made in .NET out there today, most are Java or PHP.

Goals for the project

My ultimate goal for this project is to create a SCORM 1.2/2004 compliant module that can be easily added into existing systems with little to no modifications needed.  This is a lofty goal but I think that its not completely out of reach.  I'll try to update this post later when I organize my thoughts/goals for the project.

Also, I created a project for it up on codeplex that i'll be updating, check it out here


Posted in:   Tags:
Tony Testa posted on September 19, 2007 00:00
I stumbled onto this today while doing my daily rounds of the .NET sites.  Microsoft has a new product that just released a CTP called "Astoria". 

Here is a description from the "Astoria" website :
"Astoria is a project in the Data Programmability team at Microsoft that explores how to provide infrastructure and tools for exposing and consuming data in the web. Astoria can create data services that are exposed in a natural way to the web, over HTTP and using URIs to refer to pieces of data; these data services can be consumed by AJAX front-ends, Silverlight-enabled web pages, desktop applications and more. At this time we’re making available two experimental elements of project Astoria: the Microsoft Codename Astoria toolkit and the Microsoft Codename Astoria online service."

From what I can gather this technology will really fit well with SOA by exposing the data as a service.  In addition it seems like this will help make consuming data through AJAX easier.  You could essentially create the data service for your customer data for example and have it available to all your WebApps and desktop apps in your organization.  This way with all your apps your not essentially creating a data access layer for each app, instead you would just consume this data service.

Check out the Project Astoria Team blog here
Also check out a sandbox they've created to showcase the technology as well as let you create your own data services to play  with.  The encarta sample is kind of cool and gives a good example of how your could use this technology.

When i finally get around to it and create a .NET 3.0/3.5 sandbox for myself, i'll certainly give this a try.

Posted in:   Tags: , ,
Tony Testa posted on September 19, 2007 00:00
What is an HttpHandler?
It is the earliest point where you have access to a request that is made to IIS.  In a typical application, a user calls .aspx pages, which maps to an HttpHandler, that handler is the PageHandlerFactory.  An HttpHandler is just like an aspx page except it doesn't have all of the UI elements therefore it doesn't have to process them.  HttpHandlers are therefore more reusable.  

Why would you want to use an HttpHandler?
Some great examples of why you would want to use an HttpHandler is in the case when you want to return an image from the database.  You could create an HttpHandler to call the database and return the Image.  Typically I used to create a page for this and override the response type to return the image.  With an HttpHandler, you can skip all the extra page processing and just return the image.
Another great example is when you want to download a file, such as a an excel file.  You could pass in a datatable, convert it, and then return it as an excel file.  Again, I used to create a page for this and override the response content types to do this, but an HttpHandler is a far better solution to the problem.

Real-World Examples
A real world example is on the blog engine I am using to write this post, SubText.  It uses a custom HttpHandler to map URL's to controls.
Another GREAT example is the Microsoft AJAX framework.  If you look at the base web.config file they give you.  See below for an extract of the <httpHandlers> section :

   34         <httpHandlers>
   35             <remove verb="*" path="*.asmx"/>
   36             <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
   37             <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
   38             <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
   39         </httpHandlers>

As you can see, a few custom file extensions are mapped to HttpHandlers.  This is how the Microsoft AJAX framework does most of the heavy lifting for you.  The HttpHandlers that are included handle inserting the necessary scripts into the page to perform the AJAX requests.

Demo
I made up a demo solution to show the basics of creating a HttpHandler.  Whats in the demo is 3 examples.  The first example is just a basic HttpHandler.  What it does when called is just return some basic text to the browser.  The second example shows creating a simple datatable and exporting it as tab delimited excel file.  The third example shows a more useful example where we call a database and export the results as a tab delimited excel file.

The real key to the HttpHandlers, besides implementing the interface, is adding the directives in the web.config file.

    1 <?xml version="1.0"?>
    2 <configuration>
    3     <appSettings />
    4     <connectionStrings/>
    5     <system.web>
    6         <compilation debug="true" />
    7         <authentication mode="Windows" />
    8 
    9         <!-- add this under the <system.web> -->
   10         <httpHandlers>
   11             <!-- you could specify a wildcard with a extension, or a specific name of a "page" to call -->
   12             <!-- you can also create an extension of your choosing, and tell IIS to process your extension as a handler -->
   13             <!-- <add verb="*" path="*.ashx" type="BasicHelloWorldHandler"/> -->
   14             <add verb="*" path="BasicExport.ashx" type="ExportToExcelHandler"/>
   15             <add verb="*" path="ExportDB.ashx" type="ExportToExcelDBHandler"/>
   16         </httpHandlers>
   17     </system.web>
   18 </configuration>

The above web.config file has commented out code which shows that we can map any file with the extension .ashx .  The other two <add> elements in the <httpHandlers> section shows how we can map a specific filename to the HttpHandlers we wrote.  As you can see, you pass in to parts, the "Path" which is the filename to map, and the "Type" which is the class to map the call to the filename to.

Download Files
You can download the demo solution here.
Its a website project, so create a directory for it, and extract the files there.  Then create a virtual directory for it in IIS or just run it in VisualStudio2005.

Posted in:   Tags: ,
Tony Testa posted on September 18, 2007 00:00

Nothing really "new" here, but i've included some links about the ASP.NET Application/Page LifeCycle.  I know every so often I have to refer to these...so if anything they will just serve as a personal reference point.

ASP.NET FULL (Application,Page,Control) LifeCycle (.NET 2.0)

ASP.NET Application LifeCycle (.NET 3.0)

ASP.NET Application LifeCycle (.NET 2.0)

ASP.NET Page LifeCycle (.NET 3.0)

ASP.NET Page LifeCycle (.NET 2.0)

ASP.NET Page LifeCycle Poster (.NET 2.0)

ASP.NET Page LifeCycle (.NET 1.1)

ASP.NET Control LifeCycle (.NET 1.1)

ASP.NET WebPart LifeCycle (.NET 3.0)

ASP.NET WebPart LifeCycle (.NET 2.0)

ASP.NET AJAX Client LifeCycle (.NET 2.0)


Posted in:   Tags:
Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2017 Tony Testa's World