Saturday 2 March 2013

8 months on...

Since putting Lawn Calendar live last June, I've been occasionally monitoring the site using the Google Analytics tool set.  This gives some great information about where traffic is coming from and what it does once in the site.

I added a live, test and development profile so I could test changes to the code and profile filtering in isolation without effecting the live site, or so I thought!  I made what appears to be a beginners mistake when setting up my development profile.  Somehow, instead of setting up new filters, I re-used the filters from the live and test profiles, and effectively filtered out all of my traffic.  Unfortunately, due to the way Google Analytics works, once filtered, there is no way to retrieve the visitor data.  So I have no visitor data since  the end of October last year.  I thought that this was a genuine tail off as Summer came to an end but when it didn't pick up again in Jan/Feb, I started to get a bit suspicious.  I guess the lesson learnt here is, be suspicious if your visitor data suddenly evaporates and always re-check after making any changes to the filters.

Thursday 12 July 2012

Into the world of website promotion

Since lawnching (see what I did there?) the lawn calendar application on Sunday 24th June, I've been in a mixture of support and intense learning mode.  Our content manager, Phil, has been busy adding new content to the site including tips and remnders, and in doing so, found our first bug which was promptly fixed and applied.  I've also patched in some minor additions such as a google +1 button and the google analytics hook.  This leads me neatly to the intense learning.

This application is my first live internet application, so I admit to being a complete beginner with regards to promoting a new site.  I knew it had something to do with search engine optimisation (SEO), but was pretty naive with regards to what that actually involved.  I stumbled upon a blog how to build a niche site which explains in quite some detail how the blog author and others achieved top 10 search engine rankings for their sites.  I probably learned something new with every sentence! I additionally found a whole host of resources that I previously didn't know that existed.  I think the key thing that I have learned is that it is very easy to spend a lot of time promoting a site, but if you get some of the fundamentals wrong, you will be wasting a lot of time and effort.  Much of the material that I have read make reference to the '4 golden rules', which once understood, do make a lot of sense.

The initial intention after launching the site was to get 'cracking' on V2 which would have features that allowed for personalisation of content.  However, I've taken the decision to spend some time working on another project whilst this application 'finds it's feet'.  I'll still keep posting blog post on here, as and when I discover something new.

Friday 22 June 2012

Going Live!

It's been a while since I last blogged on the subject of the Lawn Maintenance Calendar, now know simply as Lawn Calendar.  The plan is go live this Sunday.  Although things are pretty much ready, there are a couple of tasks that I need to complete.

Firstly, I need to create a 'down' screen that I can switch on whilst I upload and configure the site.
Secondly, I need to work how how the data migrations are going to work.  The content provider has already uploaded quite a bit of content into the system on the test hoster and I want to use that as the basis for the live database.  That way, the content provider can add images to the existing written content.  Entity framework now has a migration feature which might be just the replacement I need for the existing DropAndCreateOnModelChange strategy that is currently employed.

Update:  The launch went ahead on Sunday after a hive of activity on Saturday.

Down screen

I found that my new hoster already provides this function, so I didn't have to develop it myself this time.  It's not the most beautiful of down pages, but it will do for the time being. 

Data Migrations   

I've moved to using Entity Framework 4.3.1 which includes the migrations feature.  This now allows me to make database enhancements and upgrade without having to lose the contents of the database.  I've been very impressed with it and will be using it's scripting features to upgrade to V2 when the time comes.

Here's some useful links regarding EF 4.3. and migrations:
http://blogs.msdn.com/b/adonet/archive/2012/02/09/ef-4-3-automatic-migrations-walkthrough.aspx
http://blogs.msdn.com/b/adonet/archive/2012/02/09/ef-4-3-code-based-migrations-walkthrough.aspx
http://blogs.msdn.com/b/adonet/archive/2012/01/12/ef-4-3-configuration-file-settings.aspx
http://www.ladislavmrnka.com/2012/03/ef-4-3-migrations-and-existing-database/

Uploading to hoster

This was quite straightforward for the website itself, but the database was a little trickier.  I couldn't find a way of uploading the mdf files and attaching them to the database like I could with the test site hoster. So, the only way I could get the database uploaded was to create an empty database, script and re-create the schema and then import the data using SSIS.

  

Wednesday 25 April 2012

Next phase

I've now completed the development for phase 1 of the Lawn Calendar.  It's now on the test server where we are going to leave it until we are ready to deploy to a full paid server.

Before we can fully go live, I want to set up the following:
  • www.lawncalendar.co.uk domain name for the site (registered).
  • A forum where users can discuss the application and suggest features and improvements.
  • Search engine optimisation (SEO) so that people can find the application from Google and Bing.
  • Facebook 'like' and Twitter 'tweet' buttons on the application (maybe)
  • Add legal disclaimer, t&c etc
Update:

Forum: now set up at freeforums

Some webpages with royalty free disclaimer, t&c examples:

http://www.businesslink.gov.uk/bdotg/action/layer?r.l1=1073861197&r.l2=1074448560&r.s=tl&topicId=1076141950
http://legal123.com.au/is-it-better-to-have-a-website-disclaimer-or-terms-and-conditions-on-my-website/

There was an issue with uploading images with upper case extensions.  Here's an article that talks about this:

http://forums.asp.net/t/1682158.aspx/1

Tuesday 24 April 2012

Merging LMC and Content manager

To hand over the LMC to the the testers, I needed to publish the application on a hosting server.  I found one that is free to host for 90 days (3 months).  Eventually, I'll upgrade to a paid service, but this free one will do for now.

One limitation of the free hosting service is that you can only install one application at a time.  The service is intended as an aid for students to learn ASP, so they don't want commercial applications.  So to get around this limitation, I needed to put the content management application in with the main LMC application, so that they shared the same web.config file.  I could then use custom routes to access the content manager.  I also needed a way of specifying different layouts for the LMC and the content manager.   

Here are a couple of links that helped out:

http://www.asp.net/mvc/tutorials/controllers-and-routing/creating-custom-routes-cs
http://stackoverflow.com/questions/5161380/how-do-i-specify-different-layouts-in-the-asp-net-mvc-3-razor-viewstart-file


Once installed, I ran into the old UK vs US dates problem when trying to submit maintenance task data to the controllers.  Found this solution which creates a model binder to handle the date conversion.

http://stackoverflow.com/questions/9821407/mvc3-en-gb-dates-in-get

Sunday 1 April 2012

Date Filtering and Back to the weather API

I've been working on the LMC all weekend with the intention of finishing it off so I can start on another project next week while the stakeholder is away!

Date Filtering

Whist I was building out the Content Manager application, it dawned on me that I couldn't use the basic date range filtering that I had been using. The reason for this is that the content date ranges aren't actually date ranges because they do not have a year element. For example, one range might be 02/03 to 02/06 whereas anther may be 10/10 to 10/02 (i.e. go over a year boundary). The only thing I could assume is that a period would always be less than a year long.

So, once I had replaced the display and editor templates in the Content Manager to work with dd/mm entries. I had to revisit the LMC application and write some custom filtering logic to replace the basic date between logic.

Weather API

I'd been looking at weather widgets from various sources, and whilst they ware all very nice, none of them really ticked all the boxes for what I wanted. I had two main criteria. Firstly they need to be able to take a post code district as a parameter. Secondly, the size and styling of the widget had to fit in with the look and feel of the Lawn Maintenance Calendar style. The closest I got to finding a widget that worked was the Met Office one. It looked good on the site, but there was no way of dynamically sending through a post code district.

Initially, I'd played with World Weather Online's free weather API, which is a nice little rest service. But I stopped playing with it when I discovered the widgets because I didn't want to re-invent the wheel, so to speak. But I went back to the API in the end because it was the only solution that could match my acceptance criteria. It accepts a post code district as an input and because it just returns the data and image links as XML, I'm free to present it in any way I wish. This is great because I could use ASP.NET MVC display templates to lay out the forecast just like the widgets that I had been using (very MVC). I could then use the same styling that is used throughout the application to style the 'widget' so it looked like it was part of the rest of the app. I have to say, I'm very happy with the result.

The next thing I need to do was ask the user for the postcode district (the first part of the postcode). Initially, I was going to ask the user to register for an account and specify the postcode at the registration stage, but after having a good think about this, I decided to just use a cookie instead. I'll probably be adding user accounts at a later stage when I introduce personal notes to the calendar. For the time being, using cookies to capture and keep the postcode district works well.

So, I've now completed the development for the first phase of the Lawn Maintenance Calendar. I now need to get it tested by the content manager before putting it live.

Friday 30 March 2012

Building out the content manager

Just a quick post today. Just building out the content manager, so just pretty straightforward coding. Created a display template (which amounts to a special partial view) for dates so that the time part is omitted. I also needed to solve a problem were line breaks weren't being shown on multiline text. This was resolved with a simple replace call, but probably could be done more elegantly with a display template. Earlier on, fixed a few niggles with the calendar app, such as the selected date resetting when going to the about screen or keyword detail screen. Did some general tidying of these screens.