KalikoCMS / KalikoCMS.Core

Open source content management system (CMS) for the ASP.NET platform.
GNU Lesser General Public License v3.0
145 stars 64 forks source link

.NET 5 / ASP.NET MVC 6 support? #58

Open dotnetshadow opened 8 years ago

dotnetshadow commented 8 years ago

Hi I was wondering if you will have support for .NET 5 / ASP.NET MVC 6 support?

dotnetshadow commented 6 years ago

This is really good stuff, I'm looking foward to seeing hte index with site content. It's pretty cool you have managed to get stuff up very quickly. 👍

fschultz commented 6 years ago

Have now managed to create some content and retrieve the index, so now awaits the routing. When that's done I'll be looking at transforming data from the 1.x format to 2.x in order the migrate site data.

Working with content is getting easier in 2.x, instead of using a StringProperty the page model now can use the string data type as a property directly. Assigning data to an editable page is now also done directly through the property;

  page.MyString = "A sample string";
dotnetshadow commented 6 years ago

It sounds like things are moving along nicely. Looks pretty promising, the strong property is great

fschultz commented 6 years ago

Updated the repository with some basic code for handling the URL lookup and routing in ASP.NET Core. If you're interested you probably could swap the data layer and implement a custom ContentRepository that uses the old data structure to feed the index. The data entity Content has replaced both Page and Site, ContentLanguage has replaced PageInstance, ContentProperty has replaced PageProperty and SiteProperty, but it should be possible to implement GetContentNodes with minor changes to get the structure (just remember to add the site as the first node in the result).

dotnetshadow commented 6 years ago

This is coming along nicely, hopefully it won't be too much work to integrate into my existing net core app. I've been sick lately so haven't had a chance to play with this yet.

I'll checkout the solution and try to see how things work. One quick question i noticed you use simpleinjector can this be replaced with.net cores di system?

fschultz commented 6 years ago

Sorry to hear, hope you've gotten well.

Yes, IoC and logging are both abstracted to support the end developer to select the framework of their choice. For dependency injection a service locator needs to be provided to bridge the abstraction with the implementation. For using the built in DI-container in ASP.NET Core the service locator would look something like this:

public class DependencyInjectionServiceLocator : ServiceLocatorImplBase {
    private readonly ServiceProvider _serviceProvider;

    public DependencyInjectionServiceLocator(ServiceProvider serviceProvider) {
        _serviceProvider = serviceProvider;
    }

    protected override object DoGetInstance(Type serviceType, string key) {
        return _serviceProvider.GetService(serviceType);
    }

    protected override IEnumerable<object> DoGetAllInstances(Type serviceType) {
        return _serviceProvider.GetServices(serviceType);
    }
}

And is registered in ConfigureServices by:

  ServiceLocator.SetLocatorProvider(() => new DependencyInjectionServiceLocator(services.BuildServiceProvider()));

I'll be adding a couple of implementations for the most common containers to the project, including the built-in.

dotnetshadow commented 6 years ago

Oh nice, I like the idea of having multiple implementations for DI, good idea 😃

dotnetshadow commented 6 years ago

@fschultz I'm very close to being in a position to start implementing some of this new stuff into my project. I would be happy to test this out for you. Perhaps I can contact you directly so I explain how I will use it and you can see the progress of it?

fschultz commented 6 years ago

Sounds like a good idea, drop me a line through http://kaliko.com/support/ to get my email address.

dotnetshadow commented 6 years ago

@fschultz I have tried to use the support page but I get the following error

Error 502 Ray ID: 42a8a8503cc03204 • 2018-06-14 00:25:03 UTC Bad gateway

fschultz commented 6 years ago

Could you please try again, I got a report of long downtime of the server but it should be up and running again. Sorry for the inconvenience.

dotnetshadow commented 6 years ago

Cheers it worked