So I’m still working on a proof of concept to convince the bosses that CB is a great framework with which to start building a SaaS application. In the process, one of the things I have to commit to is to be able to code everything that their current system can “do”…not that we won’t rewrite it…but I made a commitment.
There is a routine by which the CGI scope is stuffed into a session variable because the values can actually be used but overridden in this application and I need to mimic that functionality. In my first stab at this I…
Created an interceptor so that on a session start it can grab the cgi scope and dump it into an object for later use.
Created a basic model to house the cgi scope variables using a single property of type struct and accessors set to true.
In the interceptor, I thought to use wirebox to get the mapped instance in the session scope for the cgi facade class.
It works up to a point…but continues to claim that “setcgiscope()” is not a method…
Error Type: Application : [N/A]
Error Messages: The method setcgiscope was not found in component C:\inetpub\wwwroot\td\model\system\CGIFacade.cfc.
So the two questions I have are:
- Does this seem a reasonable approach. If there is a simpler or smarter way to do this, great…I mean, I’ve been doing CF for a long long time so I know I can do it another way, but I to do it the CB way
- Why is my accessor not working…am I overlooking something or have I don’t something wrong for injection that I don’t get yet?
The relevant items are below and this is not the first interceptor, class, mapping or injection I have done on this proof of concept
Wirebox Mapping
mapPath(“systemcgi”).to(“model.system.CGIFacade”).into(this.SCOPES.SESSION);
Interceptor
component extends=“coldbox.system.Interceptor” {
property name=“wirebox” inject=“wirebox”;
public void function preProcess(event, interceptData) {
wirebox.getInstance(“systemcgi”).setcgiscope(CGI);
};
}
CGIFacade model
component accessors=“true” {
property name=“cgiscope” type=“struct”;
CGIFacade function init(){
return this;
}
}
Thanks,
Mike