Wednesday, April 22, 2009

Installing Contribute Publishing Services on Windows Server 2008

We use Adobe Contribute to edit/manage our web site at work. We’re also steadily moving to Windows Server 2008. I was thus a bit disappointed to see that when I tried to install CPS on Windows Server 2008, it just sat there – trying to install, but in fact doing nothing at all. Being a) stubborn and b) probably stupid (let’s face it, Contribute is dead), I was able to bring it up by copying an existing installation from Windows Server 2003 and then registering the services appropriately. Here’s what I did (your paths and server names will vary). In this example, WEBSTAGE is the old Windows Server 2003 box and WEBSTAGE08 is the new Windows Server 2008 box.

  1. Copied C:\Program Files\Macromedia\Contribute Publishing Services from WEBSTAGE to WEBSTAGE08.
  2. From the Command Prompt, created the CPS service (note space after “binPath=” – important and annoying to miss)
    sc.exe create CPS binPath= ”C:\Program Files\Macromedia\Contribute Publishing Services\jrun4\bin\jrunsvc.exe”
  3. Exported HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\Macromedia Contribute Publishing Server from WEBSTAGE to CPS1.reg.
  4. Exported HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CPS from WEBSTAGE to CPS2.reg.
  5. Edited CPS2.reg and removed the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CPS\Security and HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CPS\Enum sections.
  6. Imported CPS1.reg and CPS2.reg on WEBSTAGE08.
  7. Started the Macromedia Contribute Publishing Server service on WEBSTAGE08.
  8. Added firewall exception to allow access to all ports opened by C:\Program Files\Macromedia\Contribute Publishing Services\jrun4\bin\jrun.exe.
  9. Opened https://webstage08:8900/contribute/admin/server.cfm.
  10. Logged in with old admin password and changed to new admin password.
  11. Switched to Website Settings panel and deleted webstage website.
  12. Launched Contribute CS3, created a new connection to WEBSTAGE08 and added https://webstage08:8900/contribute as the publishing server.

That’s it. Can’t believe it worked, really.

Monday, April 13, 2009

A DSL for IoC Configuration

Just kind of thinking out loud here... Seems like a fantastic use for an M grammar! Hmm...

// Include file from assembly resource
include res://CWS.SoCHelp.NHibernate/Basic.config

// Include file from C: drive
include file:///C:/Users/sherwooda/Documents/Visual%20Studio%202008/Projects/CWS.SoCHelp.Tests/Extended.config

// Include file relative to executable
include file://~/Fluent.config

// Declare aliases for namespaces and assemblies
alias SoCHelp (CWS.SoCHelp, CWS.SoCHelp);
alias NHibernate (CWS.SoCHelp, CWS.SoCHelp.NHibernate);
alias Tests (CWS.SoCHelp.Tests, CWS.SoCHelp.Tests);

// Basic configuration, map service to type, default to "singleton" with no name
SoCHelp:IUnitOfWorkFactory -> NHibernate:NHibernateUnitOfWorkFactory;

// Map open generic with transient instance and no name
SoCHelp:IRepository`1 -> NHibernate:NHibernateRepository`1 transient;

// Don't use aliases, map exact type specified
"CWS.SoCHelp.IUnitOfWorkFactory, CWS.SoCHelp" ->
"CWS.SoCHelp.NHibernate.NHibernateUnitOfWorkFactory, CWS.SoCHelp.NHibernate" singleton;

// Specify an identifier for a service
$Command = Tests:ICommand -> Tests:Command singleton;

// Map specialized generic
$UserRepo = SoCHelp:IRepository`1[[Tests:User]] -> Tests:UserRepository transient;

// Parameters specified
$RedBookFinanceRetriever = Tests:IRetriever -> Tests:HttpRetriever singleton
{
url = "http://www.megacorp.com/financials/redbook.csv";
timeout = 3000;
}

$BlueBookFinanceRetriever = Tests:IRetriever -> Tests:HttpRetriever singleton
{
url = "http://www.megacorp.com/financials/bluebook.csv";
timeout = 3000;
}

// Refer a dependency to a previously created component
$ExternalFinancialProcessor = Tests:IProcessor -> Tests:AuditProcessor
{
retriever = $BlueBookFinanceRetriever;
}

$InternalFinancialProcessor = Tests:IProcessor -> Tests:AuditProcessor
{
retriever = $RedBookFinanceRetriever;
}

// Declare a bunch of commands
$JumpRope = Tests:ICommand -> Tests:JumpRope;
$PickUpSticks = Tests:ICommand -> Tests:PickUpSticks;
$Honk = Tests:ICommand -> Tests:Honk;

// Pass an array of components to a dependency
Tests:IProcessor -> Tests:CommandProcessor
{
commands = [$JumpRope, $PickUpSticks, $Honk];
}