Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Yes! Being able to deploy the ContentBox modules inside any ColdBox app has always been one of it's big features. Follow these steps to do it:
- 1. Update ColdBox to latest included on ContentBox
- 2. Add orm configurations to parent application.cfc
- // THE DATASOURCE FOR CONTENTBOX MANDATORY
- this.datasource = "contentbox";
- // CONTENTBOX ORM SETTINGS
- this.ormEnabled = true;
- this.ormSettings = {
- // ENTITY LOCATIONS, ADD MORE LOCATIONS AS YOU SEE FIT
- cfclocation=["model","modules"],
- // THE DIALECT OF YOUR DATABASE OR LET HIBERNATE FIGURE IT OUT, UP TO YOU
- //dialect = "MySQLwithInnoDB",
- // DO NOT REMOVE THE FOLLOWING LINE OR AUTO-UPDATES MIGHT FAIL.
- dbcreate = "update",
- // FILL OUT: IF YOU WANT CHANGE SECONDARY CACHE, PLEASE UPDATE HERE
- secondarycacheenabled = true,
- cacheprovider= "ehCache",
- // ORM SESSION MANAGEMENT SETTINGS, DO NOT CHANGE
- logSQL = false,
- flushAtRequestEnd = false,
- autoManageSession= false,
- // ORM EVENTS MUST BE TURNED ON FOR CONTENTBOX TO WORK
- eventHandling = true,
- eventHandler= "modules.contentbox.model.system.EventHandler",
- // THIS IS ADDED SO OTHER CFML ENGINES CAN WORK WITH CONTENTBOX
- skipCFCWithError= true
- };
- 3. Add ContentBox mappings to parent application.cfc
- // LOCATION MAPPINGS
- this.mappings["/contentbox"] = COLDBOX_APP_ROOT_PATH & "modules/contentbox";
- this.mappings["/contentbox-ui"] = COLDBOX_APP_ROOT_PATH & "modules/contentbox-ui";
- this.mappings["/contentbox-admin"] = COLDBOX_APP_ROOT_PATH & "modules/contentbox-admin";
- 3. Drop ContentBox modules into modules folder
- 4. Remove the DSN creator module as I am guessing you are integrating, so delete it from disk
- 5. Open your parent application's config/ColdBox.cfc and make sure that
- a. The SES interceptor is defined
- //Register interceptors as an array, we need order
- interceptors = [
- //SES
- {class="coldbox.system.interceptors.SES"}
- ];
- b. The ORM injection is enabled:
- // ORM
- orm = {
- // Enable Injection
- injection = {
- enabled = true
- }
- };
- 4. By default ContentBox UI takes over your application routes and display. You can segregate the module to a separate entry point by opening the ModuleConfig in the ContentBox UI module (/modules/contentbox-ui/ModuleConfig.cfc) and adding an entry point:
- // YOUR SES URL ENTRY POINT FOR CONTENTBOX, IF EMPTY IT WILL TAKE OVER THE ENTIRE APPLICATION
- // IF YOU WANT TO SECTION OFF CONTENTBOX THEN FILL OUT AN SES ENTRY POINT LIKE /site OR /content
- // BY DEFAULT IT TAKES OVER THE ENTIRE APPLICATION
- this.entryPoint= "blog";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement