Archive for November, 2009
Files table update: New functionality for Noatak
The files table provides tools for managing files on every page. We’ve made improvements to this important user experience which can be seen in the screenshot below. Details follow.
1) Files & images combined
To reduced confusion and consolidate functionality, images have been added to the files table listing. Now all the attached files can be managed in one place regardless of the file type. The image gallery has also been simplified to a view only experience.
2) Updated revision information
By clicking the plus symbol next to a file, previous file revisions are loaded via AJAX to display information about file moves and renames. Yes, you can rename files now! From the file “Actions” menu, select “Move/rename” to change a file’s name.
3) Inline file description editing
In the past, lots of functionality was contained within popup dialogs. With each release we have tried to evaluate what functionality can be simplified without the use of a dialog. To this end, file descriptions are now edited inline on the page by hovering over the description and clicking. Upon clicking, the user is presented with a textbox for quick editing and saving.
4) Attach new file version
Have you ever wanted to update that one file but found that you uploaded a new file instead? Not anymore! The “Attach new version” feature ensures you upload a new version of the file you want. (And don’t forget you can rename that newly uploaded file too.)
Look for these new features in the Noatak release or try them out now at the MindTouch Community Portal!
Developing for MindTouch Vista/Win7 style
I had the once-in-a-three year opportunity recently to setup a fresh development environment here at MindTouch. Unfortunately this opportunity over-extended its welcome as I started running into various quirks which made the process more painful than it probably should have been. I’ll vent calmly explain these issues here so should you ever need to debug or build on MindTouch / Dream under Vista or Win 7 it’ll be smooth sailing.
So how does this apply to me?
There are several reasons why you may want to setup an MindTouch API dev environment.
- You’d like to extend your MindTouch installation by writing a C# extension or authentication provider or by modifying an existing one
- You’d like to write your own HTTP based service (independently of MindTouch) using the Dream framework
- You’d like to fix a MindTouch API bug and submit a patch so it can maybe get included in the next release
- You’re an API developer employed by MindTouch
Note that there are many ways to customize and extend the functionality of your install without ever needing to do this. You can customize the look and feel by modifying the skin, write custom DekiScripts within pages and add new DekiScript XML functions to build mashups and generate reports, build PHP hooks to extend the UI functionality, and discover already working extensions and scripts in the app catalog.
The setup
You’ll need to have a working UI and MySql database running in order to do effective API development including extensions, auth services, etc. The quickest way to set that up is to download a VM (or perhaps make a snapshot of your live environment if it’s a VM). If you need the UI code to be the bleeding edge freshest you can follow this guide to switch a VM to trunk but this probably isn’t necessary for you (no need to update the Mono C# API bits there though). Note that you’ll want to have a consistent codebase on the UI side as well as the API so be sure you’re running either the same release (or trunk) on both sides.
This guide by crb will get you the API code and get you to a point where you can point your browser to the UI and it will access the MindTouch API you’ve installed on your Windows box allowing you to see the changes you may be making.
Well that was easy.. So whats the problem?
URI Reservation aka ‘Why does Dream/MindTouch API only start with Admin rights?’
As part of the hypersensitive brute force approach to security taken by Vista the concept of URI reservation was introduced for what I’m guessing is an attempt to add a hoop for malware to jump through before listening on a socket that speaks HTTP. The Windows core http.sys library restricts the root namespace (i.e. ‘/’) of HTTP URI’s to require administrator access or explicit rights. Lots has been written about this but you’ll never know about it until you run into an issue. In Dream’s case it’s an Access Denied error when starting up as a non-admin. This means that if you’re going to be starting Dream from Visual Studio then VS itself has to run as Admin. This causes some annoying problems like not being able to drag in or out of the window from explorer as well as potentially serious security issues you may become victim of by running code as admin.

The ‘proper’ way to fix it is to add a URL reservation for Dream. Download the HTTPNamespaceManger tool described here, unzip it, and run it as admin. Click Add and type the URL “http://{yourip}:8081/” where {yourip} is an IP that your UI is able to access as well (so not localhost). Hit Ok. Click Add and type the username you generally use when running VS and click Ok. Click Ok again and quit the tool. Modify the mindtouch.host.exe command line startup arguments by appending “ip {yourip}:8081″ with {yourip} substituted by the ip you entered above. Start the project again from within VS and hopefully the error is gone.
Using the ip cmd line argument for Dream tells it what IP to bind to rather than it trying to bind to all of them which is sure to fail unless a reservation exists for each. Dream released with Noatak will have a change to ensure that it doesn’t exit when it couldn’t bind to one of the IPs.
Changes to 64-bit applications are not allowed!?
So you’ve solved that problem and you think you’ve conquered all that MS has thrown at you’re about to make a code change in an active debug session and this error pops up.

It turns out that since you’ve installed a 64bit OS, you can’t actually do any live debugging on a .net process unless it’s explicitly compiled as 32bit. Only the startup assembly (in this case mindtouch.host.exe) needs to be explicitly set to 32bit mode via its project properties (build -> platform target -> x86). We’re considering either shipping with an additional mindtouch.host.x86.exe compiled for 32bit only or switching our default build of mindtouch.host.exe to 32bit. Please comment here or on the forum if you have any strong opinions on one of these approaches.
Hope this guide helps someone. Big thanks to crb for putting together some of the core documentation for doing this! As always, feel free to find us at irc.freenode.net #mindtouch or post on the forums if you have questions.
MindTouch @ Monospace: Going Concurrent & Keeping your Sanity
Last week, on October 28th, Steve and I had the pleasure of presenting at the Monospace conference. I picked a topic close to the API Team’s heart, Concurrency, and specifically covered our use of the asynchronous method pattern and our coroutine framework. We’ve covered a lot of the motivation and reasoning for this a number of times on the Concurrent Podcast. I captured the talk as a screencast because i think it’s a useful primer on concurrency in MindTouch 2009 and our Dream framework and its especially useful as a hands-on companion for Concurrent Podcast 3: Coroutines:
I’d like to thank Scott Bellware for putting on a great conference, as well as everyone from the Mono team and the Mono/.NET community who attended. Monospace was incredibly insightful and I met a lot of very smart people there. Let’s hope this becomes a regular conference.
