The keygen utility is used to generate the subscription keys and email them off to the subscriber. Normally it will be invoked automatically on the receipt of the payment for a subscription. However, it can also be run manually. If you run it manually you can run it in either GUI or command line mode - but for the GUI mode you need to have an environment that supports this, ie a Windows or unix desktop system.
See here for its installation instructions.
Invoking keygen with the --help option will display the following:
To run in GUI mode, start with no arguments
To run in Command Line mode, provide arguments
If you cannot run the program in GUI mode, then you must use the --server option
to set the mail host's parameters. These are saved in the keygen.properties
file in the .openvpms directory in the current user's home directory.
This file can be edited if you need to change the template data.
Command Line Usage: java org.openvpms.subscription.keygen.KeyGenerator
(-o|--organisation) <organisation> (-s|--subscriber) <subscriber> (-e|--email) <email> [(-d|--date) <date>] [(-i|--iSubDate) <iSubDate>] [-v|--verbose] [--validateOnly] [-?|--help] [--server serverParam1,serverParam2,...,serverParamN ] [--bcc <bcc>]
(-o|--organisation) <organisation>
Organisation Name - eg -o "Bloggs Vet Services Inc"
(-s|--subscriber) <subscriber>
Subscriber Name - eg -s "Dr Joe Bloggs"
(-e|--email) <email>
Subscriber's email address
[(-d|--date) <date>]
Date subscription expires in dd/mm/yyyy format - default Today+1year
Must be after today's date if specified (default: 07/11/2015)
[(-i|--iSubDate) <iSubDate>]
Initial subscription date in dd/mm/yyyy format
- if specified, is used to calculate the expiry date
[-v|--verbose]
Displays verbose info to the console
[--validateOnly]
Only validate - no subscription will be emailed
[-?|--help]
Provides usage documentation
[--server serverParam1,serverParam2,...,serverParamN ]
Set the mail server parameters name, port, user, password - eg
--server mail.bigpond.com,25,tg[at]bigpond[dot]com,tg1234
[--bcc <bcc>]
Set the bcc address - to clear use --bcc #
If --server or -bcc are used, other options (except verbose) are ignored
The following is a copy of the keygen readme.txt.
On a linux server, keygen should be installed in /usr/local/bin/keygen
It needs to be here because the php code in the ubercart conditional action custom php code
for the 'Run Keygen' predicate contains the line:
exec("cd /usr/local/bin/keygen/bin && ./keygen.sh ".$eargs, $output, $return);
Having installed it (by simply creating the /usr/local/bin/keygen directory and unzipping
the contents of keygen.zip into it) you can then do:
cd /usr/local/bin/keygen/bin
chmod 755 *.sh [to set the scripts as executable]
then
./keygen.sh --help
to see what to do.
You should then use the --server option to set the various SMTP parameters (see --help output).
This will create ~/.openvpms/keygen.properties
This then must be moved to the appropriate directory - it was created in your home directory - but
we need to put it the home directory of the user who is running apache - who is www-data - and
his home is /var/www
So we need to cd to /var/www and then mkdir .openvpms and copy keygen.properties into this and then
adjust the ownerships to www-data:www-data
If you need to play with keygen on a windows machine, you can unzip the package to any convenient
folder and then cd to its bin folder and then use keygen.bat