Friday, October 07, 2005

Today I encountered this issue in one of the projects. Simply put, we have an ASPX page like www.venkatarangan.com/file/getit.aspx?id=4040 that is going to read a file say "Office2003.DOC" from filesystem and stream it. The actual file will depend on the ID that is passed. It will come from a folder that is not accessible through IIS or will come from a SQL Server BLOB column. In either case an user will see in IE's dialog box the filename to be get it.aspx?id=4040 and not as "Office2003.DOC".

We can modify the mimetype of the output of an ASPX page to say image/jpeg or anything by using the Response.ContentType property. It will be easy if we can specify the filename as well, but no property exists to do this in Response object. One way to solve it will be to create a virtual URL like /4040/office2003.doc. This URL doesn't exist, it will be mapped to be handled by a HTTPModule and the HTTPModule does the streaming by parsing the URL and getting the ID number. Since in this case the filepath from IE's perspective is Office2003.doc, IE will no problem in identifying the mimetype and launching MS Word with the file loaded.

HTTPModule seemed to be a round-about solution. That's when my good friend Deepak Gulati of Microsoft came to rescue with this ASP code snippet (Thanks Deepak, I know I can count on you for these quick solutions. If you get a chance visit his photo blog)
<%
  'If correct mime type is known use that    
    Response.ContentType = "application/x-unknown" 'Arbitrary
   
    fn = "blog.doc"                                'Actual FileName
    FPath = "c:\temp\" & fn
    Response.AddHeader "Content-Disposition","attachment; filename=" & fn

    Set adoStream = CreateObject("ADODB.Stream")
    adoStream.Open()
    adoStream.Type = 1
    adoStream.LoadFromFile(FPath)
    Response.BinaryWrite adoStream.Read()
    adoStream.Close
    Set adoStream = Nothing
    Response.End
%>

The above solution works by adding a "Content-Disposition" header as specified in RFC2183. This RFC seems to provide couple of useful customization possibilities, check it out. The code also shows a simple way to read a file and stream it using ASP/ADO.

References:
1) How To Raise a "File Download" Dialog Box for a Known MIME Type - Microsoft Support KB
2) Explanation of Content-Disposition - MSDN Reference

While I was searching this, I came across this support article that uses a single API call to "URLDownloadToFile" for downloading and saving a file. The code works in VB6.0 thru' .NET.

 
Thursday, October 06, 2005

Chennai Marine Aquarium
For reasons unknown after I took these photos I was told to stop!

Though India has tons of places of potential tourist interest, and Indians travelling abroad spending the most per day, there are few tourist places in India that are of International standard. Chennai is no different in this regard - inspite of having the world's second longest beach, there was no Aquarium to educate and promote interest in marine life. This void is now being addressed with the opening of the new Marine Aquarium.

I took my son (2 Years old) last week to the aquarium. He loves to see fishes ('ish' as he calls it) and we had a good time. Comparing to aquariums I have seen in Singapore, Lankawi (Malaysia), California and other international ones', this one is quite small. But nevertheless it had about 20+ tanks with double that number of fish varieties.

The aquarium is within the Zoological Survey of India premises in Santome High Road. Roughly about 1 - 1.5 Kms from Santome Church going towards Adayar and before the right-turn to Foreshore estate, and is on your right-hand side. It is roughly the same distance from Iyappan Temple if you are coming from Adayar towards Marina. Unfortunately there is no publicity or any prominent signs promoting the existence of the Aquarium. The aquarium management seems to have got the timings completely wrong, it is open only during Weekdays from 10AM to 5PM. This timing leaves out the the target audiences (Students and Kids) from visiting it. Presently there is no entry fee!

So if you are in Chennai, it is a good place to spend 30 minutes. And do this now, when it is new - before it gets spoiled just any other public place in India due to poor maintenance.

 
Wednesday, October 05, 2005

If you are looking at using Windows Sharepoint Services (a.k.a. WSS that ships with Windows Server 2003), check out these 30 ready to use templates from Microsoft. They range from Expense Reimbursements to Marketing campaigns.

There is also the Sharepoint team site at Gotdotnet, this has tons of information on Sharepoint, FAQs and more.

If you are administrator then the official Adminstrative Site for Sharepoint has valuable info on Capacity Planning, Upgrade Options, Deployment scenarios and the likes.

 
Saturday, October 01, 2005
mac300.jpg
Apple mac mini
Samsung 910MP 19" LCD

Last month while in United States, I ordered for a mac mini from the Internet. I ordered for the base config with 512MB RAM, 40GB plus Bluetooth module, Wireless Keyboard and Mouse - all put together came to abut US$700. First came the wireless keyboard and mouse package in 3 business days and a day later the machine itself arrived. That was pretty impressive delivery. I took it out and plugged to a monitor it simply worked. Wow!. 

For long I wished to own a mac, to play with it and see how different or similar it is to Windows. In case of mac mini I simply wanted to own this lovely little box after seeing the image on Apple's site. I was impressed with its extremely small size and the engineering marvel of apple. It is amazing how Apple Engineers can put inside this small box - couple of chips, a hard disk, a dvd rom drive and still manage with heat that is being generated inside. Even in my HP Laptop, after few minutes of usage I could use the bottom to boil water.

The first thing I did was to download Windows Media Player for mac so that I can listen to my WMA songs, following that I downloaded Remote Desktop Connection (RDC) for mac. With RDC I could connect to my Windows Laptop and still do my emails.

The things I loved after few hours were Mac 10.x (Tiger)'s beautiful aqua user interface and animations. Followed by that was the crisp interface especially the text clarity (to some extend thanks to my 8ms Samsung 19" LCD). I simply couldn't help myself admiring the sharpness of Tamil Texts in Unicode pages using Safari browser. The audio was brilliant. Safari's RSS reading was equally good. The machine came with Office 2004 for mac 30 days trial pack installed. Word sports an interesting UI in this release for mac, cool. The best feature for me was the bundling of Murasu Anjal for Tamil Fonts and Tamil Keyboard. Because of Murasu bundled in, I could go to any latest Mac apps and start typing in Tamil. Unfortunately Office X for mac and Appleworks 6.0 don't support this new Input/Display methods. PowerPoint 2004 & Textedit supported this flawlessly. The experience of connecting my digital camera and importing photos was simply painless. Good work Apple.

Things I didn't like: I was not that impressed with the Safari browser page rendering speed. Even after trying for an hour or so, I couldn't enter this blog from my apple. I tried first with Safari, then with Camino, then with Internet Explorer for mac. The issue was none of them had my Dasblog entry screen which uses FreeTextbox to appear correctly. So I am doing this post from my trusted Windows XP.

In Remote Desktop I figured how to do Right Click - later configured to use the Alt key with mouse click as Right-Click. I am still unable to select multiple songs or create a playlist in Windows Media Player for mac.

 
Saturday, September 24, 2005

After spending last week in LA for Microsoft PDC, this whole week I was in Redmond (Microsoft is Headquartered here). I didn't have any meetings today as all Microsoft Managers were out to MS Company Meet today - Microsoft is 30 now.

My Cousin "Vijay" who lives here, suggested I drive down to Deception Pass. Deception Pass is a beautiful scenic place and a Washington State Park, which is about 80 miles from where I stayed (Bellevue, WA). In the past I have driven in the US only twice - first time with in Bellevue area itself and the second was last week for few miles on the way from LA to Sequoia. Though I have been driving in India for more than a decade, driving in the US is different especially the road rules. In the past whenever I came to US it has always been for short stays and I have avoided driving here.

Yesterday I called up Enterprise Rental, got myself picked up and rented out a Dodge Neon Car. I went with the full insurance package which covered risk upto a million dollars (enough even for US terms). Today morning started around 10:30AM and reached Deception Pass Bridge view point around 12:30PM (520 West, 405 North, I 5 North and finally on SR-20 West). Though I feared, driving was not difficult here; Equipped with a Direction Map from MSN site, I took the correct Exits and turns. I had gone with my colleagues, we spent next few hours at various scenic spots around Deception Pass Bridge and inside the State Park. On our way back to Bellevue, we stopped at Prime Outlet before joining I 5 South. Overall it was a day worth spent, enjoyed it most.

Deception Pass - Venkatarangan TNC and Colleagues
 
Friday, September 16, 2005
Web Content Management is now part of Microsoft Sharepoint Server (Office 12 System). MCMS is dead. Ryan Stocker from Microsoft in WCM session highlighted the new features of upcoming WCM product.
  • Today there are two portal stories from Microsoft - Sharepoint is for Intranet and MCMS was for Internet. With Office 12, it will be an integrated story. You can create Internet Facing Sites and Intranet (as always) using Sharepoint technologies. Remove forced choice "CMS02" vs Sharepoint Portal Server. Roadmap towards an integrated Enterprise Content Management (ECM) story.
  • To achieve the last point all WCM services found in MCMS02 have been developed into the new Sharepoint server. This meant adding Internet readiness to Office "12" Servers.
  • New WCM features introduced
     ○ Consistent and Pixel Perfect Branding - which was extremely difficult today with Sharepoint 
     ○ Page Authoring - Web based or Smart Client (Word)
     ○ Dynamic Site Navigation controls/webparts
     ○ Governance - Publishing Schedules, Approval workflow, Formatting restrictions
     ○ Site Management Tools
     ○ Performance - Internet Scale & powerful Caching to handle high traffic rather going to DB for every piece of content. Also cache buckets are based on user rights.
     ○ Content Deployment methods
     ○ Security - Forms Authentication, Anonymous
     ○ Multi-Lingual Sites (Basic site in English and then other sites depend on this)
     ○ Search
  • Customers will be provided powerful tools to migrate all content from existing MCMS02 sites to Office "12" server. 
    • Make creation of dynamic, produced websites dramatically faster and easier. 
    • Provide great Out Of Box (OOB) Experience
    • Lower amount of costly custom code
    • Incremental migration is like a job that can move incremental content from CMS02 every night to the new site
  • In the new system:
    • Portals are a collection of webs
    • The webs are arranged in a hierarchy
    • Hierarchy controls navigation and security
    • SPSv2 Area, CMS02 Channel are now all based on the WSS webs construct for containership
    • Each web has a document library for pages. Pages are special document library items. So they inherit all WSS functions like versioning, Check-in/Check-out, workflow free
    • Each web can have its own ASP.NET v2.0 master page. Then there is page layout that actually lays out the page
    • WSS ships with standard field controls. There are additional CMS field controls like rich HTML
    • Portal Navigation 
      • Includes Webs, Pages and Authored links
      • Dynamic Navigation based on site hierarchy
      • Navigation links trimmed based on security, workflow state and publishing schedule
    • Security
      • A new WSS authentication provider implemented on top ASP.NET Role provider
        • Viewer role: Viewers can use the site, can view pages, documents, images. But they can't use the Sharepoint application - Can't call Remote APIs: SOAP, DAV & RPC. Can't view application UI
        • Policy: Can constrain maximum access per web application. Deny all write access via http://site:80
    • Topology
      • Farms: Scale up and down as needed
      • Multi-farm: Staging environments in different networks. Authoring in Intranet with AD Authentication. Production in live networks with forms authentication
      • Site collections can be deployed between environments
    • Paths and Job
      • QuickDeploy job role allows news authors to deploy content immediately
      • Normally there is path which is channel connecting authoring to the live environment
      • Jobs control what content is copied when
      • It doesn't deploy security setting
Having worked on Portal Development for nearly a decade, I was quite skeptical when I heard Ryan talk about using Sharepoint as the basis for a High Traffic Internet site. So I went to Hands-On-Labs (HOL) and played around with this new technology. After an hour of getting my hands dirty I was convinced that this is very promising piece of work. Though the final release and performance will determine its success, the idea of using Sharepoint's (ASP.NET v2.0) evolved WebPart technology as the basis, brings in hitherto unseen power to the WCM space.
 
You can download from here slides for this and other Sharepoint sessions of PDC '05. Thanks to Mark Harrison for the link to this page.
 
Friday, September 16, 2005
Bob Muglia did the keynote on Day 3 and it was all about (as expected) Windows Server System. The highlights are:
  • Microsoft Windows Server Cluster Beta 1 - www.microsoft.com/hpc. Today Linux dominates the high performance computing (HPC) market through ad-hoc custom clustering. Windows Server 2003 Cluster Edition hopes to bring a common platform to do this.
  • Microsoft is introducing Infocard – a federated identity verification system. You remember .NET Hailstorm?. This time it is supposed to be different, let us wait and see
  • Microsoft is introducing XPS (code named Metro) document delivery system as part of Avalon (WinFX WPC). XPS will be the default that applications speak to Printer for Printing, Printer are expected to have native XPS compilers in them around Windows Vista timeframe. XPS is based on Windows Presentation Framework XAML.
  • Windows Server Longhorn to be released in 2007. Today first CTP with IIS 7.0 was handed out to all PDC attendees.
  • Microsoft is introducing Transaction based file sytem (TxF) for NTFS. It will be an enhancement to NTFS released as part of Longhorn server, which makes every file operation as a transaction. Just like in Database you open Begin Trans, do file copy/move/delete/write/modify and commit trans. If you aren't using it no overhead; usage also will add very little overhead. I think this is very cool.
  • New Event Log model to be introduced in Longhorn server
  • IIS 7.0 to be made Modular – modeled like Apache web server. (More details in a separate post). Will also have Windows Activation Service (WAS), ASP.NET Integration, Integrated Diagnostics and Tracing.
  • Windows System Center Management, Windows Hypervisor, Virtualization and new enhanced VHD format to be introduced post longhorn server
  • Today every piece of MS Server System is available in 64bit. MS Internal IT has seen huge performance benefits on running web servers in 64bit
 
Thursday, September 15, 2005

Windows Workflow Foundation (which was announced today) is an extensible programming model and runtime components for building solutions on the Windows platform. Major highlights:

  1. Bundled part of WinFX runtime, should get released around Windows Vista timeframe
  2. First likely to get released as part of powers Office "12" Server workflow. Windows Sharepoint Server “12” uses WWF workflow internally
  3. It is important to understand WWF is not a server product, but BizTalk is a server product. WWF can do both Human Workflow and EAI/B2B. There is no server or service component for WWF. It gets kicked off from your main function. You call a start function of WWF and the WWF runtime runs inside your application. User has to develop the host application that hosts the runtime and also has to develop failure (Restart) and multiserver setup. Persistence can be stored to a File or a SQL Database through appropriate connection string to any machine.
  4. Workflow models and definitions can be stored as a .CS (.VB) File or as .XOML file
  5. Dynamic changes can be made to the workflow  of a running instance

For more details, refer to MSDN WWF Site or Windows Workflow Site

 
Thursday, September 15, 2005

Eric Rudder did the the keynote on Wednesday. The highlights of the keynote were:

  • Announcement of Windows Workflow Foundation (WWF), though a workflow engine from Microsoft has been rumored for several years, it finally was out of the bags today. A powerful Workflow framework as part of WinFX is a very compelling value proposition for .NET developers. Almost all business applications (Web or Windows) has some kind of Workflow custom build into them. Moving this to the underlying platform will certainly speed-up development and make it easier to debug, develop and maintain.
  • Microsoft announced MS Expression, a suite of designer tool. Traditionally developers and designers used different tool sets to do their work, Expression aims to bridge the gap. Three SKUs were announced part of Expression family
    • Microsoft Acrylic Graphics Designer – aimed at pure designers who can use it do powerful bitmap and vector graphics in the same design surface. Ability to generate XAML files.
    • Microsoft Sparkle Interactive Designer – aimed at designers and developers to design Windows Forms Application using XAML.
    • Microsoft Quartz Web Designer – aimed at designer and developers to design standards based Web Application. Everything the tool does XML, XSLT, CSS, HTML all conforms to standards. By default the tool generates XHTML 1.0 transitional – can be configured to generate based on any W3C Schema. Provides pretty cool two-way (Design and Coding) CSS and XSLT Design surface.
    • The best part of both Sparkle and Quartz is that it uses the same project files as Visual Studio 2005 and preserves formatting of all source files. Thanks Microsoft for listening to us on preserving formatting and adopting standards!
    • The folks from North Face adventure wares demoed an application that allowed sharing a 3D model designed in Autocad with people who had only Avalon was very compelling.
  • So far applications to be customized by end-users with a scripting language, had to use only Visual Basic for Application (VBA). This is commonly used by apps like MS Word, Excel, Powerpoint, etc. Now Microsoft is introducing Visual Studio Tools for Applications (VSTA) which provides the entire set of .NET Runtime and Languages available for developers to customize apps. An early version of Autocad was demonstrated using VSTA as Proof of Concept.
  • All PDC attendees to be given free copies of SQL Server 2005 once the product gets released. The final CTP of SQL Server ’05 was given to us on that day.
  • Release Candidate of Visual Studio 2005 was also given to all attendees. Finally Whidbey seems to get out of the door.
 
Wednesday, September 14, 2005

With so many things that was announced today, I am lost on where to start. I will save myself much of laundry list reporting of features announced which I am sure press has done a great job - instead I will give links to these press coverages.

First Bill Gates and Jim Allchin Keynote (Read a quick detail here) - It was fabuluous stuff that were being presented, what were showcased today is sure to have an impact on the PC Users and Developers for next 10 years. You can read EWeek's complete coverage here on Windows Vista & Office 12 with screenshots.

In the keynote while BillG or Jim were speaking they had Text rendered on real time (Closed Captions) on the side screens. I am sure this definitely helped non-native english speakers to follow on the speech.

Bill Gates PDC '05 Keynote - Closed Caption

BillG's keynote (Official Speech Transcript is here) demo included all the great things that are coming in Windows Vista and IE 7.0. The Windows Vista SideBar and SideShow (This allows you to access Inbox/Calendar/Notes from a small screen in your Laptop Cover when your PC is switched off) were impressive work. The Sideshow is a real innovation coming in the laptop space after a long time.  The other cool thing in Windows Vista with Avalon was true support for Open Fonts that allows amazing font displays like the picture below. Notice how a character changes its previous character appearance. This is real delight to watch when you are typing and watching in real time the changes.

Windows Vista Open Font Support


BillG for the very first time showed the new Office "12" interface and features. One of the little things in that I really liked was the ability for Outlook to take documents from Sharepoint Document lists offline with you.

Apart from this, BillG's Keynote had a recruiting video featuring Bill Gates and a young lad, the story was about all that BillG had to undergo to get this guy work for him. Very funny!. You normally perceive BillG to be a geek, lacking fun but this proved that completely wrong.

Jim Alchin started his keynote with showing an original IBM PC/XT running Windows 1.0, which was cool to watch.


Windows 1.0 running MS-DOS Explorer


Windows 1.0 running Riviera game

In Jim Alchin's keynote there were many Vista's stuff demoed including:

  • Windows Vista's SuperFetch and its ability to use USB Memory stick as additional RAM for optimization. Using USB Memory this way was certainly a good idea
  • Windows Presentation Framework Everywhere (WPF/F) that allows you run Avalon lite apps in Mobile devices

Then Jim invited the 4 Senior Platform Architects in Microsoft to show code of upcoming technologies. These were legends like Anders and Don, the way they typed the code flawlessly, the co-ordination and sync-up between them were awesome. All upcoming technical presenters had tons to learn from this act. When Anders presented on upcoming LinQ's technology, Don typed the code in perfect timing; similarly when Don talked about Indigo (WCF) Chris typed the code. Awesome stuff!

Don Box, Anders Hejlsberg presenting on LinQ

The query language included new XLinQ technology, as you can see in the code below, it makes generating XML very easy. Good Stuff.

XLinQ Language

Finally Scott Guthrie (I love this guy, especially his works and more so his blog) showed the new Atlas ASP.NET TechnologyRead here about what Scott's got to say about the demo he made today. 

Scott Guthrie showing Atlas

 
Wednesday, September 14, 2005

Bill Staples, the IIS 7.0 PUM (Product Unit Manager) presented a very enjoyable session on Day 1 on what he aptly called “Roller Coaster Ride on IIS 7.0”.

These are the major points of his presentation:

  • IIS 7.0 primary design goal was to maintain and exceed the rock-solid reliability, ease of management, secure design of IIS 6.0. As a matter of fact, Microsoft has released No Critical Security Patches for IIS 6.0 since its release two years back. No other web server in the same period has the same credibility story.
  • IIS MMC console is dead. The present MMC  interface has outlived. For example it has stretched the limits of number of rows of tabs you can have in one dialog. On its place, a brand new sleek console has been introduced. It features user interface elements like property windows that people are familiar from Visual Studio.
  • ISAPI is deprecated for management. In present and previous versions IIS team used a private API to manage the core server components, but developers had to use ISAPI. Also ISAPI is nearly than 10 years old and the webserver scenario has changed from then. In its place, a brand new Win32 API is introduced for management. In fact, IIS 7.0 team also uses this same new API to manage. The new API is used by the graphical, console and scripting interfaces of IIS 7.0
  • The IIS Metabase is dead – Both in Binary and in XML format. You can store for each web site and/or web application its configuration in the same Web.Config file as in ASP.NET. In fact, you can even have a web.config for each folder inside a web application. This will allow you to give the complete application and IIS configuration to operations for deployment through XCOPY. No separate instructions to be performed by operations is required
  • Because of the last point, you don’t need to be a machine administrator to manage your individual web site. There are new roles called Site Administrator. New roles  model is introduced, this is modeled on ASP.NET Roles engine
  • The entire IIS architecture is being compartmentalized. Instead of being one monolithic block of all functionalities in one DLL file like today, IIS 7.0 has it has individual modules. This allows for convenient upgrade and patch story
  • You can now write IIS extensions using the same ASP.NET httpmodule interface. In fact, you can mix and match native and managed httpmodules.
    Since IIS uses HTTPModules, you can use ASP.NET Forms Authentication module to be effective even for non ASP.NET Pages like Perl/Phthon/CGI/ASP.
  • Excellent trace and log features not only for ASP.NET but for the entire callstack
  • IIS 7.0 will first ship with Windows Vista Client and then with Windows Longhorn server.

I have been using IIS from its 4.0 release, these new features no doubt, will go a long way in managing high traffic websites and web farms. The trace feature by itself is sure to save tons of time for all IIS 7.0 administrators and developers. I am dying to start deploying this. It is now being released with Longhorn Server CTP.