[1.5.6] newContent inside an oldBox

Hi there guys,

Is it possible to integrate ContentBox Blogging into a ColdBox App… is there a “short bridge” to cross and make the connection?..

Thanks in advance

Yes… ContentBox is basically ColdBox modules.

I wrote 2 blogs on doing something like this for both the admin and UI, not that long ago. If you have any other questions let me know.

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

};

  1. 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”;

  1. Drop ContentBox modules into modules folder
  2. Remove the DSN creator module as I am guessing you are integrating, so delete it from disk
  3. 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

}

};

  1. 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”;

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Thanks a lot! Andrew!!

Thank you all for your time offered! :slight_smile:

I’ll post any situations and results.

Hello guys,

Question, inside “config/coldbox.cfc” there are some module configuration that dictates which modules to load and which not to, and since ContentBox are modules, do I need to mention these modules in: modules.include = [] ?

Thanks in advance.

By default, all modules should be loaded.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Ok, guys…

Installation was a smooth process, I had to enter in my Coldbox.cfc the modules manually… Now, I have the default layout working.

But I need help, I’m still kind of blurry to see how can I Apply ContentBox Blogging comments into my root App.
how Can I access ContentBox API or methods?

Thanks guys!

You should be able to ask WireBox for any of the services inside the core ContentBox module. Look in the moduleConfig.cfc to see what the mapping IDs are. Just keep in mind, the API of the internal ContentBox services might change bet ween releases.

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Thanks Brad…