Instructions

1) Setup the database. Database instructions are in the Database folder of the scenario.

2) Install certificates. There are 2 certificates of interest in the ToolsAndInstructions folder. They are;

	server.pfx - install to LOCAL MACHINE\Personal
	testca.cer - install to Local MACHINE\Trusted Cert Roots

any passwords for certificates will be "password".

3) Use IIS admin to create a virtual directory. Put it on your default web site and call it NuggetDemo, point it at your equivalent of c:\demo\VRoot

4) Again, with IIS admin make sure that the secure subdirectory of the VRoot you just created requires SSL (no authentication, just SSL). You can choose to ignore client certs if you like.

	Note: You'll need a certificate for your web server to do this.
	You should be able to use the "localhost" certificate that you added
	in 7.

5) Open the Visual Studio Solution File (it's in the root folder of the bits you pulled from sourcesafe).

6) Rebuild all.

Note: One of the projects is a Windows Service (an NT Service). It's called WorkflowHostService. I need to use installutil.exe to install this first time around and so I run this as a custom build step at the end of the project. You will get a dialog asking for credentials. These are the credentials that you want to run this service as.

7) There is a WCF service inside of the Windows Service that use SSL and it is configured to listen on port 9090. This means that you also need to set up port 9090 for SSL traffic. This can be done with the HTTPCFG.EXE tool (I've put it into the Tools folder). You need to do;

	httpcfg.exe set ssl -i 0.0.0.0:9090 -h [INSERT CERT HASH HERE]

And you need to provide the thumbprint of a certificate to use for the SSL - I think it needs to come from your Local Machine\Personal store and it needs to be good for server authentication. 

8) Communication between the "public facing" web service that IIS hosts and the internal one that WindowsWorkflowHost hosts is done through MSMQ and it's a private queue right now so you need to create a private MSMQ queue called;

	postednuggetqueue

9) You need to set up a mail server for the email. Configuration for the mail server should be;

a) Local domain name of;

	localmail.com

b) Add accounts to it. Right now these need to be;

	claire		claire@localmail.com
	fabrice		fabrice@localmail.com
	mike		mike@localmail.com
	mikeo		mikeo@localmail.com
	marcus		marcus@localmail.com
	martin		martin@localmail.com

You don't need all of them but you need claire/fabrice and one of the "submitters".

c) Configure Outlook so that it will open these alternate mailboxes. Go to control panel and mail and configure additional profiles in there. I think you need a new profile for each user so I have added to mine;

	claire
	fabrice
	mike

And they each point to 127.0.0.1 for SMTP and POP and they use the account names, passwords and email addresses that you set up in (c) above.

10) The Workflow is configured to use the SqlTrackingService. Read the Workflow documentation for how to install this - it involves creating a database called tracking using the scripts that the Workflow Foundation provides - search for "Workflow Monitor" in the documentation.

11) Test. 

a) Test the rss feeds. URLs work like this;

	http://localhost/NuggetDemo/Rss.ashx?query=topics

and from there you should be able to find feeds for a specific topic and follow it through. Note that without Nugget videos in the

	//localhost/NuggetDemo/nuggets/published

folder you won't necessarily be able to do anything.

b) Test the web service for access. In the folder;

	TestHarnesses

there is a console app called AccessServiceTestConsoleApp which you can run to query what nugget videos are available.

c) Test the publication service for access. In the folder;

	TestHarnesses

there is a windows forms app that lets you pick a video and upload it. When the upload completes the workflow will run and will send a mail to approvers (claire) so check claire's inbox at that point.

Then, again, in the folder called;

	TestHarnesses

there is a console application called TestApprovalConsoleApp. You can run this and pretend to be claire (with password) and approve the nugget. The workflow will then mail fabrice. You can now pretend to be fabrice and publish the nugget and the workflow will mail you and fabrice at that point.

That's it. Have trouble? Attach your debugger to the relevant process (it'll usually be either aspnet_wp.exe or WorkflowServiceHost.exe) and see if you can get it to trap the exception.

Remember;

	net stop "Nugget Demo Workflow Host" 

is your friend here :-)
