Note: This software is currently not kept up to date with the updated GrowERP flutter frontend which works with Moqui Only.
This OFBiz plugin version works with the growerp frontend of december 10 2020. If you like this OFBiz plugin to work with newer GrowERP flutter versions, send a Pull request or sponsor this project, see the growerp.com website
A plugin to serve the GrowERP frontend at https://github.com/growerp/growerp
install Apache Ofbiz on Ubuntu: (works on any OS very similarly)
git clone https://github.com/apache/ofbiz-framework.git ofbiz
git clone https://github.com/apache/ofbiz-plugins.git
cp ofbiz-plugins/ofbiz-rest-impl ofbiz/plugins
git clone https://github.com/growerp/growerp-ofbiz.git ofbiz/plugins/growerp
cd ofbiz
./gradlew loadAll
./gradlew ofbiz
When in development, we need to change ofbiz to make the rest interface using http instead of https which is the OFBiz default.
file:
plugins/ofbiz-rest-impl/webapp/ofbiz-rest-jersey/WEB-INF/controller.xml
change:
from: <request-map uri="main"><security https="true"/>
To: <request-map uri="main"><security https="false"/>
Further you need apache2 in front of ofbiz. install:
sudo apt install apache2
sudo a2enmod headers
sudo a2enmod mod_proxy
sudo a2enmod mod_proxy_ajp
replace file: /etc/apache2/sites-enabled/000-default.conf with this:
<Proxy *>
AddDefaultCharset off
Order deny,allow
Allow from all
</Proxy>
ProxyVia On
<LocationMatch "/rest/">
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Headers "Authorization,ContentType"
Header always set Access-Control-Allow-Credentials "true"
</LocationMatch>
NameVirtualHost *:80
<VirtualHost *>
ServerName localhost
ServerAdmin [email protected]
ProxyRequests Off
ProxyPreserveHost On
proxyPass /rest ajp://localhost:8009/rest
proxyPassreverse /rest ajp://localhost:8009/rest
</VirtualHost>
when installed, restart apache2:
systemctl restart apache2
then the rest interface should work with http://localhost/rest
If you know a beter way to avoid the XMLHttpRequest error? Let me know!
In the admin flutter project there is a flutter test for this ofbiz component