How To Use ERP5 Mobile skin layer

A business template "erp5_mobile" provides a skin layer so that you can use ERP5 from a mobile phone (depending on the model, it is not compatible with every phone, so you have to try yours).

To install and configure it, do the following:

The installation process adds a "Mobile" layer, but sometimes it messes up order - the safest course then is to copy the "View" layer, paste it into the "Mobile" and add "erp5_mobile_ui" on the very top of it.

You need a different url for mobile access so that ERP5 can chose the right skin. So, you need to be able to access the same site under different urls, like:

http://yourhost.yourdomain/erp5
http://mobile.yourhost.yourdomain/erp5

To do this, refer to DNS and Apache VirtualHost configuration docs. It is easy when you've done it once. Sample pair of vhost definitions can look like this:

<VirtualHost *:80>
#  setup for normal access
DocumentRoot /var/www/html/test
ServerName yoursite.yourdomain
RewriteEngine On
RewriteRule ^(.*) http://localhost:8080/VirtualHostBase/http/yoursite.yourdomain:80/VirtualHostRoot$1 [L,P]
ProxyPassReverse ^/(.*) http://yoursite.yourdomain/$1
</VirtualHost>

<VirtualHost *:80>
#  setup for mobile phone access
DocumentRoot /var/www/html/test
ServerName mobile.yoursite.yourdomain
RewriteEngine On
RewriteRule ^(.*) http://localhost:8080/VirtualHostBase/http/mobile.yoursite.yourdomain:80/VirtualHostRoot$1 [L,P]
ProxyPassReverse ^/(.*) http://mobile.yoursite.yourdomain/$1
</VirtualHost>

First write a script which will analyze the requested url and set skin layer accordingly - something along these lines:

request = context.REQUEST

if request.get('portal_skin', None) is not None:
  return context.getPortalObject().changeSkin(request.get('portal_skin'))

url = request.get('URL')
if url.startswith('http://mobile'):
  context.getPortalObject().changeSkin('Mobile')

Then at the site level in ZMI choose "Set Access Rule" option, and give it the name of the script. That's all.

HowToUseERP5Mobile (last edited 2008-01-09 14:52:33 by BartekGorny)