← Back to team overview

openerp-expert-framework team mailing list archive

Re: Web addons controller and static folders

 

Hi Raphael,

Putting other handlers (and thus be served from 8069) is definitely
possible: this is how the (new) web client is done: it uses the --load
command line flag (which ends up in
openerp.tools.config['server_wide_modules'], which already contain 'web' by
default). Such server-wide-modules are loaded irrespectively of any
database. Their 'post_load' entry in the __openerp__.py file, if any, will
be called. The post_load implementation of the web addons will register its
own handler.

Handlers are simply WSGI applications. The OpenERP server itself is such a
WSGI application but acts as a router. There is one unconventional approach
we took here: handlers are not registered under some route, but can decide
by themselves if they want or not to serve some request. If they return
None, the next handler will be tried. If this proves to be too
unconventional/not practical enough, we can change that.

I hope to have some time to expand on this subject and add it to our doc.

Cheers,
Thu

On Tue, Jan 10, 2012 at 2:28 PM, Raphael Valyi <rvalyi@xxxxxxxxx> wrote:

> Hello Nicolas,
>
> not sure you have seen, but the embedded web-client Sphinx documentation
> bring some answers to your question, see here how to build them:
>
> http://planet.domsense.com/en/2012/01/openerp-new-web-client-6-1-documentation/
>
> Now of course, it's always incredible to learn those official docs things
> from community members rather than from their author or even from your
> business partner...
>
> On my side I have 2 questions:
>
>    - what is the way to proxy those multiple static files to serve them
>    directly via nginx or Apache? In 6.0 that was easy because there were only
>    one static directory, now we have many of them. Any regexp pointer to
>    address this would be welcome.
>    - is there a way to plug some additional custom handler on OpenERP
>    8069 HTTP framework so that I can proxy some other services eventually
>    using some non Python technologies (so I ask for a reverse proxy; and yes
>    I'm an heretic) and still benefit from the "same origin policy" in the
>    Javascript client side? Of course one can always plug those reverse proxies
>    at the Nginx or Apache proxy level, but it may make it harder to quickly
>    have a development environment. That's why proxying right inside the
>    OpenERP framework may bring some benefit, I'm open to debate in any case.
>
>
> Regards.
>
> --
> Raphaël Valyi
> Founder and consultant
> http://twitter.com/rvalyi <http://twitter.com/#%21/rvalyi>
> +55 21 2516 2954
> www.akretion.com
>
>
>
> On Tue, Jan 10, 2012 at 6:01 AM, Nicolas Bessi <
> nicolas.bessi@xxxxxxxxxxxxxx> wrote:
>
>> Hello,
>>
>> Webclient and trunk are going quite well.
>>
>> There is some new thinks that appear in module like a controller and
>> static folder, there is also the possibility to have web addons.
>> It will be nice nice to have some doc and best practices guide.
>>
>> How should web addons/view be distributed or includes in modules. What
>> should be put in static and controller folder when should we use a
>> controller or a web view addons.
>> How will all this be updated.
>>
>> If someone has some clues it would be nice.
>>
>>
>> Regards
>>
>> Nicolas
>>
>>
>>
>> --------------------------------------------------------------------
>> *Nicolas Bessi *
>> Senior ERP consultant
>> Business Solution technical manager
>>
>> Camptocamp SA
>>  PSE A
>> CH-1015 Lausanne
>> http://www.openerp.camptocamp.com
>>
>> Phone: +41 21 619 10 26
>> Office: +41 21 619 10 10
>> Fax : +41 21 619 10 00
>> --------------------------------------------------------------------
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~openerp-expert-framework
>> Post to     : openerp-expert-framework@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~openerp-expert-framework
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-expert-framework
> Post to     : openerp-expert-framework@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~openerp-expert-framework
> More help   : https://help.launchpad.net/ListHelp
>
>

Follow ups

References