Rails, Fast Tests and Architecture

For a while now I have been flirting with Ruby and Ruby on Rails. Very early on, I learned the hard way to stick to the ‘Rails way’, especially when you don’t yet understand the technology. I have however, often found myself fighting both rails and wha…

Umbraco 4.9 Schema

I was having a look through the Umbraco 4.9 database a while ago and made some notes, thought I’d share them here. It has changed for V6.

[dbo].[cmsContent]

Relates content nodeIds to contenttypeIds (doctypes) (So tells each content item to which doc…

Send that email through GMail from C#

Often we’ll need to send out email from websites containing notifications etc. Traditionally I installed the MS mail service (an open relay mail server) on the server and cracked on. That probably isn’t best practice and its difficult to give the clien…

Estimating how much the indefinite might cost

There are lots of articles out there on Agile estimation, i.e. T-Shirt sizing, Planning poker, etc. which is commonly used at the iteration planning stage. But what about in the scenario where you haven’t engaged a supplier/partner yet and you need to know how much to budget for? There are probably many ways to do this … »

One step closer to eradicating projects from your organisation

I’ve found the following visualisation really useful for weaning organisations off using the project approach for software development. This visualisation unpicks two major contentions common in orgs: Staff contention – the over-allocation of staff (not resources!!), this is where one person is allocated to multiple projects, .33 FTE on Project 1, .25 FTE on Project … »

Time and materials vs fixed price fixed scope

As I mentioned in my previous post, most contracts attempt to transfer all risk to the supplier by locking in the scope, price, and timescales. What you’re actually doing here is locking in project failure from the outset. Your costs will almost certainly rocket as you get hit with change requests with hefty price tags. We … »

Adding a custom button into the Umbraco content menu

I needed to add a custom button into the menu bar shown on each tab in the content editor in Umbraco.

Firstly you need to hook onto the page load event within the backoffice via a class implementing IApplicationStartupHandler.

public class CustomButton : IApplicationStartupHandler
{
public CustomButton()
{
umbracoPage.Load += UmbracoPageLoad;
}

private void UmbracoPageLoad(object sender, EventArgs e)
{
}
}

Right so now we have a place where we can manipulate the tab menu. There are a few null reference checks we could do with throwing in but we’re essentially going to run the following. Our button needs to be added to each menu in each tab.

private static void AddButton(umbracoPage page)
{
var tabView = (page.FindControl(“body”)).FindControl(“TabView1”) as TabView;

if (tabView == null) return;

foreach (TabPage panel in tabView.GetPanels())
{
var menuButton = panel.Menu.NewImageButton(1);
menuButton.AlternateText = “My custom button rocks”;
menuButton.ImageUrl = “~/images/cms/myimage.gif”;
menuButton.Click += CustomButtonClicked;
}
}

As this is an image button we can handle the click in the usual webforms way.
Here’s the full implementation:

namespace DetangledDigital.Demo.StartupHandlers
{
using System;
using System.Web;
using System.Web.UI;
using umbraco.BasePages;
using umbraco.interfaces;
using umbraco.presentation.masterpages;
using umbraco.uicontrols;

public class CustomButton : IApplicationStartupHandler
{
public CustomButton()
{
umbracoPage.Load += UmbracoPageLoad;
}

private void UmbracoPageLoad(object sender, EventArgs e)
{
var page = sender as umbracoPage;

if (page == null)
return;

if (!page.Page.Request.Path.ToLower().Contains(“editcontent.aspx”))
return;

AddButton(page);
}

private static void AddButton(umbracoPage page)
{
// Js fix for toolbar, may be required dependant on menu setup.
// page.Page.ClientScript.RegisterClientScriptBlock(GetType(), “cssfixtoolbar”, “<style type=’text/css’>.mceToolbarExternal{left:108px;}</style>”);

var tabView = (page.FindControl(“body”)).FindControl(“TabView1”) as TabView;
if (tabView == null) return;

foreach (TabPage panel in tabView.GetPanels())
{
var menuButton = panel.Menu.NewImageButton(1);
menuButton.AlternateText = “My custom button rocks”;
menuButton.ImageUrl = “~/images/cms/sendToEditor.gif”;
menuButton.Click += CustomButtonClicked;
}
}

private static void CustomButtonClicked(object sender, ImageClickEventArgs e)
{
var nodeId = int.Parse(HttpContext.Current.Request.QueryString[“id”]);

// Do some bits

// Show the user a notification
BasePage.Current.ClientTools.ShowSpeechBubble(BasePage.speechBubbleIcon.success, “Success”, “The content has been sent for approval.”);
}
}
}

Procuring Agile Software Development

Intended Audience Before we get into the depths of this blog post I think it’s important to define what type of procurement I’m talking about and who this approach is appropriate for. Each procurement scenario has it’s own nuences and challenges and one size certainly does not fit all. In this series of blog posts … »

Umbraco V4.x Clearing old document revisions

This script will clear old document revisions ensuring the current revision isn’t removed.

Due to the way the Umbraco schema works if you have one doctype with 10 properties then publish that document 10 times you will have added 100 rows into the cmsPropertyData table and a number of rows into other tables through the CMS.

1 65 66 67 68