
|
1.20.2005 Q: Does umbraco create static html pages A couple of weeks ago I was asked if umbraco could create static html pages, and the answer was that it wasn't a build-in feature. Now why would anybody need static html pages you might ask - but think about this; a large organization or university could use one Windows server running umbraco for managing all sites, but when pages are published you could copy them to small servers just running Linux. Of course this would only work for absolutely static content, but it could be a need feature... How to make it work Now umbraco might not support static pages as a build-in feature but because of the simple API and because umbraco has an internal ActionHandler, it's really easy to create that feature - even without open any source. A tiny backgrounder on ActionHandlers An actionHandler is called whenever umbraco does something like publishing, creating, deleting and so on. By creating a class that inherits an interface called "umbraco.BusinessLogic.Actions.IActionHandler" and copy the dll into the /bin folder, your actionHandler is registered - true plug-in architecture, no configfiles used! The IActionHandler is really simple: - string HandlerName() - Should just return whatever you want to call your handler - umbraco.main.IAction[] ReturnActions() - This is an array with the Actions that you handler supports. By returning the PublishAction, your handler will be invoked whenever umbraco publish anything - bool Execute(Document, IAction). This method is called when umbraco does anything that your handler should support. So the ActionHandler that will be able to create static pages on publication looks like these 91 lines (including comments and VS.NET generated code): saveStatic.cs. As stated in the comments part of the code it needs some more work, but as a proof of concept I think it does the job. And hey - it works! You could also use actionHandlers to create your own specialized work-flow or automatically send mails when news are published... 0 Comment(s)...
Comments:
Post a Comment
Older stuff here... |
|
More banners here... To the weblog frontpage Email / Contact info umbraco - my company Call me through Skype Blog archive RSS Feed![]() commonme.org publicMIND urgent.dk asynkron Hr. Röser Interbreed OpenLife Loudthinking BlogBot.dk Tim O'Reilly - and his books steve mcconnel joel spolsky steve jobs bruce eckel ![]() |
|
|