CloudCard Image Server is a simple application that pulls images from CloudCard into a Blackboard Transact (BbTS) database.
CloudCard Image Server allows schools using CloudCard Online Photo Submission to import their cardholders' photos directly into their BbTS database. This saves the card office time and money and helps them provide faster service to their cardholders.
CloudCard Image Server is a Grails web application, which runs on the Java Virtual Machine (JVM), and it can be deployed either as a WAR file running in a Tomcat application server or using the embedded Tomcat container that runs with the Grails framework.
- Java Version 1.7
- Grails Version 2.4.4
- Tomcat 7
- Git
- JVM Heap 256MB
- JVM PermGen 128MB
- Make sure Java is installed and accessible via the command line. You can do this by typing
java -version. If you get an error, install Java. - Install Grails 2.4.4. NOTE: Do not install the most recent version of Grails. Your Grails version must match the version with which the application was built, so you must install Grails 2.4.4. The easiest way to do this is to first install sdkman and the run
sdk install grails 2.4.4. - You should be able to type
grails --versionand see exactly this output:Grails version: 2.4.4. Do not continue until you have the correct version of Grails running at the command line. - Install Git
- Change directories to the directory into which you would like to put CloudCard Image Server. You don't need to create a subdirectory for it. It will create a directory called
cloudcard-image-serverwhen you clone it. - Clone this project.
git clone https://github.com/sharptopco/cloudcard-image-server.git. - Copy Oracle JAR into the project's lib directory.
- Change into the project directory:
cd cloudcard-image-server. - Build the WAR file:
grails war - Follow your normal procedures for deploying the WAR file to your Tomcat server(s). If you use multiple nodes, sticky sessions must be enabled.
- In the home directory of the account that runs Tomcat, add a directory called
.grails. - In the
.grailsdirectory that you just created, add the configuration filecloudcard-image-server-config.properties. - Follow the configuration steps below.
- Change into the project directory:
cd cloudcard-image-server. - Start the application:
grails run-war. - In the home directory of the account that runs Grails, add a directory called
.grails. - In the
.grailsdirectory that you just created, add the configuration filecloudcard-image-server-config.properties. - Follow the configuration steps below.
- Configuration should be in the file
~/.grails/cloudcard-image-server-config.properties. - Example file:
# CloudCard OnlinePhotoSubmission api connection
cloudcard.apiURL=https://api.cloudcardtools.com/
cloudcard.accessToken={accessToken}
# bbts datasource properties
dataSource_bbts.pooled=true
dataSource_bbts.dbCreate=validate
dataSource_bbts.driverClassName=oracle.jdbc.OracleDriver
dataSource_bbts.url=jdbc:oracle:thin:@{database url or IP address}:{port number - probably 1521}/{SID - probably BBTS}
dataSource_bbts.username={database username}
dataSource_bbts.password={database password}
dataSource_bbts.properties.maxActive=-1
dataSource_bbts.properties.minEvictableIdleTimeMillis=1800000
dataSource_bbts.properties.timeBetweenEvictionRunsMillis=1800000
dataSource_bbts.properties.numTestsPerEvictionRun=3
dataSource_bbts.properties.testOnBorrow=true
dataSource_bbts.properties.testWhileIdle=true
dataSource_bbts.properties.testOnReturn=true
dataSource_bbts.properties.validationQuery=SELECT 1 FROM DUAL
You can also configure all the above properties through JVM System Properties by prefix each property with cloudcard.. For example: cloudcard.dataSource_bbts.pooled=true. In AWS Elastic Beanstalk you can configure the system properties for the JVM in the web interface.
To get the CloudCard API AccessToken, run the shell script ./get_token.sh, and follow the prompts.
As with any application, it is always advisable to create a new database service account and to limit the priviledges of that account to the minimum access necessary to perform the desired tasks. The service account for CloudCard Image Server only needs SELECT access to the ENVISION.CUSTOMER table and SELECT, INSERT, UPDATE access to the ENVISION.CUSTOMER_PHOTO table.
You can temporarily stop the server from pinging the CloudCard API by setting the imageserver.pollingEnabled config value to false. It defaults to true. This can be useful if you are wanting to prevent errors while interrupting service on your BbTS database.