Category Archives: General - Page 2

ASP.NET MVC XsltViewEngine, patch submitted to the contrib project

I just submitted a patch to the mvc contrib project that contains the xslt view engine I wrote for Xero without any of the dependencies from our own libraries or commercial components.

The bulk of the work is done in a class called XmlResponseBuilder which builds the xml document that is going to be transformed by the xsl stylesheet. Almost all the rest of the code is there just to build up this document.

The implementation of IView and IViewFactory were the easy bits :)

To use the View engine you need to take the following steps:

1. Get the MVC Contrib project from google code

repository url: http://mvccontrib.googlecode.com/svn/trunk/

2. If the patch hasn’t been applied yet you can download it from: http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=MVCContrib&DownloadId=23748

After downloading the patch you can apply it to the downloaded mvc contrib project.

3. I use a base controller to ensure that the correct data is passed to the view factory. This is the base controller class:

public abstract class XeroControllerBase : Controller

    {

        private readonly XsltViewData vData = new XsltViewData();

 

        protected IHttpSessionState Session

        {

            get { return ControllerContext.HttpContext.Session; }

        }

 

        public XeroControllerBase()

        {

            ViewFactory = new XsltViewFactory();  

        }

 

        #region Add datasource methods

 

        protected void AddDataSource(IXmlConvertible dataSource)

        {

            vData.DataSources.Add(new XslDataSource(dataSource));

        }

 

        protected void AddDataSource(IXmlConvertible dataSource, string rootName)

        {

            vData.DataSources.Add(new XslDataSource(rootName, dataSource));

        }

 

        #endregion

 

        #region Add variable methods

 

        protected void AddPageVar(string key, string value)

        {

            vData.PageVars.Add(key, value);

        }

 

        #endregion

 

        #region Add message methods

 

 

        protected void AddErrorMessage(string message)

        {

            vData.Messages.Add(new ErrorMessage(message));

        }

 

        protected void AddErrormessage(string message, string controlID)

        {

            vData.Messages.Add(new ErrorMessage(message, controlID));

        }

 

        protected void AddInfoMessage(string message)

        {

            vData.Messages.Add(new InfoMessage(message));

        }

 

        protected void AddInfoMessage(string message, string controlID)

        {

            vData.Messages.Add(new InfoMessage(message, controlID));

        }

 

        protected void AddAlertMessage(string message)

        {

            vData.Messages.Add(new AlertMessage(message));

        }

 

        protected void AddAlertMessage(string message, string controlID)

        {

            vData.Messages.Add(new AlertMessage(message, controlID));

        }

 

        protected void AddInfoHtmlMessage(string message)

        {

            vData.Messages.Add(new InfoHtmlMessage(message));

        }

 

        protected void AddInfoHtmlMessage(string message, string controlID)

        {

            vData.Messages.Add(new InfoHtmlMessage(message, controlID));

        }

 

        protected void AddErrorHtmlMessage(string message)

        {

            vData.Messages.Add(new ErrorHtmlMessage(message));

        }

 

        protected void AddErrorHtmlmessage(string message, string controlID)

        {

            vData.Messages.Add(new ErrorHtmlMessage(message, controlID));

        }

 

        protected void AddAlertHtmlMessage(string message)

        {

            vData.Messages.Add(new AlertHtmlMessage(message));

        }

 

        protected void AddAlertHtmlMessage(string message, string controlID)

        {

            vData.Messages.Add(new AlertHtmlMessage(message, controlID));

        }

 

        #endregion

 

        #region RenderView method hides

 

        protected new virtual void RenderView(string viewName)

        {

            RenderView(viewName, string.Empty, vData);

        }

 

        protected new void RenderView(string viewName, string masterName)

        {

            RenderView(viewName, string.Empty, vData);

        }

 

        protected new void RenderView(string viewName, object viewData)

        {

            RenderView(viewName, string.Empty, vData);

        }

 

        #endregion 

    }

 

del.icio.us Tags:
 
kick it on DotNetKicks.com

What do you expect from a (I)DE?

I’ve been thinking about what I consider the bare minimum to be for a IDE.

First off let me start by saying that an editor with snippets is NOT an IDE, it’s an editor. The hardcore guys out there that favor that type of tool musn’t be suffering from Carpal Tunnel Syndrome or the likes.

I personally have found myself having a hard time accepting the fact that I have to write all my well known classes and functions completely.

Here’s my list of features:

  • Intellisense – Context sensitive autocompletion and discovery of members of a type + the type of member accros the board (xml, html, code files….)
  • Refactoring – being able to safely rename methods, classes etc.
  • Code navigation – much like ctrl-b in resharper, intellij, netbeans,….
  • integrated debugging support accross the board
  • background compilation for compiled languages (instant feedback)
  • easily extensible with your own plugins (prefferably in yaml, xml etc)
  • proper find-replace functionality with regex support
  • code formatting and folding accross the board.
  • and most importantly it has to let me get on with my job.
  • integration of unit test frameworks not just a vendor specific one.
  • integration with source control applications

What needs to be added to this list ?

On a side note I also want to link to a post from Mike Duncan who has aggregated a bunch of really cool tools.
15 hot tools that made me a coding Paris Hilton

del.icio.us tags: , ,

Innovation anybody ?

Through Lucy McFadden’s blog I found a bunch of slides in this post talking about creativity and innovation.

One of my most used expressions is: Discontent breeds innovation

Which is my justification for being grumpy J

Anyway I’m sure this is old news to some and will be new to others:

http://www.slideshare.net/imootee/10-lessons-of-innovation-idris-mootee-keynote

I particularly like slides 7, 9 , 11

del.icio.us tags: , ,

If you thought Joost was cool….

I have been using Joost for a couple of months now, but today Tony from work put me onto Miro

Some of the things that make Miro somewhat superior are:

  • Play any video file format
  • More HD content than anywhere else
  • 250000 channels as opposed to 250
  • Save you tube videos
  • Miro is an open platform

You can get it at http://getmiro.com

MozREPL: REPL for mozilla

Adam Burmister, a collegue @Xero put me onto MozREPL

Connect to Firefox and other Mozilla apps, explore and modify them from the inside, while they’re running.

Execute Javascript, play with browser GUI, sneak into HTML pages, examine functions and variables, redefine them on the fly, hot-fix bugs, … MozRepl itself is programmable from within MozRepl.

 

del.icio.us tags: , ,

SVNBridge is finally working

So this weekend I discovered that SVNBridge is working fine now.

I haven’t tried it against our production TFS server but against codeplex it works great.

http://www.codeplex.com/SvnBridge

SvnBridge – Use TortoiseSVN with Team Foundation Server

Project Description
SvnBridge allows you to use TortoiseSVN and other Subversion clients with Team Foundation Server. It converts the calls made by your Subversion client to the API supported by TFS.
SvnBridge works by running an executable on your local machine that acts as the bridge to TFS. You point SvnBridge at the TFS server, and point TortoiseSVN at the bridge running on your local machine. This allows you to use TortoiseSVN with any TFS server without needing to change the TFS server in any way (no need to convince your system administrator of anything!).

If you haven’t checked it out already, it’s definitely worth a look.

 

I like what I’m seeing from Microsoft lately

Microsoft has just hired Rob Connery from SubSonic, and his job is going to be to work on his own open source project.
I am very pleasantly surprised by that news, and this is the change of direction so many people have been waiting for I think.

I for one like this whole new direction of embracing open source. It seems like lately the party can’t stop, they also hired: Scott Hanselman, Phil Haack and Alex James. I should maybe start thinking about getting one aggregated feed from msdn :)

It’s good to see that open source projects are now being endorsed. I can’t wait to see what’s next. 

What’s your personality type ?

Through John Clegg I found out about a personality test on bbc.co.uk.

He has a more lengthy explanation on how he got there on his blog

Anyway I’m always interested in finding out which type of person I am etc. So I could not resist and took the test.
If you’re like me and just itching to find out more about yourself or you just have some time to spare you can take the test here http://www.bbc.co.uk/science/humanbody/mind/surveys/whatamilike/

Apparently I’m a Big Thinker 

The four aspects that make up this personality type are:

Spontaneous, Ideas, Heads and Extrovert

Summary of Big-Thinkers

  • Outspoken, ingenious and bored by routine
  • Think of themselves as talkative, curious and self-sufficient
  • May neglect the routine work required to make their plans successful

More about Big-Thinkers

Big Thinkers are always looking for the next big idea or opportunity. They’re adept at spotting trends and thinking on their feet. Big Thinkers like to jump in and find innovative solutions to complex problems and are good at developing strategies for the future.

Big Thinkers are usually curious, logical and energetic. This chatty group enjoys a good debate and asserting their opinions. Sometimes others may find the way they express their ideas too abrupt or challenging.

In situations where they can’t use their talents or are unappreciated, Big Thinkers may be rude, critical of others or rebellious. Under extreme stress, Big Thinkers can become preoccupied with unimportant details and lose sight of the ‘big picture’.

Big Thinkers may ignore important details in their plans and overlook the impact their ideas have on the people around them.

Big-Thinker Careers

The entrepreneurial spirit of the Big Thinkers often leads them to seek new challenges; this is often more important to them than working in a particular field or a specific career.

Disclaimer:

It’s important to remember that no survey can predict personality type with 100 percent accuracy. Experts say that we should use personality type to better understand ourselves and others, but shouldn’t feel restricted by our results.

 

 

del.icio.us tags:

Alex James will be joining Microsoft

I always thought that if there was one guy in NZ that should be working there it’s Alex.

And today he announced that he will be joining Microsoft in September : http://www.base4.net/Blog.aspx?ID=538

 

Congratulations Alex. I for one am looking forward to the great things you will be doing there.

Code camp registrations are now open

How exciting.. we’ve been planning this for a while but now we can publically announce that code camp registrations are open.

Our next code camp will be the sunday before TechEd and we will be running it in one of the larger TechEd conference rooms.

Hurry to http://www.codecamp.net.nz for registrations and more details.

I know that we’ve got an impressive list of speakers.

 

Hope to see you there !!!

Page 2 of 712345...Last »