Creating a Demo/Training Version of openVPMS on a Windows 7 Computer

CONTENTS

Introduction

This tutorial describes step-by-step preparation of an alternate demo version of openVPMS for training purposes, allowing you to run the system without compromising your main installation.

You should be logged into the PC where openVPMS resides using an account with Administrator privileges.

1. Turn Off User Account Control (UAC)


UAC is on by default on Windows 7 machines. Ostensibly to stop malware changing your system files, it gets in the way of doing ANY changes within the Program files folder and its sub-folders. Disabling UAC will not make you computer instantly vulnerable and, in the vast majority of cases, provides no more protection than a decent firewall and anti-virus sofware. If you leave UAC enabled, you will need to deal with messages such as this - even if you ARE the Administrator:
error messages interfere with editing and saving files
Ok, let's start. Click Start | Control Panel | User Accounts and Family Safety | User Accounts | Change User Account Control Settings. Drag the slider all the way down to the bottom.
the slider all the way down to the bottom
Click OK, OK. A restart message will appear.
the computer will display a restart message

Restart the computer.

2. Create Demo Database


I assume you know how to, and have performed a recent backup of your openVPMS system using MySQL Administrator.
Start MySQL Administrator and select Restore from the menu option at left.
open mysql and select restore

 

 
Click Open Backup File (1), select your file (2), and click Open (3):
open backup file

 

 
Click on Another schema and type in openvpms-demo (4), check Create database.. (5), select File Charset of latin1 (6) and click Start Restore (7):
restore to another schema

 

Once the operation is complete, click Close and exit MySQL Administrator.
once restore completed click close and exit mysql

 

 

3. Prepare openvpms-demo


Open Computer, browse to C:\Program Files\Apache Software Foundation\Tomcat n.n\webapps (n.n is your version number). Click on openvpms folder and press Ctrl-C then Ctrl-V. You may see an Administrator message. Click Continue.
you need to provide administrator permission to copy folder
Right-click on openvpms - copy, select Rename and rename folder to openvpms-demo:
rename the copied folder
In Explorer, browse to browse to C:\Program Files\Apache Software Foundation\Tomcat n.n\webapps\openvpms-demo\WEB-INF folder (1), right-click on web.xml (2) and select Edit (3).
move to WEB_INF folder and right-click to edit web.xml
The file will open in Notepad.exe. Near the top of the file (lines 10-13) you will see this block of text:

<context-param>
<param-name>webAppRootKey</param-name>
<param-value>openvpms</param-value>
</context-param>

look for line param-value openvpms
Change the openvpms in the highlighted line to read openvpms-demo, thus:

<param-value>openvpms-demo</param-value>

replace openvpms with openvpms-demo
Save and close the file.

 

Still in Explorer, browse to the classes folder. Right-click on hibernate.properties and select Open:
open hibernate.properties
Click on Select a program..... and press OK:
select notepad unselect alway use this program
Select Notepad, un-check Always use ..... and click OK:
select notepad unselect alway use this program
Look for the line hibernate.connection.url=jdbc:mysql://localhost:3306/openvpms
look for this line

and change to

hibernate.connection.url=jdbc:mysql://localhost:3306/openvpms-demo
replace with this line
Save and close the file.

4. Set Schema Privileges in MySQL Administrator


Start MySQL Administrator, log in and click on User Administration (1). Click on Schema Privileges tab (2), click on openvpms (3) and click on openvpms-demo (4):
open user account openvpms
Click on double left arrows (5), then click on Apply Changes (6):
move all privileges into left-hand window
Close MySQL Administrator.
 

 

5. Change Background Colour To Orange

You'll want to change the background colour to orange so that you and your staff will know whether you're working in the real thing (green) or the demo/training version (orange).

Browse to C:\Program Files\Apache Software Foundation\Tomcat n.n\webapps\openvpms-demo\WEB-INF\classes\org\openvpms\web\resource\style folder. Right-click ob default.stylesheet and select Edit.
open default.stylesheet in text editor
Select Notepad, un-check Always use .... and click OK:
you can use the default notepad.exe
Press Ctrl-H (or Edit | Replace) and change 339933 to FF9900, selecting Replace All.
change 339933 to FF9900
Save and close the file.

6. Restart and Test

Restart your computer.

Open Firefox and type in http://localhost:8080/openvpms-demo/app. Log in as admin/admin and you should have openVPMS in orange ready for you to use for training.
once you log in you should see orange background

To start OpenVPMS-demo on another PC on the network, you will need to type in http://IPv4_address:8080/openvpms-demo; in example below, http://192.168.1.101:8080/openvpms-demo:
log in on remote computer should show orange background

Hope this helps.



Created 20 July 2011 (Author: Yuri Sos)