Copy of OLE Technical Knowledgebase
- Farooq Sadiq (Unlicensed)
Kuali Open Library Environment is an open source enterprise software solution to fulfill libraries needs in terms of financial and content management. Financial management is implemented using the already developed Kuali Financial System which is bundled within OLE. Content management has been implemented using the Apache Jackrabbit and Apache Solr technologies, details of which can be found in subsequent sections or tabs on this main page.
KOLE is a mix of ant style and maven style applications. There is a maven wrapper for the ant part of the project (KFS) and so one can build the whole application using few maven commands.
Continuous Integration (CI) is vital for any project as it ensures detection of issues with the code in a timely manner and also validity of a build. OLE follows a CI process as described below.
The Kuali configuration management pool manages deployments to DEV and TEST environments in the Amazon cloud.Â
- Dev Environment - Coming soon!
- Test Environment
OLE is still in the beta phase of development with an installable release expected to be during early 2013. There have been two releases for the user community to experiment with the feature set and performance of the system up to date and the documentation can be found in the sections below;
Developer Setup
A developer's workstation can be setup by following the steps outlined below;
- KIS account - In order to have read/write access to the OLE version control repository, one must have a valid KIS account. Please contact your project manager to have an account created.Â
- Required Software
- Java SDK - Currently OLE is developed and tested using JDK 1.6 (Java 6) and soon we will be moving to JDK 1.7 (Java 7). The software can be downloaded from here.
- Maven 3.x - OLE uses maven as the build management tool and the software can be downloaded from here. Maven uses this idea of pulling down the required artifacts (jar files) from a central repository. Sometimes the dependent jars may not be found in the central repository due to licensing issues and so Kuali also maintains a repository that has our own published artifacts. A common example would be oracle jar that is not published to the central repository. In order to download jars from the Kuali repository, the settings.xml under user.home/.m2 folder needs to be updated with the following entries:Â
Maven settings.xml Expand source
<mirrors> <mirror> <id>kuali.private</id> <mirrorOf>*</mirrorOf> <url>http://nexus.kuali.org/content/groups/developer</url> </mirror> </mirrors> <servers> <server> <id>kuali.private</id> <username>developer</username> <password>[check with your project lead]</password> </server> </servers>
- Tomcat - OLE is deployed under Tomcat web container. The software can be downloaded from here. Ensure the following jars are in your tomcat.home/lib directory; ojdbc6.jar and mysql-connector-java-5.1.13.jar. These jars will be required for database connectivity when the applications are launched in tomcat.
- MySQL/Oracle - OLE supports both MySQL and Oracle and these can be downloaded from here.Â
Linux
Oracle installation is tricky on a mac/ubuntu workstations, and so as a temporary workaround, install a VM with Windows or Oracle's VirtualBox that comes with Oracle bundled.
MySQL version
At the moment the latest version of MySQL which is 5.6 wont work with the impex tool that we have. One must install the 5.5 version of the MySQL server.
- Checking out the codebase - OLE codebase can be checked out from the following SVN location.
- Building the OLE modules - OLE is made up of three modules namely OLEFS, OLELS and OLEDOCSTORE.Â
- From the root directory of where the OLE codebase has been checked out run the following maven commandÂ
mvn clean install -DskipTests=true
- Building the OLEFS application - OLEFS is the financial module with KFS as the core. KFS is an ant style project, so even though it may look it has pom file and a maven build process, behind the scenes several ant targets are called to get the application ready for deployment.
- Database setup - The default database setup is MySQL and running the following maven command will setup a clean database for OLEFS. The default username and passwords are OLE/OLE. Also the default dba username is root and password is none.
cd project-directory/ole-app/ole-fs mvn initialize -Pdb Alternatively if you have your MySQL server setup with a dba username/passoword, then update your maven command to the following and execute; mvn initialize -Pdb -Dmysql.dba.username=[fill me] -Dmysql.dba.password=[fill me]
- Verify the database got created by; there should be an entry for OLE in MySQL
- Generating the war file - The war file would have been generated as part of 4.a and can be located under project-root-directory/ole-app/ole-fs/target/olefs-[version]-webapp.war;Â
- Database setup - The default database setup is MySQL and running the following maven command will setup a clean database for OLEFS. The default username and passwords are OLE/OLE. Also the default dba username is root and password is none.
- Building the OLELS application
- Database setup - The default database setup is MySQL and can be done using the following maven commandÂ
cd project-directory/ole-rice2/ole-rice-db mvn clean install -Pdb,mysql Alternatively if you have your MySQL server setup with a dba username/password, then update your maven command to the following and execute; mvn clean install -Pdb,mysql -Dimpex.dba.username=[fill me] -Dimpex.dba.password=[fill me]
- Verify the database got created; there should be an entry for OLERICE2 in MySQL.Â
- Generating the war file - The war file would have been generated as part of 4.a and can be located under the project-root-directory/ole-rice2/ole-rice-webapp/target/ole-rice-webapp-[version].war
- Module specific configuration file - This is a file that the Rice framework will look for under user.home/kuali/main/dev on the local machine and any properties such as db connection info, application urls etc will be overridden. Copy the following file to your user.home/kuali/main/dev OLE_Rice2-config.xml. Ensure the name of the file is similar to the module name and in this case it is set to OLE_Rice2.
- Database setup - The default database setup is MySQL and can be done using the following maven commandÂ
- Building the OLEDOCSTORE application
- Database setup - OLEDOCSTORE is based on Apache Jackrabbit core and currently running the application sets up the db directly.
- Generating the war file - The war file would have been generated as part of step 4.a and can be located under the project-root-directory/ole-docstore/ole-docstore-webapp/target/oledocstore.war
- From the root directory of where the OLE codebase has been checked out run the following maven commandÂ
- Deployment to tomcat
- OLEFS - Rename the war file from 4.b.iii to olefs.war and copy it to your local tomcat's webapps folder.
- OLELS - Rename the war file from 4.c.iii to olerice2.war and copy it to your local tomcat's webapps folder.
- OLEDOCSTORE - Simply copy the oledocstore.war to your local tomcat's webapps folder.
If you dont want to perform steps a, b and c, alternatively you can point your local tomcat to the individual modules. The following lines need to be added to the file named server.xml under the tomcat.home.directory/conf folder and within the <Host> </Host> tags.
<Context docBase="project-root-directory/ole-app/ole-fs/target/ole-fs-webapp" path="/olefs"/> <Context docBase="project-root-directory/ole-rice2/ole-rice-webapp/target/ole-rice-webapp" path="/olerice2"/> <Context docBase="project-root-directory/ole-docstore/ole-docstore-webapp/target/ole-docstore-webapp-webapp" path="/oledocstore"/>
- Verify the applications are up and running:
Ensure the JAVA_OPTS have the following entry too for the memory settings; -Xms512m -Xmx1g -XX:MaxPermSize=512m
- localhost:8080/olefs
- localhost:8080/olerice2
- localhost:8080/oledocstoreÂ
The above steps have been tested and verified to get a working OLE codebase on a local developer's machine (Mac/Ubuntu). The steps should be very similar on windows too and if there are any issues, contact devops@ole.kuali.org. There are few scripts attached here also that essentially perform the steps above in an automated fashion.Â
System Variables
Ensure the following system properties are set;
OLE_WORKSPACE_ROOT
TOMCAT_HOME
On a Mac/Ubuntu this will be typically found in the .bashrc or the .profile files;
On a windows machine its set in the environment variables section under Advanced Settings in the Control Panel
- ole.sh - Script to checkout codebase and build to produce the deployable artifacts.
- db-refresh-mysql.sh - Script to refresh local MySQL DB for OLEFS and OLELS ( Ensure to update this script with the appropriate impex.dba.password (root password for your MySQL installation) )
- InitializeAndStartTomcat.sh - Script to copy the deployable artifacts to local tomcat and bring up the applications.
IDE Setup
- Developers are free to use IDE of their choice, but in Kuali the two most common ones are Eclipse and IntelliJ
Overriding default propertiesÂ
- OLEFS - In order to override the default properties we need to have a property file created in the right place where the application knows to look for.
- From the console change into the project root directoryÂ
- cd ole-app/ole-fs
- mvn generate-resources -Plocal
- This generates a file called ole-fs.properties under user.home/.kuali/ole
- OLELS
- OLEDOCSTORE
Overriding default properties contd.
 |
OLEFS |
OLELS |
OLEDOCSTORE |
---|---|---|---|
log4j.properties |
Update ole-fs.properties under user.home/.kuali/ole with the following entries |
Edit the OLE_Rice2-connfig.xml file under the "Developer Setup" section #4.b.iv with the following entry |
 |
 |
 |
 |
 |
 |
 |
 |
 |
Database Refresh Process/Changes
Database Swaps (MySQL/Oracle)
Performance Tuning
Current coding standards and best practices can be found at https://wiki.kuali.org/display/OLE/Coding+Standards. Even though developers are expected to know these, sometimes the use of code metric tools like PMD, Checkstyle and FIndBugs makes it relatively easy and often aids in code reviews and quick turn around times in identifying potential coding violations. Sonar is an open source platform that just does that i.e. monitors code quality by combining tools such as PMD, FindBugs and Checkstyle etc.
OLE is hooked into Sonar via maven and currently all the modules under OLE get executed on Sonar and metrics reported here
There are few things to look out for that absolutely need to be addressed on a regular basis;
- Violations : These are indicators in code that need to be reviewed and corrected as soon as possible. Few examples are "empty if stmt", "broken null check" etc.
- Duplications : As the name suggests, this metric reports redundancy in code and needs to be taken seriously for a reusable and robust codebase.
- Complexity : This often indicates the level of nesting in a particular method and for readability purposes the lower the number the better it is. There are several design patterns that address this and one of the most common one is the strategy pattern to replace several if-else blocks.
OLE currently comprises of three applications (war files) that have to be deployed individually. These are the olefs.war, rice2.war and the docstore.war.
Required Software
In order to install OLE, following software is needed;
1. maven 3.x
2. java jdk 1.6.x
3. tomcat 6.x
4. mysql server or oracle
# h4. Check out the codebaseÂ
-
- Trunk location: https://svn.kuali.org/repos/ole/trunk
Building Artifacts
- Run the following from the root of the folder where the project was checked out
mvn clean install -DskipTests=true
- Copy the following artifacts and place it in the webapps directory of your tomcat installation folder
- Â
ole/target/ole-fs-[particular iteration value]-webapp.war; Rename the war to olef.war
ole-rice2/ole-rice-webapp/target/ole-rice-webapp-[particular iteration value].war; Rename the war to olerice2.war
ole-docstore/ole-docstore-webapp/target/oledocstore.war; Rename the way to oledocstore.war
- Â
- Run the following from the root of the folder where the project was checked out
Generating the default configuration properties file
- Navigate to the ole folder under the main project
- Run the following command
mvn generate-resources -Plocal
- This will generate a default configuration.properties file under
~/.kuali/ole/fs/configuration.properties
The default database is mysql and the root password is set to none. You will need to change the root password to the appropriate password as set for your mysql server.
Setting up the Database
- olefs - navigate to the
ole-app
folder under the root of the project and run the following commandThe db instance chosen will be the one specified in the configuration.properties under user.home/.kuali/olefs; By default its MySQL.
mvn clean install -Pdb
- ole-rice2 - navigate to the
ole-rice2/ole-rice-db
folder under the project and run the following commandEnsure the impex.dba.password entry in the mysql.properties under ole-rice2/ole-rice-db/src/main/resources is appropriately set to whatever the password for your mysql server is. By default its set to root.
mvn clean install -Pdb,mysql
- ole-docstore - The database schema and appropriate tables gets created when the docstore application starts up as apache jackrabbit manages the setup.
- olefs - navigate to the
Configuration Files - Rice2
You will need to create a file called common-config.xml under user.home/kuali/main/dev with the following entryPaths to the keystore file and the log4j.properties files will need to be updated to reflect a more appropriate location in your system.
Ensure you change the entry for application.url from localhost to the host ip of the server where you are running the application
Rice2 Config File Expand source<\!-\- \\ Copyright 2005-2012 The Kuali Foundation \\ \\ Licensed under the Educational Community License, Version 2.0 (the "License"); \\ you may not use this file except in compliance with the License. \\ You may obtain a copy of the License at \\ \\ [http://www.opensource.org/licenses/ecl2.php]\\ \\ Unless required by applicable law or agreed to in writing, software \\ distributed under the License is distributed on an "AS IS" BASIS, \\ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \\ See the License for the specific language governing permissions and \\ limitations under the License. \\ \\ \--> \\ <config> \\ \\ <param name="rice.logging.configure">true</param> \\ \\ <\!-\- App specific parameters --> \\ <param name="application.id">olerice2</param> \\ <param name="app.code">olerice2</param> \\ <param name="app.context.name">${app.code}</param> \\ <param name="application.url">[http://localhost:8080/$]{app.context.name}</param> \\ <param name="production.environment.code">PRD</param> \\ \\ <\!-\- Misc parameters --> \\ <param name="institution">rice</param> \\ <param name="version">03/19/2007 01:59 PM</param> \\ <param name="transaction.timeout">3600</param> \\ \\ <param name="datasource.url">jdbc:mysql://localhost:3306/OLERICE2</param> \\ <param name="datasource.username">OLERICE2</param> \\ <param name="datasource.password">OLERICE2</param> \\ <param name="datasource.ojb.platform">MySQL</param> \\ <param name="datasource.platform">org.kuali.rice.core.framework.persistence.platform.MySQLDatabasePlatform</param> \\ <param name="datasource.driver.name">com.mysql.jdbc.Driver</param> \\ <param name="datasource.pool.maxWait">30000</param> \\ <param name="datasource.pool.maxSize">20</param> \\ <param name="datasource.pool.minSize">5</param> \\ \\ <param name="keystore.alias">rice</param> \\ <param name="keystore.file">${user.home}/kuali/main/dev/rice.keystore</param> \\ <param name="keystore.password">r1c3pw</param> \| <param name="dev.mode">false</param> <param name="useQuartzDatabase">false</param> <param name="Routing.ImmediateExceptionRouting">true</param> <\!-\- Kuali parameters --> <param name="encryption.key">7IC64w6ksLU</param> <param name="kfsLocator.useAppContext">true</param> <\!-\- Change Configurer Modes to LOCAL --> <param name="location.mode">LOCAL</param> <param name="coreservice.mode">LOCAL</param> <param name="ken.mode">LOCAL</param> <param name="kim.mode">LOCAL</param> <param name="kew.mode">LOCAL</param> <param name="krms.mode">LOCAL</param> <param name="ksb.mode">LOCAL</param> <param name="data.xml.root.location">[enter the user.home directory here]/kuali/main/dev/olerice2/workflow</param> <param name="data.xml.pending.location">${data.xml.root.location}/pending</param> <param name="data.xml.loaded.location">${data.xml.root.location}/loaded</param> <param name="data.xml.problem.location">${data.xml.root.location}/problem</param> <param name="filter.login.class">org.kuali.rice.kew.web.DummyLoginFilter</param> <param name="filtermapping.login.1">/*</param> <param name="config.location">classpath:META-INF/common-config-defaults.xml</param> </config>
Property Files
Running the applications
- Now that all the three application war files are copied to your tomcat folder, and the database has been set up for olefs and olerice2, its time to start tomcat
- Ensure the JAVA_OPTS have the following entry too for the memory settings; -Xms512m -Xmx1g -XX:MaxPermSize=512m
- Accessing the applications
- OLEFS - http://hostip:8080/olefs
- OLERICE2 - http://hostip:8080/olerice2
- OLEDOCSTORE - http://hostip:8080/oledocstore
Sample Data and Permissions
In order for the OLE application to be fully functional, there are permissions and sample data files that need to be ingested. This process is automated and every time the applications are brought up (after a fresh install), the following data is ingested;
a. Workflows/Permissions
b. Patrons
c. Locations
d. Circulation Policies
e. YPB Ingest ProfileÂ
Operated as a Community Resource by the Open Library Foundation