Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# dagda1 11/7/2006 7:21 AM
Hi,

I am trying to put together a preview implementation for a site we are using Cuyahoga for the CMS framework and was looking for some words of wisdom from the wise.

We are only really using about 3 modules with the two most people will be familiar with are the StaticHtml and the article modules.

The worry here and what I am trying to avoid is creating individual preview functionality for each module. I noticed on the wiki that there are plans to have all content implement an IContentItem interface and in turn a ContentItem base class. I don’t think this will help my cause with a need to treat all content generically.

I had a play and was able to preview the StaticHtml content by first placing the unsaved content in the Web Cache and then opening a new window with a page that inherited from PageEngine which inserted the cached content into the correct place in the Controls collection.

This is fair enough for StaticHtml but having to do this for every Module is less than desirable.

My new opinions are this and I guess this sort of ties in with workflow:

1. Clone a new node and save the changes to the preview node and not the actual node. I am favouring this approach but I am unsure of how to tie the actual node to the preview node. Also I don’t want to get into the situation where I could have multiple nodes in the db that were created by previewing and might come back in the search etc. or worse start appearing in the Navigation. I can’t guarantee when the user will exit the application so there is now way of deleting this preview node. This way would lead nicely to workflow and I guess versioning of nodes. It would be nice to browse a future version of the site.

2. I could clone a new node and somehow keep it in memory and have a class like PageEngine that retrieves the in memory state of the page and then renders it as per normal. This is probably the path of least resistance but as we are using proxies on most persistence classes, we cannot serialise them by normal means (that I know of) so again I am a bit confused of how to go about this.

Any thoughts at all are greatly appreciated.

Paul


# martijnb 11/7/2006 3:19 PM
Very interesting. I haven't had the time yet to thoroughly think about preview functionality. When reading your options, I strongly favor #2. Option #1 puts stuff in the database that doesn't belong in there.

I didn't entirely get what kind of serialization issues you get with option #2.
# dagda1 11/8/2006 5:06 AM
Actually there is no problem placing a node in the cache.

This is the approach I will take.

Thanks

Paul
# dagda1 11/8/2006 8:39 AM
A further update,

I had some problems caching the node and then reattaching it to the NHibernate session because of NHibernates Lazy loading capabilities, I managed to get round this using a combination of session.Update and session.Lock.

But and the big but is that all custom modules read their data from the database. For example StaticHtml runs an HQL query on Page_Load so this was not a winner. This is further complicated by the situation where the data is new and unpersisted.

The above could be contrary to somebody telling me differently :-).

Thanks

Paul