Repository navigation
Support for Frameworks
A framework hands every file values it never declares (event, wirebox, $assert, …) and lets files
inherit without saying so. Without help, every call on those values looks unresolved. clif covers this in
three ways:
| Mechanism | Configure with | Page section |
|---|---|---|
| Framework presets |
"frameworks": ["coldbox", …] in .clif.json
|
Presets |
| Bundled framework APIs | Nothing: used when the framework's source is not in the workspace | Bundled APIs |
| Routing conventions |
"routes": { … } in .clif.json
|
Routes |
Everything here applies equally to the editor, clif unresolved, clif graph and the MCP server.
{
"workspaceName": "myapp",
"frameworks": ["coldbox", "testbox"]
}| Rule | Behaviour |
|---|---|
| Inheritance | A child config's frameworks adds to its parent's |
| Unknown names | Warned about in the log |
| Overrides | Your own componentResolvers are tried first, and a file that names its own extends keeps it |
| Suggestions | When the box.json beside the config depends on a framework with a preset the config does not name (coldbox, testbox, commandbox-migrations, wheels-core, …), clif unresolved ends by suggesting it and the server logs the suggestion. Suggestions never enable a preset by themselves |
| No config | With no editor config, a recognised source layout can supply framework defaults; an explicit config always controls framework selection |
| Preset | Adds |
|---|---|
coldbox |
See ColdBox below |
testbox |
$assert/assert, mockbox, testbox, a reporter's results; what getMockBox(), expect() and expectAll() return |
commandbox |
print (the print buffer); what command() returns; a .cfc under commands/ is a BaseCommand, and task.cfc or a .cfc under build/ a BaseTask
|
cfmigrations |
A migration's schema, qb/query, and the table a schema callback is handed, as qb's builders. Common names, so enable only where cfmigrations is used |
contentbox |
The cb helper; prc.oCurrentAuthor, prc.oCurrentSite, and prc.oContent as any kind of content. Use with coldbox
|
wheels |
application.wo; model( "User" ) is the User model (nearest file first); views and layouts run inside their controller with every view/controller mixin, so linkTo() and startFormTag() resolve; global/functions.cfm reaches every controller, model and view |
fw1 |
fw/framework, beanFactory; views and layouts run inside framework.one, so buildURL() is found; getBean( "userService" ) is the bean DI/1 registers under that name |
| In a ColdBox app | Treated as |
|---|---|
event, html, controller/cbController/coldbox, log, logbox, wirebox/injector, binder, cachebox, flash (bare, variables. or arguments.) |
The ColdBox component each one is: RequestContext, HTMLHelper, Controller, … |
getRequestContext(), getController(), getRequestService(), getResponse() and other framework getters |
Their ColdBox return types, so chains on them are checked |
A .cfc under handlers/ or interceptors/, config/Router.cfc, config/Scheduler.cfc with no extends
|
An EventHandler, Interceptor, Router or ColdBoxScheduler
|
A .cfm under views/ or layouts/
|
Rendered by the Renderer, so a bare view() or announce() is found |
getInstance( "UserService@users" ), getInstance( name = "id:models.UserService" )
|
The component the id names. A WireBox DSL string such as "logbox:root" is ColdBox's own class; an id with no file is dynamic; a computed id is left alone |
A helper ColdBox mixes in: a module's this.applicationHelper, includeUDF(…), the app's applicationHelper setting, <view>Helper.cfm, <folder>Helper.cfm
|
Found from any handler, view, layout or interceptor |
| Source | Typed as |
|---|---|
property name="svc" inject="UserService@users"; (also id:, model:, provider: prefixes) |
The UserService component, found by path then file name, nearest first |
inject="coldbox", coldbox:requestService, coldbox:renderer, coldbox:flash, coldbox:asyncManager
|
ColdBox's Controller and services |
wirebox, wirebox:populator
|
Injector, ObjectPopulator
|
cachebox, cachebox:<name>
|
CacheFactory, a cache |
logbox, logbox:logger:{this}
|
LogBox, a Logger
|
HTMLHelper@coldbox, Renderer@coldbox, DataMarshaller@coldbox, XMLConverter@coldbox
|
ColdBox's own models (never a workspace file of the same name) |
coldbox:setting:x, coldbox:moduleSettings:x, wirebox:child:x
|
Not a component; left alone |
A module registers its models under this.modelNamespace (default: its directory name), so
UserService@users is the UserService in the users module's models/. this.cfmapping is a mapping
to the module, and binder.map( "Mailer" ).to( "#moduleMapping#.models.MailService" ) in a
ModuleConfig.cfc or config/WireBox.cfc makes Mailer that component. An id whose module is not in the
workspace is dynamic.
WireBox delegates (property name="memory" inject delegate delegatePrefix;,
component delegates=">Memory, Worker=vacation") give the component the delegate's methods under the names
WireBox gives them.
When the framework's source is not in the workspace, clif uses API stubs bundled into the binary, generated from each framework's own source with every method's signature and doc comment.
| Source in workspace | Bundled API only | |
|---|---|---|
Completion after event.
|
✔ | ✔ |
| Signature help, hover docs | ✔ | ✔ |
event.getValu() reported as not found |
✔ | ✔ |
| Go-to-definition into the framework | ✔ | ✘ (no file to open) |
| Version | Whatever you have checked out (always wins) | One pinned version per framework (internal/frameworkapi/sources.go) |
A framework's own namespace needs no preset: coldbox.system.*, testbox.system.*,
commandbox.system.*, qb.models.*, contentbox.models.* and cborm.models.* resolve to the bundled API
when nothing on disk does, so a spec extending testbox.system.BaseSpec is checked without naming
testbox.
Doc-comment return types are read too: a method documented @return coldbox.system.web.context.RequestContext
returns that, so var event = execute( event = "main.index" ) in a test is a request context.
| Feature | Behaviour |
|---|---|
entityNew( "cbRole" ), entityLoad( "cbRole" )
|
Find the component declaring entityname="cbRole", or a persistent component of that file name; the caller's own application first |
cborm VirtualEntityService with super.init( entityName = "cbRole" )
|
new(), get(), getOrFail(), findWhere() return that entity; this.findBySlug() style finders are answered by onMissingMethod
|
| ORM relationship properties | Generated hasX(), addX(), removeX() are declared |
| Wheels models |
findByKey(), findOne(), new(), create() return the model; hasMany( "comments" ) / belongsTo( "author" ) add comments(), commentCount(), newComment(), author(), … |
this.memento |
Adds mementifier's getMemento()
|
| ColdBox handlers/interceptors | cbi18n ($r(), getResource()), cbfs (cbfs()), HTMLHelper (addAsset()) helpers, whether or not the module is on disk |
| DI/1 (FW/1) | Default bean folders model and controllers; services/user.cfc is both user and userService; property userService; holds it |
| Source | Treated as |
|---|---|
A method that return this;
|
Its own component, so fluent chains are checked hop by hop |
expect( x ).toBe( 1 ) |
A call on what expect returns |
cfheader( … ), cfhttp( … ), any documented tag called as a function |
A built-in |
createMock( "models.User" ) (MockBox) |
A mock of that class; dynamic when the class does not resolve |
prepareMock, createStub, a mock of a computed class |
Dynamic |
createObject( "java", … ), new java:… with no stub |
Dynamic (see javaStubsPath in Other Options) |
new Query(), new http(), org.lucee.cfml.*, com.adobe.coldfusion.*
|
The engine's own component |
$(), $results(), $never() and other MockBox methods |
Accepted on any component |
A doc comment @return models.User on an untyped function |
That component |
| Generated property setters / getters | The component itself / the property's type or inject
|
{
"workspaceName": "shop",
"workspacePaths": ["."],
"frameworks": ["coldbox", "testbox"],
"mappings": { "models": "./models" }
}clif unresolved .A broken base appears once per file, on its extends line:
handlers/settings.cfc:48: cborm.models.VirtualEntityService (calls a component whose chain breaks at cborm.models.VirtualEntityService, which does not resolve; 12 calls not checked)
and the report's closing totals list such bases, most calls first. Adding the missing module's directory
to workspacePaths (or a mappings entry) then checks every call it accounted for.