Nik's Technology Blog

Travels through programming, networks, and computers

Developing Scheduled Tasks for Immediacy Management Console (Alterian CMC)

Immediacy Management Console Scheduled Tasks are useful for running tasks that need to occur automatically on a frequent basis which are independent of website visitor actions.

immediacy-mc

These scheduled tasks have the advantage of being able to hook up to the Immediacy API, allowing developers to perform tasks on Immediacy pages etc.

Scheduled tasks can have public properties if required, which are entered via a Plug-in Settings dialog box.

immediacy-mc-settings

Plug-in Development

Immediacy Management Console plug-ins are simply a .NET class library. The project should contain a C# or VB.NET file containing the plug-in and a separate class which defines the Plug-in Settings dialog.

The plug-in class needs to reference the following Immediacy namespaces.

Immediacy.Configuration;
Immediacy.Service.Interfaces;

Your plug-in class needs to inherit from:

Immediacy.Service.Interfaces.Plugin

And your class needs to have a few class attributes for Immediacy (CMC) to recognise your plug-in:

    [SettingsControlTypeAttribute(typeof(SiteMapSettings))]
    [GuidAttribute("XXXX8D90-XXXX-XXXX-XXXX-A3341127XXXX")]
    [PluginDetailsType("Name of Plug-in", "Description")]

Your plug-in class constructor needs to pass the settings to the base class as follows:

public Sitemap(ImcFile imcFile, StringDictionary settings) : base(imcFile, settings) { }

To build your plug-in you need to override the Execute() method and put your code in here.

Plug-in Settings Dialog Development


The plug-in settings dialog is created by another class, which inherits from Immediacy.Service.Interfaces.SettingsControl

This class is essentially a Windows Form code file without the form designer, so you’ll need to import the  System.Windows.Forms namespace.

You’ll need to add Windows.Forms Labels and TextBoxes to the dialog box to capture the public properties from the user who configures the plug-in while scheduling it.

Implement the abstract class like the example below:

 

namespace ImmPlugins.Sitemap

{

    public class SettingTest : Immediacy.Service.Interfaces.SettingsControl

    {

        private System.Windows.Forms.TextBox txtUrl;

  private System.Windows.Forms.Label lblUrl;

 

  private System.ComponentModel.Container components = null;

 

        public SiteMapSettings(Type pluginType)

            : base(pluginType)

        {

            InitializeComponent();

        }

 

        public override System.Collections.Specialized.StringDictionary Settings

        {

            get

            {

                StringDictionary retVal = new StringDictionary();

                retVal.Add("url", txtUrl.Text);

                return retVal;

            }

            set

            {

                txtUrl.Text = (string)value["url"];

            }       

  }

 

        public override bool SettingsAreValid

        {

            get {

                  if (txtUrl.Text == “”)

                  {

return false;

                  }

                  else

                  {

                        return true;

                  }

}

        }

 

        public override string SettingsAreValidVerbose

        {

            get {

string errorText = string.Empty;

                  if (txtUrl.Text == "")

                  {

errorText += "Please specify a URL \r\n";                 

}

return errorText;
}

        }

 

        private void InitializeComponent()

        {

            this.lblUrl = new System.Windows.Forms.Label();

            this.txtUrl = new System.Windows.Forms.TextBox();

 

            this.txtUrl.Location = new System.Drawing.Point(202, 59);

            this.txtUrl.Name = "txtUrl";

            this.txtUrl.Size = new System.Drawing.Size(160, 20);

            this.txtUrl.TabIndex = 2;

 

            this.lblUrl.Location = new System.Drawing.Point(8, 59);

            this.lblUrl.Name = "lblUrl";

            this.lblUrl.Size = new System.Drawing.Size(188, 16);

            this.lblUrl.TabIndex = 1;

            this.lblUrl.Text = "URL:";

 

this.ClientSize = new System.Drawing.Size(374, 183);

            this.Controls.Add(this.lblUrl);

            this.Controls.Add(this.txtUrl);

            this.Name = "PluginSettings";

            this.ResumeLayout(false);

            this.PerformLayout();

        }

 

        protected override void Dispose(bool disposing)

        {

            if (disposing)

            {

                if (components != null)

                {

                    components.Dispose();

                }

            }

            base.Dispose(disposing);

        }

    }

}

Plug-in Installation


Immediacy Management Console plug-ins are installed in the Immediacy CMS folder path.

Simply compile your .NET class library to a DLL and copy it to this directory.

e.g. C:\Program Files\Immediacy\CMS\6.1\Service\Plugins

(Note: This path maybe slightly different on your installation depending on Immediacy version, drive path etc)

If all has gone well your plug-in should show up in the list of tasks which can be scheduled in the Immediacy Management Console.

Adsense for Domains - Fasthosts Setup

Until recently you couldn't take advantage of Adsense for Domains if you registered a domain name with Fasthosts.  However, with the new Fasthosts control panel which now allows you to edit DNS settings, domain name owners can now earn revenue from domain names they don't currently use.

If you're familiar with Google Adsense, you may have seen the "Adsense for Domains" link on the "Adsense Setup" tab on the Adsense navigation.  Unfortunately the "Quick start guide" Google provides doesn't include instructions for Fasthosts setup and following the generic instructions doesn’t work either.

The solution

Log-in to your Fasthosts control panel and click on the “DNS” button for the domain you wish to use to park with Adsense for Domains.

Find your "unique identifier" from the Adsense for Domains page within Adsense and create a CNAME as follows:

Host Name: www

Points to: your adsense unique identifier e.g pub-xxxxxxxxxxxxxxafd.ghs.google.com.

Next create an A record as follows:

Host Name: leave blank

Points to: 216.239.32.21

See the screenshot below for a finished example…

fasthosts

EatonWeb: A Blog Directory to Avoid

When you start blogging its a good idea to put the word out and let people know your new blog exists, one way to do this is get listed in online blog directories.

Some directories charge a fee to review your blog, which help pay for the upkeep of the directory and also helps to ensure quality listings.

Expect the Unexpected

The EatonWeb directory charges a review fee, but blogger BEWARE!

paypal

The other day I had an email out-of-the-blue from PayPal saying I’d made an automatic payment for a subscription I’d set-up.  First I thought it was just SPAM.

I didn’t recall ever setting up a subscription using PayPal, but reading the invoice from PayPal, it turns out that I had been duped into signing up to a recurring annual subscription fee to EatonWeb blog directory, when at the time I assumed it was a one-off fee to list my blog!

What’s even worse is the fact I never got my blog listed!

Looking at the EatonWeb submission page (below), it’s not very clear that you are signing up to a recurring annual subscription either, or whether you pay the annual subscription whether they list you or not.

eaton-web

There are no website terms and conditions and after emailing EatonWeb about this issue I’ve had no reply whatsoever, so I thought I write this post to alert other bloggers to this dodgy practice.

My advice is to avoid The EatonWeb blog directory!

SEO: Ten Link Building Recommendations

A major and time-consuming part of search engine optimisation (SEO) is link building.  If you own a website of any sort, you’ve undoubtedly received SPAM emails from dubious companies offering to provide you with SEO services.

Assuming you decide to outsource your SEO activities and you’ve chosen a reputable company to provide this service (preferably one that hasn’t spammed you), how do you ensure the link building effort will pay off and give you greater prominence in the top search engines?web

Here’s a list of ten link building recommendations.

  1. Only get links from similar themed organisations and websites
  2. Make the anchor text of the link relevant to the landing page and different on each link obtained. E.g. don’t use your website name as the link text all the time
  3. Try to get deep links into your website, not just to your homepage
  4. Favour text links over image links
  5. Avoid getting links on purpose built 'link' pages
  6. Avoid reciprocal link schemes
  7. Avoid black hat techniques such as obtaining hidden links, links from sites built specifically for gaining PageRank
  8. Favour links with decent PageRank
  9. Links having rel="nofollow" do not count towards inbound links
  10. Make sure pages that contain your link aren’t excluded via robots.txt or robots meta tags
  11. Avoid links which look like they have been bought, as Google can penalise these

 

Thanks to Adam for his helping putting this list together.  Image used under Creative Commons by saintbob.

EAVB_BSNMKXEWNF

Creating an Immediacy (Alterian Content Manager) Plug-in

An Immediacy plug-in is a special type of ASP.NET User Control that allows you to extend the functionality of the core content management system. http://www.immediacy.net/

Follow these instructions to create a custom plug-in for the Immediacy/CMC CMS.

Instructions

Create a new directory within the Immediacy plug-ins directory for your plug-in. This new directory will hold the .ascx file for your user control plus your Immediacy editor dialogue UI (Which is a special web file that allows you to change the plug-in settings from within the Immediacy editor).

The name of your plug-in directory should have the same name as the “tagName” you use to register the User Control in Immediacy’s web.config file.

Build your ASP.NET User Control to perform your custom functionality making sure that you create public properties in your C#/VB.NET code for all the properties you would like configurable from within the Immediacy editor.

Add a reference to the Immediacy.Web assembly to your project.

Next, add these attributes to your User Control class.

[PluginDesigner(PluginDesignerType.Html, "PluginCmsDialogue.aspx", Height = 400, Width = 400)]
[ToolboxData("<{0}:PluginName runat=server></{0}:PluginName>")]
[PluginInfo("My First Plug-in", "CMS Plug-in Category", Description = "Description of my Plug-in")]
public partial class Comments : System.Web.UI.UserControl, INamingContainer
{
    // Your plug-in code here
}

If you don’t add these class attributes your plug-in properties will not be configurable from within Immediacy, but the plug-in will still work.
If you don’t have public properties that you want editors to be able to change you can skip creating a dialogue box for your plug-in.

Create an Editor Dialogue Pop-up

Create a CMS dialogue page which will allow Immediacy users to change the properties of your custom plug-in from within the editor. The name of this file is referenced in the class attributes above (e.g. PluginCmsDialogue.aspx) .

Your dialogue box can be either an HTML file with JavaScript or an ASP.NET web form. This example uses an HTML page with a .aspx extension, although it doesn’t contain any server-side code. 

In the HTML you need to reference the Helpers.js JavaScript file that resides in the Immediacy plug-ins folder.

<script type="text/javascript" src="../Helpers.js"></script>

Create a simple HTML form with form elements to match each public property of your plug-in class.

Add two HTML buttons, one for OK, one for Cancel. Give them IDs of ok and cancel respectively.

Create a JavaScript function called Init() as below.

<script type="text/javascript">
var Dialog;

function Init()
{
   Dialog=new DialogObject("name of plugin", 400, 400); Dialog.UniqueKeys=false;

   // Load each property and update the dialogue box
   Dialog.Load("property", function(value){document.getElementById("property").value=value;});

   // Add functionality to the OK and Cancel HTML buttons
   document.getElementById("ok").onclick=function(){Dialog.Ok();}
   document.getElementById("cancel").onclick=function(){Dialog.Cancel();}

   Dialog.Valid=function()
   {
     
// Perform validation here
      return true;
   }

   Dialog.Submit=function()
   {
     
// Save each property
      Dialog.Save("property",document.getElementById("property ").value);

      // Update the Immediacy control UI placeholder
      Dialog.InnerHTML="<div style='background:#DDDDDD; color:#000000; float:left; padding:10px; clear:both;'><strong>Comments Enabled : </strong>Status of Plug-in</div>";
   }
}
</script>

At the bottom of your dialogue HTML call the Init() function as below.

<script type="text/javascript">Init();</script>

Install the Plug-in

Register your ASP.NET User Control to Immediacy’s web.config under <pages><controls> as you would with an ordinary User Control. Ensure the “tagName” is the same as the plugin directory name for your plugin.

<add tagPrefix="MyUserControls" tagName="PluginName" src="~/plugins/ PluginName /test.ascx"/>

Build your project in Visual Studio.

Copy the .ascx and your dialogue box HTML file to the /plugins/PluginName folder.

Copy the .dll file to the Immediacy bin folder.

Configuring FTP for Windows Server 2008

Setting up FTP on Windows Server 2008 isn’t as easy as in previous versions and the steps you need to take vary depending on what version of IIS you have installed.

Unless you upgrade to IIS 7.5, FTP in IIS 7 is still managed with IIS 6 Manager!

FTP configuration in IIS 7

Failed to Retrieve Directory Listing

The first hurdle I encountered when trying to connect using Filezilla was the error message “Failed to Retrieve Directory Listing”.  Filezilla was able to connect but couldn’t list the files in the remote folder.

A work around to this is to run Filezilla in active mode (Edit > Settings > Connection > FTP > Active), but some programs that use FTP such as Windows Live Writer can’t be set to use active and prefer passive FTP.  Read more about active and passive FTP.

Configuring Passive FTP on IIS

Configuring Passive FTP on IIS essentially involves configuring FTP port ranges in IIS for the passive connection and then opening up those ports in Windows Firewall on the server.

Depending on what version of IIS you have installed I can verify that both of these methods work.  Although the c:\Inetpub\adminiscripts folder didn’t exist on my server so I ended up getting them from a Windows Server 2003 machine.

My advice would be to upgrade to IIS 7.5.

Where’s the POP3 Service in Windows Server 2008?

I’ve recently upgraded my virtual server to a Windows Server 2008 box and to my annoyance noticed that Microsoft have removed the POP3 Service that shipped with Windows Server 2003.

I know that POP3 is old and a bit rubbish, but it was perfect for my purposes.

Rather than shell out for a commercial mail server I suggest you try the free hMailServer which is a doddle to install and configure and in my opinion far better than Microsoft’s POP3 Service.

hMailServer

I’m using it for my POP3 and SMTP server.

Read more about hMailServer’s features which include SPAM filter and virus scanner integration and pre-configured authentication and relaying security.

HomePlug Networking Incompatibilities

It seems HomePlug certified powerline networking components aren't as interoperable as it would first appear.  I've been using Devolo Homeplug dLAN 200 desk units for a number of years now and they have been trouble free and constantly out perform wireless networking in terms of speed.  I recently bought another Devolo dLAN 200 unit to expand my network to enable streaming video to a Windows Media Extender.

I assumed it would be a case of just connecting it to the mains and using the Devolo dLAN configuration wizard to set all the units up with a new encryped password.  I soon realised that this wasn't the case.
The dLAN configuration wizard didn't even detect the new unit on the mains network.  After looking through the manual for a while scatching my head searching for a non-existant troubleshooting guide, I spotted a paragraph that mentioned that older Devolo products using firmware 1.x need their firmware upgraded in order to work with newer models.

Upgrading the firmware has now made all my dLAN 200 HomePlug certified devices compatible!  Thank God for standards Smile

Installing Hardware RAID on Windows 7

Like a lot of Windows fans I pre-ordered Windows 7 and built a new PC ready to install it on; I chose a motherboard (MSI DKA790GX) that, like many on the market, has a hardware RAID controller on-board allowing you to take advantage of redundancy with RAID 1 and/or benefit from faster disk access with RAID 0.  Read more about RAID.

I had already installed Windows 7 before I remembered I wanted to set-up a RAID 1 array.  I tried to get the RAID array working with Windows already installed but soon realised I would have to set it up prior to installing Windows 7 because Windows kept hanging on boot-up because it was lacking the RAID controller drivers.

The supplied manual doesn’t explain how to get RAID up and running unfortunately.

RAID Controller Set-up

So here’s a quick guide to installing hardware RAID on a motherboard that features a RAID controller.  These steps assume you are performing a clean Windows 7 install rather than an upgrade, and they might differ depending on your system set-up, but the general principles should be the same.

  1. Download the RAID drivers for your motherboard from the manufacturer’s website and save them to a memory stick.
  2. Back up all your important data!
  3. Turn your PC off and unplug it.
  4. Install 2 hard disks preferably with identically capacity into your PC.
  5. Turn on your PC, press the delete key or F2 key when prompted to get to the BIOS menu.
  6. Find the option to select the RAID mode, save your settings and exit BIOS.BIOS RAID options
  7. On reboot you should see a new menu option to enter the RAID controller settings.  Enter the key combination when prompted to get to the RAID controller menu. AMD RAID controller menu
  8. Create a new RAID array selecting either RAID 0, or RAID 1.
  9. Select the disks that will form the array, save the settings and exit.
  10. On reboot press the delete key or F2 key when prompted to get to the BIOS menu.
  11. Check the boot sequence of your PC and ensure your optical drive is top of the list.BIOS boot sequence options
  12. Insert your Windows 7 disk into the optical drive and exit the BIOS.
  13. On reboot press any key when prompted to boot from the optical drive.
  14. Windows 7 should start installing.
  15. Select your localisation settings and click next.Windows 7 localization menu
  16. Click “repair your computer” and click the ”load drivers” button.Windows 7 install menu Windows 7 load drivers menu
  17. Insert your memory stick and browse to the correct driver and install.
  18. Exit back to the Windows 7 install menu click “Install now” and on the next screen click “Custom (advanced)” to perform a clean install.install-windows-custom
  19. When you are asked where you want to install Windows 7 you should see that the 2 RAID hard disks are now visible as just 1 drive.
  20. Add a partition to the new drive so Windows with be able to recognise it.
  21. Continue installing Windows as normal.

IE6 – Why Web Developers Should Support the Browser

There seems to be so much fuss surrounding support for aging Microsoft browser Internet Explorer 6 lately, both from the web developer community and big corporations such as Google and Facebook. There are many websites dedicated to eradicating the browser, a Twitter petition, a joke campaign to save IE6 and a whole lot more…

While I don’t particularly enjoy spending a considerable amount of time per project making sure websites I build are IE6 compatible, I do see the benefit of supporting the browser.

I was in Google Analytics recently and looked at my browser statistics for this site.  Visitors to my site are fairly IT literate but Internet Explorer 6 still has a larger user base than Safari, Chrome and Opera with almost 9% share. Looking on the W3C Schools browser statistics, 12.1% of their users browsed the web with IE6 in September 2009.

NikMakris.com Web browser market share Sept 2009

Web browser market share

NikMakris.com Internet Explorer browser share Sept 2009

Internet Explorer browser versions

I could make the decision not to support IE6 for my personal site and about 9% of my visitors would be affected, but if I made that decision on a commercial website, I could end up losing out on business, especially since many of the people still actively using IE6 are businesses or public sector organisations who can’t easily upgrade or install an alternative web browser.
Many organisations also have legacy applications that do not work with new versions of Internet Explorer and during a recession many organisations will avoid spending money on upgrades and new software if they can afford not to.

Whilst it might be okay for Google and Facebook to block support for the browser when you visit their own web properties, would a client of yours be happy if you did the same with a website you built, potentially losing them business?

Internet Explorer 6 may be a dog of a browser in 2009, if you’re a web developer it probably causes you hours of pain creating dedicated style sheets and conditional statements.  You may even have had to make major template changes to deal with the many quirks of the browser rendering engine, but hopefully in the not too distant future it will become such a small percentage of the web browser market that we can all forget about it and start concentrating on new technologies such as HTML 5!