This shows you the differences between two versions of the page.
— | wiki:old:web_portal_2012 [2013/07/10 20:53] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | This page gathers progress works lead during Q1 and Q2 2012 to develop generic web portal for OAR eco-system. | ||
+ | See [[Web Portal]] proposal for the context. | ||
+ | |||
+ | ====== | ||
+ | |||
+ | * Benjamin Galaud: Projet M1 WIC | ||
+ | * Olivier Richard | ||
+ | |||
+ | |||
+ | ====== | ||
+ | * KVM image: | ||
+ | |||
+ | < | ||
+ | wget http:// | ||
+ | sudo kvm -m 512 -redir tcp: | ||
+ | firefox http:// | ||
+ | </ | ||
+ | |||
+ | ====== | ||
+ | |||
+ | * Porting extj3 portal prototype to extj4 | ||
+ | * History Support (see Ext.History in poar extjs 3 version) | ||
+ | * User Login and service access (see below http-basic-auth) | ||
+ | * User Preference (?) | ||
+ | * Coffeescript | ||
+ | * ... | ||
+ | ====== | ||
+ | ===== http basic auth (in-ajax) ===== | ||
+ | |||
+ | < | ||
+ | http:// | ||
+ | How to do HTTP Basic Auth in Ajax | ||
+ | -------------------------------------- | ||
+ | function make_base_auth(user, | ||
+ | var tok = user + ':' | ||
+ | var hash = Base64.encode(tok); | ||
+ | return "Basic " + hash; | ||
+ | | ||
+ | </ | ||
+ | |||
+ | Step 3 | ||
+ | |||
+ | Use it in your Ajax call. | ||
+ | |||
+ | < | ||
+ | var auth = make_basic_auth(' | ||
+ | var url = ' | ||
+ | </ | ||
+ | |||
+ | **RAW** | ||
+ | |||
+ | < | ||
+ | xml = new XMLHttpRequest(); | ||
+ | xml.setRequestHeader(' | ||
+ | xml.open(' | ||
+ | // ExtJS | ||
+ | Ext.Ajax.request({ | ||
+ | url : url, | ||
+ | method : ' | ||
+ | headers : { authorization : auth } | ||
+ | }) | ||
+ | </ | ||
+ | |||
+ | **jQuery** | ||
+ | |||
+ | < | ||
+ | $.ajax({ | ||
+ | url : url, | ||
+ | method : ' | ||
+ | beforeSend : function(req) { | ||
+ | req.setRequestHeader(' | ||
+ | } | ||
+ | }) | ||
+ | </ | ||
+ | |||