I am working on creating an internal module for my application - using the rest-hmvc
sample application for inspiration - but have hit a snag…
The application started off by using the coldbox advanced skeleton application.
It uses ORM and virtual services.
I am currently working on creating an incident reporting capabilities to add to the original application system - as a module, that has 2 parts,
The reporting of an incident and the investigation of an incident.
So (at least at the moment) my directory path looks like:
app_root
|- handlers
|- models
|- views
|- modules
|- modules_app
|- Incidents
|- ModuleConfig.cfc
|- config
|- modules_app
|- Reports
|- ModuleConfig.cfc
|- config
|- handlers
|- views
|- models
|- Report.cfc
|- Investigations
|- ModuleConfig.cfc
|- config
|- handlers
|- views
|- models
|- Investigation.cfc
In it’s first iteration - where I had app_root/module_app/Incidents/module_app/{Reports/Investigations}
just displaying some static text - the routing etc all works as expected -showing me the stand-in view files for the correct path/module.
However - I am stuck, now that I want to add change the statis views into forms and use a service and model with the new module’s forms.
The (beginning) contents of app_root/module_app/Incidents/module_app/Reports/handlers/Report.cfc
is:
component extends = "coldbox.system.EventHandler" {
property name = "ORMService" inject = entityService:Reports";
property name = "StaffDetailService" inject = "entityService:StaffDetail";
...
}
However I get an error:
No entity (persistent component) with name [Reports] found
It then lists out the persistent entities that are found in app_root/models
Attempting to get the Reports
portion working at:
app_root/module_app/Incidents/module_app/Reports
I have read the HMVC/Modules documentation
I have tried all the following (restarting commandbox between iterations) - but have not yet managed to get the virtual service / new persistent CFCs to work.
property name = "ORMService" inject = entityService:Reports@Incidents";
and
property name = "ORMService" inject = entityService:Reports@Incidents:Reports";
and
property name = "ORMService" inject = entityService:Reports@Incidents/Reports";
and
property name = "ORMService" inject = entityService:Reports@Incidents.Reports";
(More a question than a statement)
I am not sure if the hierarchy (extends
) portion of the Report handler is correct (I just copied what is in the “base” portion of the application.
As an extra - I have also tried placing the models
directory into:
app_root/module_app/Incidents/models/Reports.cfc
(Which matches the documentation - at least how I read it to be)
Can anyone see what I am doing wrong?
As always - Thanks!