Some basic questions

198 views
Skip to first unread message

Hal

unread,
Sep 25, 2010, 11:14:58 AM9/25/10
to framework-one
Just starting out with Sean's framework. Some questions for you more
seasoned folks:

1. My application.cfc has this: variables.framework.generateSES = true
but URL like http://mydomain.com/main/default isn't working. Is there
something more/else I need to do?

2. I have a url: mydomain.com/registration/create. It first calls
session/registration.cfc's create method that returns a string. In my
registration.cfc controller's create method, I am trying to read
arguments.rc.data (also tried just rc.data) and get an error that data
doesn't exist in that struct. Is the something more/else I need to do?

3. Inside a controller, is there a way to tell the framework that I
don't want to use the default view? I saw the setView, but I don't
think that's what I want, no?

Many thanks for any help,

Hal

Sean Corfield

unread,
Sep 25, 2010, 3:12:45 PM9/25/10
to framew...@googlegroups.com
Hi Hal!

Welcome to Framework One!

On Sat, Sep 25, 2010 at 8:14 AM, Hal <hal....@gmail.com> wrote:
> 1. My application.cfc has this: variables.framework.generateSES = true
> but URL like http://mydomain.com/main/default isn't working. Is there
> something more/else I need to do?

Because there's no /index.cfm in the URL, you'll need rewriting
enabled on your web server.

Or you should be able to force /index.cfm to appear in the URL by
specifying: variables.framework.OmitSESIndex = false

> 2. I have a url: mydomain.com/registration/create. It first calls
> session/registration.cfc's create method that returns a string. In my

You mean services/registration.cfc's create() method?

> registration.cfc controller's create method, I am trying to read
> arguments.rc.data (also tried just rc.data) and get an error that data
> doesn't exist in that struct. Is the something more/else I need to do?

Services run after the first round of controller methods. If you want
to access the result of a service call, you need to define endCreate()
in your controller (and use startCreate() for consistency):

function startCreate(rc){ // called at start of create processing
...
}

// implicit call to rc.data = services.registration.create()

function endCreate(rc){ // called at end of create processing
... rc.data is available ...
}

> 3. Inside a controller, is there a way to tell the framework that I
> don't want to use the default view? I saw the setView, but I don't
> think that's what I want, no?

It is what you want:

function someItem(rc){
setView( 'other/page' ); // tell FW/1 to use views/other/page.cfm instead
}
--
Sean A Corfield -- (904) 302-SEAN
Railo Technologies, Inc. -- http://getrailo.com/
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

Sean Corfield

unread,
Sep 25, 2010, 3:13:47 PM9/25/10
to framew...@googlegroups.com
Oops! Hit Send too fast...

On Sat, Sep 25, 2010 at 12:12 PM, Sean Corfield <seanco...@gmail.com> wrote:
> function someItem(rc){
>    setView( 'other/page' ); // tell FW/1 to use views/other/page.cfm instead

Should be:

variables.fw.setView( 'other/page' );

> }

Assumes you have:

function init(fw){
variables.fw = fw;
}

in your controller.

AJ Mercer

unread,
Sep 25, 2010, 6:49:19 PM9/25/10
to framew...@googlegroups.com
Hi Hal,

responses in-line

On 25 September 2010 23:14, Hal <hal....@gmail.com> wrote:
Just starting out with Sean's framework. Some questions for you more
seasoned folks:

1. My application.cfc has this: variables.framework.generateSES = true
but URL like http://mydomain.com/main/default isn't working. Is there
something more/else I need to do?

As Sean stated, you need to do some rewrite rule magic
This is what I have for resin (Railo Express)

rein.conf
<host>
...
 <rewrite-dispatch>

<dispatch regexp="\.(jsp|cfm|cfc|php|gif|css|jpg|png)" />
<dispatch regexp="^/railo-context/" />

<forward regexp="^/(.*)" target="/index.cfm/$1" />
 </rewrite-dispatch> 

2. I have a url: mydomain.com/registration/create. It first calls
session/registration.cfc's create method that returns a string. In my
registration.cfc controller's create method, I am trying to read
arguments.rc.data (also tried just rc.data) and get an error that data
doesn't exist in that struct. Is the something more/else I need to do?

3. Inside a controller, is there a way to tell the framework that I
don't want to use the default view? I saw the setView, but I don't
think that's what I want, no?

do you mean you would like to chande the default item? eg from default to home 
   variables.framework.defaultItem = 'home', 

Many thanks for any help,

Hal

Hal

unread,
Sep 27, 2010, 10:00:51 AM9/27/10
to framework-one
Thanks Sean, AJ. You've cleared up my confusion. (Now, if you could
just explain that whole quantum thing...)
Reply all
Reply to author
Forward
0 new messages