16 Apr 2013 20:11
Hmmm, now that I think of it. It would be nicer if I would simply respond with a 401 error and handle that error somehow at the client side by displaying a login form. Is there a neat way to catch errors?
On Tuesday, April 16, 2013 3:50:32 PM UTC+2, jhaagmans wrote: --
You received this message because you are subscribed to the Google Groups "Netzke" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netzke+un...@googlegroups.com.
To post to this group, send email to net...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/netzke/-/3jrM_AXqX5IJ.
For more options, visit https://groups.google.com/groups/opt_out.
16 Apr 2013 19:35
I already saw that I missed the .to_json on direct_response, which I fixed.
Let me simplify my issue. I want to use a before_filter on my NetzkeController that could simply do this:
def require_admin_user
unless admin_user_signed_in?
render :text => direct_response(params, {netzke_feedback: 'Not logged in!'}).to_json, :layout => false
end
end
Is there any way to hijack any action (including a get_data kind of action) using a method like this?
Thanks.
On Tuesday, April 16, 2013 11:35:15 AM UTC+2, jhaagmans wrote: --
You received this message because you are subscribed to the Google Groups "Netzke" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netzke+un...@googlegroups.com.
To post to this group, send email to net...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/netzke/-/fIjTxSS6cOgJ.
For more options, visit https://groups.google.com/groups/opt_out.
16 Apr 2013 15:20
Hi all,
I've been trying to implement authentication within Netzke. Now, I've made a nice login form that pops up when a user isn't logged in to the application when accessing it. That works fine and I've also managed to implement the logging in through Devise (although that was a pickle).
What I can't manage to do is displaying a form when the AdminUser session is invalidated. I have the following NetzkeController:
class Admin::NetzkeController < AdminController
include Netzke::Railz::ControllerExtensions
before_filter :require_admin_user, :except => [:ext] # Ext is needed to be able to use ExtJS for the login form.
private
def require_admin_user
unless admin_user_signed_in?
params[:act] = 'admin__workspace'
params[:method] = 'deliverComponent'
params[:data] = [{name: 'login'}]
render :text => direct_response(params, invoke_endpoint(params)), :layout => false
end
end
end
Now I know this won't work for most Netzke calls (like grids or forms) because it expects a different kind of response. But I can't seem to figure out a way to display my login form window. Is there a trick I can use?
I hope you know what I mean.
Regards,
Jaap Haagmans
--
You received this message because you are subscribed to the Google Groups "Netzke" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netzke+un...@googlegroups.com.
To post to this group, send email to net...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/netzke/-/ofTosJdRt-YJ.
For more options, visit https://groups.google.com/groups/opt_out.
16 Apr 2013 20:47
Cheers. I've also been looking at the ExtJS docs about this, but I could only find this:
http://docs.sencha.com/extjs/4.0.7/#!/api/Ext.Error
If you know a way to implement this, I would get me 100 steps further. I'm so close to where I want to be with Netzke now!!
On Tuesday, April 16, 2013 4:28:39 PM UTC+2, nomadcoder wrote: --
You received this message because you are subscribed to the Google Groups "Netzke" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netzke+un...@googlegroups.com.
To post to this group, send email to net...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/netzke/-/ch09bwLOMkkJ.
16 Apr 2013 20:47
Cheers. I've also been looking at the ExtJS docs about this, but I could only find this:
http://docs.sencha.com/extjs/4.0.7/#!/api/Ext.Error
If you know a way to implement this, I would get me 100 steps further. I'm so close to where I want to be with Netzke now!!
On Tuesday, April 16, 2013 4:28:39 PM UTC+2, nomadcoder wrote: --
You received this message because you are subscribed to the Google Groups "Netzke" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netzke+un...@googlegroups.com.
To post to this group, send email to net...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/netzke/-/ch09bwLOMkkJ.
16 Apr 2013 20:13
I'm not sure if there is, but probably should be! I'll have a look into this tomorrow.
18 Apr 2013 14:54
I noticed that netzkeProcessEndpoints isn't called for get_data endpoints, but I'm not 100% sure why that is. It seems like Netzke::Basepack::Grid has its own exception handler, but I don't want to use that. I could probably override it, but I'm not sure how. I tried adding a loadExceptionHandler function to my mixed in javascript, but that doesn't seem to override it.
Also, I have a chart using its own store calling to a get_data endpoint, but that's not responding at all when the get_data output isn't what it expects.
I hope you can help.
On Wednesday, April 17, 2013 6:07:46 PM UTC+2, jhaagmans wrote: --
You received this message because you are subscribed to the Google Groups "Netzke" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netzke+un...@googlegroups.com.
To post to this group, send email to net...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/netzke/-/ujIKn4m6rZkJ.
17 Apr 2013 21:52
Okay, I managed to test it today. I've created the following javascript code:
Ext.define(null, {
override: "Netzke.classes.Core.Mixin",
onDirectException: function(e) {
Netzke.warning(e.getTransaction());
}
});
Now, I get a Transaction object back when calling a deliverComponent action (through a menu item calling netzkeLoadComponent), but when I call my stores (I have a chart and multiple grids), the onDirectException doesn't seem to get called. Is there any reason for that?
Thanks again :)
Kind regards,
Jaap
On Tuesday, April 16, 2013 5:24:58 PM UTC+2, nomadcoder wrote: --
You received this message because you are subscribed to the Google Groups "Netzke" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netzke+un...@googlegroups.com.
To post to this group, send email to net...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/netzke/-/6bH3dO2bq7gJ.
16 Apr 2013 21:09
Here's what we have now (in master). When a server exception occurs, a client-side method "onDirectException" gets called, with an Ext.direct.ExceptionEvent instance passed to it (see Ext JS docs). The default implementation simply gives a warning. However, you can override it globally as explained here: http://writelesscode.com/blog/2013/04/04/changing-behavior-of-all-netzke-components-on-the-client-side/
By analyzing Ext.direct.ExceptionEvent, you can see whether server returned 401 - and handle as you find appropriate.
Thanks for pointing me in this direction - I think, that's a much better way to do what you need, as compared to manually building a proper Netzke response!
Let me know if you have any issues with this.
18 Apr 2013 20:45
I've tried this:
Netzke.directProvider.on('data', function(self, e) {
// if (Ext.getClass(e) == Ext.direct.ExceptionEvent) {
// this.onDirectException(e);
// }
console.log(JSON.stringify(Ext.getClass(e)))
}, this);
But this logs "undefined" a couple of times for each call. Also for the chart call, so I hope I'm on the right track by trying to evaluate the class of e (I'm guessing it's not an Ext.direct.ExceptionEvent). I'm just not sure how that would be done.
Cheers.
On Thursday, April 18, 2013 3:15:08 PM UTC+2, jhaagmans wrote: --
You received this message because you are subscribed to the Google Groups "Netzke" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netzke+un...@googlegroups.com.
To post to this group, send email to net...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/netzke/-/RbW3pbBYy64J.
18 Apr 2013 19:00
It loads just the one, I also see just one server call for just one grid.
On Thursday, April 18, 2013 2:55:54 PM UTC+2, nomadcoder wrote: --
You received this message because you are subscribed to the Google Groups "Netzke" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netzke+un...@googlegroups.com.
To post to this group, send email to net...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/netzke/-/2Vrt-dMi6lgJ.
18 Apr 2013 18:01
My findings:
- In a Grid, I seem to get 8 calls to onDirectException. Why is that?
- In my chart, it doesn't call onDirectException
I'll look into your changes to try and understand.
On Thursday, April 18, 2013 1:50:46 PM UTC+2, jhaagmans wrote: --
You received this message because you are subscribed to the Google Groups "Netzke" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netzke+un...@googlegroups.com.
To post to this group, send email to net...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/netzke/-/1Ag3WKGHyywJ.
18 Apr 2013 17:35
I'll check ASAP, cheers!
On Thursday, April 18, 2013 1:32:56 PM UTC+2, nomadcoder wrote: --
You received this message because you are subscribed to the Google Groups "Netzke" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netzke+un...@googlegroups.com.
To post to this group, send email to net...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/netzke/-/mv87TpMCrS4J.
18 Apr 2013 17:17