This gives you a guidance how to do a very basic, first step integration.
The goal is that you'll have another system which...
- Runs with all the DLLs of 2sxc included
- Is able to read data from 2sxc, which is in another Database
Preparation
- Make sure you have DNN running with 2sxc installed and some apps.
- The DB and files must be accessible from your own application in the initial phase
Basic DLL Steps
- Prepare the 2sxc / EAV, set up the repos so you can compile - note that you don't need to build the DNN solution, but the MVC. So you can skip the DNN-integration part with the paths etc.
- Compile the latest 2sxc and copy all relevant DLLs to your solution in Debug-Build (so you can later debug what's wrong)
- Load your application and verify that it still works
- Configure DependencyInjection with the IServiceProvider and ensure you add the core parts. Look at the MVC-project for inspiration
- AddSxcWebApi() - this may not be necessary at first, but we're not sure
- AddSxcCore()
- AddEav()
- Now also add the correct connection string using the static object
ToSic.Eav.Repository.Efc.Implementations.Configuration
. This is a bit hacky, but that's how it's done for now. Check out the MVC code for inspiration.
Customize the most important classes
- Ensure your solution can load the global content-types
- Decide where to load the files from initially. This must return a path to where the json content-types lie of your system. So either point to the Dnn folder (ca.
web/desktopmodules/ToSic_SexyContent/.data
) or a copy of that folder in your environment.
- Now create a
YourPrefixGlobalFolderRepository
inhertiing the FolderBasedRepository
class, return the RootPaths
of where these type-files are
Test if you can read data
- You should now be able to read data using the
State.Get(zoneId, appId)
object. Try it.