1

I have a SenseNet repository that was created from SenseNet 6.5.4 and it has 40+ custom content types (CTDs) each with their own content handler. This repository has been running for a client for well over a year and has a lot of data in it.

I would like to create an ASP.NET MVC app for this client, which now looks pretty straightforward using the new SenseNet 7.0 (beta) framework. However, my Content Repository is from an earlier version of SenseNet, meaning my handlers are dependent on the previous SenseNet libraries, which are presumably incompatible with the new ones.

Is this even possible, and if so, is it a good idea to pursue given that this client will be upgraded to SN 7.0 at some point?

Thane Plummer
  • 7,966
  • 3
  • 26
  • 30

1 Answers1

0

Yes, it is possible, but it's a lot of work, as you have to create content handlers that link to the new SN 7.0 libraries. For the existing custom content handlers this is a simple copy/paste with a few edits here and there. Just add the handler's C# code to the new MVC project and make sure it compiles and has no errors.

That's the easy part! Now you have to create handlers for all data in your repository that references the 6.5 libraries. For my project, I had to port 11 content handlers (from the SN install), plus another 30+ supporting classes.

It's a good idea to delete all the unused content from your repository before you start the port, as the MVC application throws an exception when it tries to pull content from the repository and cannot find a SN 7.0 handler for it. Things like Blog, Wiki, Journal, etc., can be deleted if they are not used.

EDIT: To address the comment from Miklos, it should be stated that this question arose from an experimental project to evaluate the upgrade path to SN 7.0, and is not a recommended upgrade approach. Ah, the beauty of open source software!

I intend to experiment with upgrading the custom content by exporting the data as XML from the 6.5 repository, and then importing that into the 7.0 repository. So long as none of the content derives from any exotic Content Types (CTDs) found in 6.5 but not in 7.0, this should be feasible and straightforward.

Finally, I have to disagree with the comment that the best thing to do is use the REST API in the 6.5 framework for an MVC app. I've done this several times and SN 6.5 just doesn't easily support MVC. All calls are client-side OData Ajax, debugging is a pain, there's no server side C# API, and writing Ajax calls every time you need to query the repository is ridiculous. And yes, I know you can create OData calls from the server, but it's a far cry from a clean and simple server side API with nice intellisense. It's simply not worth the struggle. With SN 7.0, you can have an MVC site running in about 10 minutes using the NuGet packages, with server side AND client side support. There's just no comparison.

Thane Plummer
  • 7,966
  • 3
  • 26
  • 30
  • Sorry Thane for downvoting, but I think this is not an advisable approach :). Please consider accessing 6.5 through the REST api instead, because the solution above is practically a partial manual upgrade, which is not a supported scenario, because of the reasons you mentioned: missing/changed content types and handlers, and for many other reasons... – Miklós Tóth Apr 18 '17 at 13:11
  • Hey Miklos, I would agree that it's not the best approach for most SN users. That being said, the primary question was "is it possible", and the answer is "yes". I'll edit my answer to address your concerns. – Thane Plummer Apr 18 '17 at 18:42
  • I really just wanted to point out that to experiment with this, you have to know what you are doing, I know you do :) – Miklós Tóth Apr 19 '17 at 19:14