March 2008 Entries

The EPiCloud module that I've been working on for a while is finally ready for release! Due to the EPiServer preferred module naming policy (no EPi.... please!) we had a few thoughts around the office here and one of my colleagues, Alan Bartlett, came up with CloudCuckoo. The name appealed to me because it was rather different and also has mild amusement value. The best part is this though - I have obtained clearance to release the module for FREE on EPiCode!

The module and sourcecode is available on EPiCode here.

I also finished off the tag moderation part of the plugin, which can be seen on the screenshot below:

There's a few more things that might be nice to add, but for now it's good to get version 1.0 out there and let people start to play with it. If you decide to evaluate/use it and have any feedback at all please let me know.


Bookmark with :
Digg It! DZone StumbleUpon Technorati Reddit Del.icio.us Newsvine Furl Blinklist

I've just spent the last few days in a Commerce Server 2007 training course, which was surprisingly interesting. One of the things that leapt out at me was that there are a couple of partners who have worked with Commerce Server 2002 and EPiServer together. It's something that has interested me too and I see even more possibilities with Commerce Server 2007. Hmm...

As soon as I got back I got busy getting EPiCloud release ready (and thinking of a nice name for it). In doing that I came across this old error again: "The trust relationship between the primary domain and the trusted domain failed".

You may remember my blog about it a while ago, but that was a slightly different scenario. Then I was on my corporate network and getting SQL/Windows authorisations muddled up. This time I was working on my laptop at home. Turns out that EPiServer v5 was trying to resolve a SID against the domain controller, and as I was disconnected at the time it failed. Even connecting to my work VPN didn't help. I even tried logging on locally to my laptop and it was failing. Every time it would throw the error and according to the stack trace it was when it was trying to resolve the VPPs, although I'm not sure how right that was.

Ultimately, the only thing that worked was to temporarily drop my laptop off the domain and onto a workgroup. I then changed all my authorisations to SQL just to check and re-added it to the domain. It promptly broke again, as I expected, so I once more dropped it off the domain.

On Tuesday once I'm back in the office I'll grab a VPC which isn't on a domain and continue my development on there. That should get around the problem of having to mess around the domains on my laptop!


Bookmark with :
Digg It! DZone StumbleUpon Technorati Reddit Del.icio.us Newsvine Furl Blinklist

I've updated the B&D EPiLabs site with an updated version of the EPiCloud module. I've added the following features:

  • The top tags are now placed in a META tag and also as a tooltip on the tag entry (this is for SEO)
  • When a new tag is added the top tags for that page are placed in a page property and saved
  • The tag page property is created dynamically if needed
  • The cloud now shows hyperlinks which, when clicked, go to the search page and search for that tag
  • The admin plugin has been 'hooked in' (see screenshot)
  • Plugin saves settings using PlugInSettings

Features to include now are:

  • Deployment of malicious protection validators
  • Admin plugin validators (integer length etc)
  • Packaging into server controls
  • A 'default styling' option so that a CSS change is not necessary
  • Moderation administration

If there's any more features you think could be useful, let me know!


Bookmark with :
Digg It! DZone StumbleUpon Technorati Reddit Del.icio.us Newsvine Furl Blinklist

While working on my EPiCloud module I came across a snag where I wanted to update page properties (definitions) from code without republishing the page. The page property I'm updating is going to change frequently and I didn't fancy having pages of versions which would be confusing for editors.

After having a play with 'traditional' page editing and publishing in code I was drawing a blank and was toying with the idea of calling the SQL stored procedures for editing properties, although I didn't want to go there! Before trying to go further I posed my problem to the #epicode IRC channel (see here for details - come and join in the discussion!). One of the guys on there, Astinus-, suggested I look at the SaveAction.ForceCurrentVersion enumeration option on the Save method when saving a page. For some reason I must have seen that option many times without actually noticing it.

Unfortunately the SaveAction enumeration isn't really documented that well. In fact, if you look at the SDK entry for the Save method then you'll see that EPiServer themselves tell you that it's there to use but undocumented. If you try to use it you might notice that it doesn't do an awful lot, you might get a read-only error when you change anything, or you might get an error about an INSERT failing. This is because the following all have to be true:

  • You must be working on a version with a version ID from an existing page
  • You must be working on a writable clone
  • You must combine the ForceCurrentVersion with either a Save or Publish action

The following code snippet amends a property on the published version of the current page and saves it as published without a republish (CMS version 5):

   1: PageVersion oPublishedVersion = PageVersion.LoadPublishedVersion(CurrentPage.PageLink);
   2:  
   3: PageData oThisPage = DataFactory.Instance.GetPage(oPublishedVersion.ID);
   4:  
   5: PageData oWritablePage = oThisPage.CreateWritableClone();
   6:  
   7: oWritablePage.Property["SomeProperty"].Value = "Value to set";
   8:  
   9: DataFactory.Instance.Save(oWritablePage, SaveAction.ForceCurrentVersion | SaveAction.Publish, EPiServer.Security.AccessLevel.NoAccess);


I hope this code is useful to someone - but be aware that we are doing a couple of sneaky things such as using AccessLevel.NoAccess. Use my code carefully!


Bookmark with :
Digg It! DZone StumbleUpon Technorati Reddit Del.icio.us Newsvine Furl Blinklist

We've been doing some R&D on funky plugins for EPiServer and decided that we'd show you guys what we're up to. Have a look at our new EPiServer labs site:

B&D EPiServer Labs

Our tag cloud module 'EPiCloud' is the first module I've put on there. (At the moment I've only put the cloud control on the section homepages (News/Events etc) but any page on the site can be tagged.) It already supports features such as:

  • Culture awareness
  • Tag quantity limiting
  • Ability to show tags for page, children or both
  • Moderator approval

 We're looking to expand on this with some features such as:

  • Tag links
  • Edit-mode approval plugin
  • Server controls
  • Single-assembly release

Once we've got it to a release-ready state we'll be thinking about how to release it to the community. We might put it on EPiCode for free or for a fee, or might just embed a link to B&D and then distribute the module as closed source. We'll see... but if you have an interest in using the module then let me know and we'll have a think about the best distribution model for it.


Bookmark with :
Digg It! DZone StumbleUpon Technorati Reddit Del.icio.us Newsvine Furl Blinklist

An EPiServer frustration for me is not being able to grab a 'deep' tree as a PageDataCollection. Sometimes I want to be able to iterate through a collection of all descendants of a page.

Ideally I'd want to do a GetChildren with a 'deep' boolean parameter or something, but there isn't one. Trying to use FindPagesWithCriteria is frustrating as if you enter no Criteria then it returns nothing.

For now, I've just hacked it with the following code. It works, but I hate it. If you have a better solution please let me know. And yes, I know that I could iterate through GetChildren but that would be lots and lots of separate API calls and I really don't want to take that hit. I want a one-time API hit.

   1: PropertyCriteriaCollection oColl = new PropertyCriteriaCollection();
   2: PropertyCriteria oCrit = new PropertyCriteria();
   3:  
   4: oCrit.Condition = EPiServer.Filters.CompareCondition.GreaterThan;
   5: oCrit.Name = "PageStartPublish";
   6: oCrit.Value = DateTime.Parse("1/1/1900").ToString();
   7: oCrit.Type = PropertyDataType.Date;
   8:  
   9: oColl.Add(oCrit);
  10:  
  11: PageDataCollection oChildPages = DataFactory.Instance.FindPagesWithCriteria(oPageData.PageLink, oColl);



Bookmark with :
Digg It! DZone StumbleUpon Technorati Reddit Del.icio.us Newsvine Furl Blinklist