Release Management/rPath Management Console Development
Contents |
Introduction
Openbravo ERP Professional Subscription is available with a web based user interface which helps in performing initial configuration and ongoing maintenance of the deployed appliance. This document explains how to setup a development environment, how to develop a new interface and customize it.
Rationale
We use rBuilder, an rPath tool to build appliances which usually include the rPath Appliance Platform Agent (rAPA). Openbravo ERP Professional Subscription is built in it, and rAPA provides an interface to manage the appliance. An interesting feature of rAPA is that it has options to use either its native web interface or its XML-RPC calls to perform the administrative tasks. In terms of rPath this was referred as Plugin Development. Check here for more about Plugins.
rAPA Environment Setup
Prerequisites
rPath offers Application to Appliance Development Image with packages required for developing/reconfiguring rAPA plugin. If you are not using app2app, then
- Install the below packages from conary
conary update group-rapa=raa.rpath.org@rpath:rapa-3 conary update kid:runtime=conary.rpath.com@rpl:2 conary update xmlto
- Install Mercurial
- Set Python Path
export PYTHONPATH=/usr/lib/python2.4/site-packages/raa/vendor #edit /etc/sudoers Defaults env_keep="PYTHONPATH" #This is necessary because some of the scripts in the rAPA development environment attempt to run as root and pass this environment variable through the sudo utility.
Console development directory setup
- Setup raa from source
cd ~/ hg clone http://hg.rpath.com/raa cd ~/raa # Update the raa to latest version(you can skip update) hg update 3.0.2.1 # Run make to generate some file necessary to work out of directory make
- rAPA Development directory setup
mkdir ~/rapa-devel cd ~/rapa-devel/ ln -s ../raa/dev.cfg ln -s ../raa/raa ln -s ../raa/raaplugins ln -s ../raa/raa-service ln -s ../raa/start-raa-service.sh ln -s ../raa/start-raa-web.sh ln -s ../raa/raa_service_dev.conf ln -s ../raa/raa/content content ln -s ../raa/raa-web
- Configuration setup
# Create ~/rapa-devel/raa_service.conf # Add this line listenerUser username
# Create ~/rapa-devel/custom.cfg # Add this line [global] server.run_user = 'username' server.run_group = 'username' server.lock_path = '.'
- Generate test certificates
cd ~/rapa-devel su root ../raa/distro/bin/raa-gendummycert.sh $(pwd)/test.key $(pwd)/test.crt
- Setup Plugin Generator
ln -s ../raa/plugingenerator.py && ln -s ../raa/plugintemplate/
You are done with the setup. You must stop the raa service that is running on the system and then start the web and server services from the development directory instead.
- Shutdown raa
su root /sbin/service raa stop
- Start raa-web and raa-service, have separate shell/screen for each
cd ~/rapa-devel # Start raa-web to launch the web service: ./start-raa-web.sh # Open a new session/screen and start raa-service to launch the server service, this helps to monitor the status and error messages ./start-raa-service.sh
Your are now set to go, while the raa services are running rAPA interface can be accessed in a web browser using the following URL https://hostname:8003
Note: Be careful when more than one working on same machine to explore this document, as restarting raa-web, raa-service might mess up the work.
Plugin Creation
generate a template for each plugin you need to develop, use the plugin generator by running the Python script linked in ~/rapa-devel, and fill information as prompted by the script
cd ~/rapa-devel python plugingenerator.py
Add more task interfaces to your UI
Customization
- rAPA has a set of default configuration files and expected locations for overriding custom configuration files.
- Check for Openbravo Professional Edition custom-branding package
Integrate it with Appliance
- Create a new package for rapa-plugin
cd <appliance-context-path> cvc newpkg rapa-plugin-app cd rapa-plugin-app # copy the files from plugin directory cp -r ~/rapa-devel/<plugin_directory> ~/<appliance-contect-path>/rapa-plugin-app/ # Create and edit rapa-plugin-app.recipe file to incorporate the setup required for rapa-plugin # Build the rapa package rmake build rapa-plugin-app.recipe
- Add the rapa-plugin package to group
cd <appliance-context-path>/group-<app> vi group-<app>.recipe # Add this next to version, this refers from where to pick rapa package for your appliance rapaLabel = 'products.rpath.com@rpath:rapa-3' # Add rapa as r.add(rapa-plugin-app) cvc ci -m "Added rapa-plugin" cvc cook {options}
- Build the image to test.
- Openbravo-ERP has all rapa related packages here
References
- Developing rPath Appliance Platform Plugins
- rAPA Plugin Development Guide
- rAPA Customization Guide
- Download the development and customization guide here