Showing posts with label plugins. Show all posts
Showing posts with label plugins. Show all posts

Thursday, September 21, 2006

EditX - Get it while it's hot!

A new version of EditX was released today by the EPiServer Research guys. If you haven't heard of EditX before, it is a new cross-browser edit mode for EPiServer that works in FireFox and IE.

The latest update includes the ability to preview before save, add internal links to pages in the editor (FCKeditor) and has a new tab for editing dynamic properties in the page edit screen.

Some of the features I like the best so far are usability enhancements more than anything. For example when you hover over the create new page option in the menu, a list of templates drops out for you to select, rather than having to load a new page listing the templates.

One big improvement is the implementation of the FCKeditor control. While it is not fully integrated into EPiServer, it now allows the selection of internal pages when inserting links and files. The standard editor in EPiServer is good, but just lacks the polish of the FCKeditor and has a number of issues to do with the HTML generated.

The module is not feature complete, but is at a stage where it is quite usable. Hopefully some of the stuff in this module will end up in a future version of the product. Here's a couple of screenshots, IE 7 vs FireFox.

EditX in IE 7
[EditX in IE 7]
EditX in FireFox
[EditX in FireFox 1.5]

So what are you waiting for? Why are you still reading this, go download it and have a play!

Tuesday, August 22, 2006

Advanced delete with link cleanup

A common question I get asked when demonstrating EPiServer to potential clients is:

How does EPiServer handle links when deleting a page? Does EPiServer clean up potential broken links?

With the standard EPiServer delete function there is no link cleanup, which means you can easily end up with broken links. Now this is something that I thought would be easy in EPiServer, as the standard function even tells you what the linked pages are when you try to delete. So, why is there no ability to clean up the links before delete? Answer, I don't know, but maybe it will be coming in a future version :)

The standard delete function
[The standard delete function]

Well I want it now! So this is the driver behind my want to create an advanced delete function, that gives the user the ability to clean up links before a page is deleted.

I have started work on a prototype, and it's working quite well so far. My delete page plugs into EPiServer using the "alternate files" function (a function that allows you to implement your own version of an admin or edit mode function). This means my advanced delete overrides the standard delete and is available through the standard menus.

If a link to the selected page is detected, then some options are supplied to either remove the links or replace the links. And for the web admins out there, I have added an option so you can force the user to clean up all links, before the page can be deleted (you know you want the power).

Here are a couple of screenshots from my current prototype:

Standard delete menus
[The standard delete menu activating the advanced delete function]
My new advanced delete function
[The advanced delete function with force link cleanup enabled]

It works okay at the moment but there are a few things I'd like to improve on, such as
  1. Better detection of linked pages (works well at the moment but a little problem with caching in EPiServer maybe?).
  2. Add override function for site Administrators.
  3. Better access denied handling for when users try to cleanup links on a page they don't have access to.
Anyway, I have added the prototype to EPiCode so if your not already registered, then go register now and download a copy today! Also, if you think of other things that could improve it, then add a comment or add a ticket in EPiCode.

Friday, August 18, 2006

Tell me when my scheduled jobs fail - Part II

Not long ago I posted about writing an EPiServer scheduled job that notifies me when scheduled jobs fail. I created a prototype, which works well, but is flawed in that if all scheduled jobs are failing (including my notifier), then I won't know about it. So as a result I started thinking of other ways this could be done.

In my thinking I came up with two other possibilities. The first thought is to use log4Net, and the other is to create a Windows Service.

Using log4Net
Using log4Net is probably the best solution for this sort of thing as it's already part of all EPiServer sites, and to setup notification of errors is just a configuration task. By implementing an SmtpAppender and a logger on the EPiServer.DataAbstraction.ScheduledJob namespace, you can quickly and easily setup email notifications about scheduled job failures.

Here's a sample section from the config file that I got working in my sample site:

<appender name="SmtpAppender" type="log4net.Appender.SmtpAppender">
<to value="errors@domain.com"/>
<from value="errors@domain.com"/>
<subject value="Error encountered in EPiServer461 scheduled job" />
<smtpHost value="127.0.0.1" />
<bufferSize value="512" />
<lossy value="false" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%d\t%X{siteid}\t%m%n" />
</layout>
</appender>

<logger name="EPiServer.DataAbstraction.ScheduledJob">
<level value="ERROR" />
<appender-ref ref="SmtpAppender" />
</logger>


Using a Windows Service
With a Windows Service I could either hook directly into the EPiServer database and query the job history, but the better thing to do would be to create a web service in the website. The web service could use the EPiServer API the same as the scheduled job and return a dataset of failed jobs (or something like that).

The advantage of using a Windows Service is that the one service could be configured to interrogate multiple EPiServer sites and provide a summary email for all the sites.

This option would obviously require a lot more work as a Windows Service and Web service would need to be created. However, with this approach you could get a lot more flexibility and could customise the email to be a bit friendlier, and with more information.

EPiServer Scheduled Job
If you are interested in the scheduled job prototype that I created, then you can download it from here. It is pretty simple and all I was going to add was some filtering based on when the job last ran. This is so you wont get repeating notifications.