Wednesday, July 25, 2007

Sitecore Search Engine Optimization (SEO) Module

well, alongside with the previous post this to is simply a heads-up reference to another (pre-)release that quietly got published yesterday: Sitecore SEO Toolkit (Search Engine Optimization module). SEO is quite the buzz and as hot as ever so a module like this comes really handy for people i'm sure. do note that it's a preview release and expires january 1st, 2008.. but hey, that still gives you quite some time to have a go at it and provide them with feedback :) More details: http://sdn5.sitecore.net/Resources/Free%20Modules/Seo%20Toolkit.aspx Documentation: http://sdn5.sitecore.net/Resources/Free%20Modules/Seo%20Toolkit/Documentation.aspx Thanks for a very useful add-on! Regards, P.

Tuesday, July 24, 2007

Sitecore Wizard Module

a while ago i wrote a small tutorial detailing how to create your own sitecore wizard, some might have read it and used it, some not. that doesn't really matter anymore since sitecore has as of yesterday released their Sitecore Wizard Module which does a brilliant job at explaining it. as a module it's a bit unlike all the others since it doesn't really do anything but help you understand the structure of sitecore wizards, but it's great at that and i strongly suggest you read the -really good- admin guide and install it. in the Admin guide you'll find pretty much everything you ever wanted to know about Sitecore Wizards - and a lot more as well. oh, and by the way: it's even Sitecore Starter Kit Plug and Play! great job by Sitecore and Kerry Bellerose - this will surely help a lot of people! Go check it out: http://sdn5.sitecore.net/resources/free%20modules/wizard.aspx Also, don't forget to check out the Extranet Module, another useful add-on available for you to grab & use. Further reading: http://kerrybellerose.blogspot.com/2007/07/bringing-wizards-to-desktop.html Regards, P.

Thursday, July 12, 2007

Christmas in February?

Microsoft has announced that Windows Server 2008, SQL Server 2008 & Visual Studio 2008 are all gonna be released on the 27th of February 2008.. can't wait :) further reading: Johan Lindfors (SWE): http://blogs.msdn.com/johanl/archive/2007/07/11/lanseringsdatum-annonserade.aspx Kevin Turner (ENG): http://www.microsoft.com/presspass/press/2007/jul07/07-10WPCDay1PartnersPR.mspx P.

Thursday, July 05, 2007

Tutorial: Restore from Archive functionality

this post applies to Sitecore v5.3.1

the archive database in sitecore is a feature that's easily missed and not taken full advantage of. how it can work best for you and your solution i'll leave to you to decide, but there is one thing you might get frustrated at, and that's the fact that there's no real Restore functionality available from the content editor.. well, that is, until now :)



Follow these steps and you'll have your very own Restore Now functionality for the archive.

we're gonna:
  • Create a new command that will handle the restore functionality
  • Add the command to the config
  • Add a button to the Archive menu that will allow us to trigger the new command

step 1: creating the code for the command

Create a new C# class and name it ArchiveRestoreCommand

add this code:

using System;
using System.Collections.Generic;
using System.Text;
using Sitecore;
using Sitecore.Configuration;
using Sitecore.Data;
using Sitecore.Data.Archiving;
using Sitecore.Shell;
using Sitecore.Shell.Framework;
using Sitecore.Shell.Framework.Commands;
using Sitecore.SecurityModel;
using Sitecore.Tasks;
namespace usoniandream.extensions
{
[Serializable]
public class
ArchiveRestoreCommand : Command
{
public
ArchiveRestoreCommand()
{
}
public override void Execute(CommandContext context)
{
// make sure we only run this if we're in the archive database..
if
(Sitecore.Context.ContentDatabase==Sitecore.Configuration.Factory.GetDatabase("archive"))
{
//
disable security to allow restoration of item..
using (SecurityDisabler disabler = new SecurityDisabler())
{
// find archive item submitted
ArchiveItem archiveItem =
Sitecore.Context.ContentDatabase.GetItem(ID.Parse(context.Parameters[0]));
if
(archiveItem != null)
{
// reassure the archive is correct..
Sitecore.Data.Archiving.Archive archive = archiveItem.Archive;
if (archive!=null)
{
// restore item from the archive without removing it from the archive.. (change 'false' to 'true' to remove it)
archive.RestoreItem(archiveItem, false);
// broadcast success information..
Context.ClientPage.ClientResponse.Alert("Item restored.");
}
}
}
}
else
{
// broadcast informative error for not being in the correct database..
Context.ClientPage.ClientResponse.Alert("Restoring an item can only be done from the archive database.");
}
}
public override CommandState QueryState(CommandContext context)
{
// only show this action if we're actually in the archive database
if (Sitecore.Context.Database.Name!="archive")
{
return CommandState.Hidden;
}
return base.QueryState(context);
}
protected void Run(Sitecore.Web.UI.Sheer.ClientPipelineArgs args)
{
}
}
}


Step 2: Add the command

compile the newly created code and open the App_Config\commands.config file and add the following line to it:

<command name="item:restore" type="usoniandream.extensions.ArchiveRestoreCommand,usoniandream.extensions"/>

Step 3: Customizing the Sitecore archive menu

so, now that the above is all taken care of, go into Sitecore and switch to the Core database, then:

  • Navigate to Sitecore\Content\Globals\Archives Menu
  • Duplicate the Archive Now item and name the new one Restore Now
  • Change the appropriate texts.. nice icon would be Network\16x16\server_out.png
  • Change the click to item:restore(id=$Target)
  • Save!

Hope you'll find this useful, next archive addition will hopefully be more useful, like a Preview or something..

Take care,

P.

Sunday, July 01, 2007

WPF Showcase

I'm quite impressed by the Family.Show application written by the team at at Vertigo. it's cool, clever and uses a lot of the neat things you'll love in WPF like templates, resources, animations, bindings and a lot more. furthermore the code is really well documented and well written, so for anyone that want's to learn more about it it's a good application to check out. Family.Show info: http://www.vertigo.com/familyshow.aspx Family.Show source: http://www.vertigo.com/downloads/familyshow/FamilyShowSource.zip P.

Debugging ASP.NET in IIS 7.0

Yeah, i know the posts have been short and not-so-frequent for a while now, sorry about that. guess one reason would be that i can barely use my right arm at the moment (long & quite funny story). another reason is that there's a lot going on at the moment, but i'll get back into posting-mode in the near future. If you're developing on Vista and debugging your ASP.NET applications that run on IIS 7.0 you've either had this problem a lot, or you'll soon run into it. Without going into the details of it all i'll just say that once again it's Scott Guthrie to the rescue :) Read more: Scott Guthrie on Public Hotfix Patch Available for Debugging ASP.NET on IIS7 if you've had problems debugging on Vista / IIS 7.0, read that post. P.