Thanks Dan. I am on MG3. That solution would require me to add an 
additional view I think, which I was trying to avoid. I ended up adding 
this to the controller:

      <!--- if calling as an API, such as from QQ3, then only return 1 or 0 
instead of redirecting to other events --->
        <cfif YesNoFormat(arguments.event.getValue("quick"))>
        <cfif session.UserBean.getLoggedin() eq 1>
         <cfset local.output = 1 />
        <cfelse>
         <cfset local.output = 0 />
        </cfif>
        <cfcontent type="text/plain" variable="#ToBinary( 
Tobase64(local.output) )#"/>
        </cfif>

I would like to add a renderData() method, similar to what ColdBox has. It 
would be nice if I could make this available all controllers. I'd rather 
not modify the ModelGlue.unity.controller.Controller file, do you know if a 
way I can inject the method into all the controllers? If I could 
dynamically add it to ModelGlue.unity.controller.Controller before the 
other controllers are instantiated, that should work.

Or, if I add a renderData method to ModelGlue.unity.controller.Controller, 
would you accept a pull request to add that change MG?

On Wednesday, March 5, 2014 4:24:55 PM UTC-6, Dan Wilson - 
[email protected] wrote:

> I'm away from my computer so i can't be more verbose, 
>
> But if you are using MG 3, check the answer on this page for request 
> formats 
> http://stackoverflow.com/questions/7369613/how-do-i-configure-coldfusion-model-glue-3-so-that-it-wont-redirect-on-ajax-req
> On Mar 5, 2014 5:21 PM, "Ryan Stille" <[email protected] <javascript:>> 
> wrote:
>
>> Hi all, I've been googling this for a while but haven't come up with 
>> anything...
>>
>> I have an existing app, with a login. After logging in (the event is 
>> login.process) the user is redirect to a "home" event that takes quite a 
>> while to load. If they fail they are redirected to an event that shows a 
>> login form.
>>
>> Now I want to allow for a desktop app to make calls to my app to log 
>> users in, then make http requests on their behalf. I'd like to have this 
>> desktop app use the same login event ("login.process"). This would work, 
>> but the desktop app doesn't get feedback without scraping through the 
>> returned HTML, and the returned HTML takes quite a while to return because 
>> this home page is a slow rendering page.
>>
>> What I want to do is in the controller method (the one that is used by 
>> the login.process event), instead of checking credentials and forwarding to 
>> home, I want to check credentials AND THEN if a flag is passed (like 
>> Coming_from_desktop_app=true) just return 1 or 0 or something to indicate 
>> login success. With ColdBox is this is easy, I would just check for the 
>> flag and then event.renderData(data="1"), something like that. I haven't 
>> figured out how to do something near as graceful in MG.
>>
>> I could add a new, separate event and controller method for the desktop 
>> app, but I'd rather not have to maintain that.
>>
>> Thanks for any help.
>>
>>  -- 
>> -- 
>> Model-Glue Sites:
>> Home Page: http://www.model-glue.com
>> Documentation: http://docs.model-glue.com
>> Bug Tracker: http://bugs.model-glue.com
>> Blog: http://www.model-glue.com/blog
>>  
>> You received this message because you are subscribed to the Google
>> Groups "model-glue" group.
>> To post to this group, send email to [email protected]<javascript:>
>> To unsubscribe from this group, send email to
>> [email protected] <javascript:>
>> For more options, visit this group at
>> http://groups.google.com/group/model-glue?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "model-glue" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>

-- 
-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"model-glue" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to