Running a Rice client application in Embedded Mode means:
A Rice client application requires three schemas:
ucd-rice-standalone-server-impl
WAR from Artifactory , selecting the most recent version. This WAR contains all dependencies.keytool -keystore rice.keystore -storepass nowUCme_nowUdont -v -alias <your alias> -genkeypair -validity 9999 -dname "CN=<your fully qualified machine name>, OU=<your organization>, O=UC Davis, L=Davis, ST=California, C=US" |
keytool -importcert -file rice-sandboxes_ucdavis_edu.pem -keystore cacerts -storepass changeit -alias rice-sandboxes.ucdavis.edu |
In Rice 1.0.x, there were only two main jars, rice-api and rice-impl. With the modularity work there are more api jars corresponding to service apis and framework components. Additionally, the implementation module has been split (though there is still a shared implementation module as not all components of the Rice implementation have been fully modularized as of the Rice 2.x.x release). This work was done according to the design outlined at the following page: Modularity Design
The libraries and their dependencies required for the modules which your application will be using must be included in your client application. Ideally you only declare the modules of rice you are using. In practice, you may need to declare them all until rice's modularity work is complete. The only modules rice recommends compiling against are api & framework modules.
Below is a list of the old 1.0.3.3 libraries and their 2.x.x counterparts:
Old Library |
New Library |
---|---|
rice-api-1.0.3.3.jar |
rice-core-api-2.x.x.jar |
|
rice-core-framework-2.x.x.jar |
|
rice-core-service-api-2.x.x.jar |
|
rice-core-service-framework-2.x.x.jar |
|
rice-edl-framework-2.x.x.jar |
|
rice-ken-api-2.x.x.jar |
|
rice-kew-api-2.x.x.jar |
|
rice-kew-framework-2.x.x.jar |
|
rice-kim-api-2.x.x.jar |
|
rice-kim-framework-2.x.x.jar |
|
rice-kns-2.x.x.jar |
|
rice-krad-app-framework-2.x.x.jar |
|
rice-krad-web-framework-2.x.x.jar |
|
rice-krms-api-2.x.x.jar |
|
rice-krms-framework-2.x.x.jar |
|
rice-ksb-api-2.x.x.jar |
|
rice-location-api-2.x.x.jar |
|
rice-location-framework-2.x.x.jar |
rice-impl-1.0.3.3.jar |
rice-impl-2.x.x.jar |
|
rice-core-impl-2.x.x.jar |
|
rice-core-service-impl-2.x.x.jar |
|
rice-edl-impl-2.x.x.jar |
|
rice-kew-impl-2.x.x.jar |
|
rice-kim-impl-2.x.x.jar |
|
rice-krms-impl-2.x.x.jar |
|
rice-ksb-client-impl-2.x.x.jar |
|
rice-ksb-server-impl-2.x.x.jar |
|
rice-location-impl-2.x.x.jar |
rice-sampleapp-1.0.3.3.jar |
rice-core-service-web-2.x.x.jar |
|
rice-core-web-2.x.x.jar |
|
rice-ksb-web-2.x.x.jar |
|
rice-location-web-2.x.x.jar |
We use a simple XML configuration to declare properties as key-value pairs. For example:
<config> <param name="datasource.ojb.platform">Oracle9i</param> <param name="datasource.platform">org.kuali.rice.core.framework.persistence.platform.OraclePlatform</param> <param name="datasource.url">jdbc:oracle:thin:@ldap://oraldap1.ucdavis.edu:389/rice_test,cn=OracleContext,dc=ucdavis.edu,dc=edu</param> <param name="datasource.driver.name">oracle.jdbc.driver.OracleDriver</param> <param name="datasource.pool.validationQuery">select 1 from duak</param> <param name="datasource.pool.maxWait">30000</param> <param name="datasource.pool.size">30</param> <param name="datasource.pool.maxActive">50</param> <param name="datasource.minIdle">7</param> <param name="datasource.initialSize">7</param> <param name="datasource.accessToUnderlyingConnectionAllowed">true</param> <param name="datasource.username">my_db_user</param> <param name="datasource.password">my_db_password</param> <config> |
|
Kuali Rice uses Java Open Transaction Manager, so we declare the appropriate beans.
<bean id="jotm" class="org.springframework.transaction.jta.JotmFactoryBean"> <property name="defaultTimeout" value="${transaction.timeout}"/> </bean> |
We must declare three data sources:
<bean id="dataSource" class="org.kuali.rice.core.framework.persistence.jdbc.datasource.XAPoolDataSource"> <property name="transactionManager" ref="jotm" /> <property name="driverClassName" value="${datasource.driver.name}" /> <property name="url" value="${datasource.url}" /> <property name="maxSize" value="${datasource.pool.size}" /> <property name="minSize" value="${datasource.initialSize}" /> <property name="maxWait" value="${datasource.pool.maxWait}" /> <property name="validationQuery" value="${datasource.pool.validationQuery}" /> <property name="username" value="${datasource.username}" /> <property name="password" value="${datasource.password}" /> </bean> |
<bean id="nonTransactionalDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="url" value="${datasource.url}"/> <property name="username" value="${datasource.username}"/> <property name="password" value="${datasource.password}"/> <property name="driverClassName" value="${datasource.driver.name}" /> <property name="initialSize" value="${datasource.initialSize}" /> <property name="minIdle" value="${datasource.minIdle}" /> <property name="maxActive" value="${datasource.maxActive}" /> <property name="maxWait" value="${datasource.maxWait}" /> <property name="validationQuery" value="${datasource.validationQuery}" /> <property name="testOnBorrow" value="${datasource.testOnBorrow}" /> <property name="testOnReturn" value="${datasource.testOnReturn}" /> <property name="testWhileIdle" value="${datasource.testWhileIdle}" /> <property name="accessToUnderlyingConnectionAllowed" value="${datasource.accessToUnderlyingConnectionAllowed}" /> </bean> |
To take advantage of pooling capabilities, |
<bean id="standaloneDataSource" class="org.kuali.rice.core.framework.persistence.jdbc.datasource.XAPoolDataSource"> <property name="transactionManager" ref="jotm" /> <property name="driverClassName" value="${standalone.datasource.driver.name}" /> <property name="url" value="${standalone.datasource.url}" /> <property name="maxSize" value="${standalone.datasource.pool.size}" /> <property name="minSize" value="${standalone.datasource.initialSize}" /> <property name="maxWait" value="${standalone.datasource.pool.maxWait}" /> <property name="validationQuery" value="${standalone.datasource.pool.validationQuery}" /> <property name="username" value="${standalone.datasource.username}" /> <property name="password" value="${standalone.datasource.password}" /> </bean> |
As of 1.0.1.1-UCD-SR1d, Rice applications will no longer encrypt workflow document content. This is accomplished by disabling encryption using the out-of-the-box non-encryption implementation (org.kuali.rice.core.impl.encryption.NoEncryptionEncryptionServiceImpl
). It is instantiated by declaring classpath:edu/ucdavis/kuali/rice/kew/config/ucd-kew-service.xml
in the Spring context.
Consequently, the encryption.key
property is no longer required.
org.kuali.rice.core.impl.encryption.NoEncryptionEncryptionServiceImpl
).classpath:edu/ucdavis/kuali/rice/krad/config/ucd-krad-service.xml
Spring file (see UCD Spring Bean Configuration).encryption.key
property (e.g. in rice-config.xml, kc-config.xml, embedded-client-config.xml, etc.).Declare the UCD-implemented Rice services:
<param name="rice.kr.additionalSpringFiles">classpath:edu/ucdavis/kuali/rice/krad/config/ucd-krad-service.xml</param> <param name="rice.kew.additionalSpringFiles">classpath:edu/ucdavis/kuali/rice/kew/config/ucd-kew-service.xml</param> |
ContextLoaderListener
, declare them in web.xml
<listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value> ... classpath:edu/ucdavis/kuali/rice/kim/config/ucd-krad-service.xml classpath:edu/ucdavis/kuali/rice/kew/config/ucd-kew-service.xml ... </param-value> </context-param> |
Finally, we declare the coreConfigurer
bean and inject all of the core data source beans.
<bean id="coreConfigurer" class="org.kuali.rice.core.impl.config.module.CoreConfigurer"> <property name="dataSource" ref="dataSource" /> <property name="nonTransactionalDataSource" ref="nonTransactionalDataSource" /> <property name="serverDataSource" ref="standaloneDataSource"/> <property name="transactionManager" ref="jotm" /> <property name="userTransaction" ref="jotm" /> </bean> <bean id="ksbConfigurer" class="org.kuali.rice.ksb.messaging.config.KSBConfigurer" depends-on="coreConfigurer"/> <bean id="knsConfigurer" class="org.kuali.rice.krad.config.KRADConfigurer" depends-on="coreConfigurer"/> <bean id="coreServiceConfigurer" class="org.kuali.rice.coreservice.impl.config.CoreServiceConfigurer" depends-on="coreConfigurer"/> <bean id="kimConfigurer" class="org.kuali.rice.kim.config.KIMConfigurer" depends-on="coreConfigurer"/> <bean id="kewConfigurer" class="org.kuali.rice.kew.config.KEWConfigurer" depends-on="coreConfigurer"/> |