1 Add additional spring org.jharks beans to Spring bean configuration.
Add bean to define Jharks application context provider. Allows non spring managed components of Jharks Workflow Survey Engine to access Spring managed beans. Currently this is the use of custom java classes within the XSL transformation for survey content/forms.
<!-- Define a Context Provider Spring Bean Aware -->
<bean id="org.jharks.contextApplicationContextProvider" class="org.jharks.workflow.survey.engine.web.spring.ApplicationContextProvider"/>
Add bean for new jharks cache to store database backed resource bundles.
<bean id="org.jharks.workFlowResourceBundleCache" class="org.jharks.workflow.survey.engine.cache.EhCacheBasedResourceBundleCache">
<property name="cache">
<bean
class="org.springframework.cache.ehcache.EhCacheFactoryBean">
<property name="cacheManager">
<ref bean="org.jharks.cacheManager"/>
</property>
<property name="cacheName" value="org.jharks.workFlowResourceBundleCache" />
<property name="eternal" value="false" />
<property name="overflowToDisk" value="false" />
<property name="timeToLive" value="86400" />
</bean>
</property>
</bean>
Add bean for workflow resource bundle dao.
<bean id="org.jharks.workFlowResourceBundleDao" class="org.jharks.workflow.survey.engine.dao.impl.WorkFlowResourceBundleJdbcDaoImpl">
<property name="dataSource">
<ref bean="org.jharks.dataSource"/>
</property>
</bean>
Add bean for workflow resource bundle service that references the dao and cache configured above
<bean id="org.jharks.workFlowResourceBundleService" class="org.jharks.workflow.survey.engine.service.impl.WorkFlowResourceBundleServiceImpl">
<property name="workFlowResourceBundleDao">
<ref bean="org.jharks.workFlowResourceBundleDao"/>
</property>
<property name="workFlowResourceBundleCache">
<ref bean="org.jharks.workFlowResourceBundleCache"></ref>
</property>
<property name="defaultCountryCode" value="US" />
<property name="defaultLanguageCode" value="en" />
<property name="defaultVariantCode"><null/></property>
</bean>
As you can see you can also specify the default country, language and variant code to be used for the jharks survey install.
2 Added jharks workflow survey engine specific configuration resource bundle, JharksWorkflowSurveyResources.properties which should be stored in WEB-INF/classes
3 In the call to the jharksWorkflowSurvey tag (generally within jharksDynamicPage.jsp) there is new attribute support for resourceBundleBaseName and dbBackedResources. The code addedto jharksDynamicPage.jsp was
resourceBundleBaseName="${flowContext.workFlowKey.type}" dbBackedResources="${flowContext.resourceDatabaseBackedAsFlag}"
These are pulled from the workflow context. The context is built using the value passed to the survey engine in the HTTP request parameter workflowKeyLabel to set the value for the resourceBundleBaseName. The dbBackedResource is set using the value specified in the JharksWorkflowSurveyResources.properties for the key workflow.resource.bundles.db.backed or is overridden with the optional value passed as a HTTP request parameter dbResourceBundles.
Anonymous