|
9 | 9 |
|
10 | 10 | <!-- Add here beans related to the API context --> |
11 | 11 | <context:component-scan base-package="org.openmrs.module.ugandaemrreports" /> |
12 | | - |
13 | | - <!-- Wraps UgandaEMRSyncService methods in DB transactions and OpenMRS interceptors, |
14 | | - which set audit info like dateCreated, changedBy, etc.--> |
15 | | - <bean id="ugandaemrreports.UgandaEMRSyncService" |
16 | | - class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> |
17 | | - <property name="transactionManager"> |
18 | | - <ref bean="transactionManager" /> |
19 | | - </property> |
20 | | - <property name="target"> |
21 | | - <bean class="org.openmrs.module.ugandaemrreports.api.impl.UgandaEMRReportsServiceImpl"> |
22 | | - <property name="dao" ref="ugandaemrreports.HibernateUgandaEMRReportsDAO" /> |
23 | | - </bean> |
24 | | - </property> |
25 | | - <property name="preInterceptors"> |
26 | | - <ref bean="serviceInterceptors" /> |
27 | | - </property> |
28 | | - <property name="transactionAttributeSource"> |
29 | | - <ref bean="transactionAttributeSource" /> |
30 | | - </property> |
31 | | - </bean> |
32 | | - |
33 | | - <!-- Adds UgandaEMRSyncService to OpenMRS context so it can be accessed |
34 | | - calling Context.getService(UgandaEMRSyncService.class) --> |
35 | | - <bean parent="serviceContext"> |
| 12 | + <bean id="ugandaemrreports.reportService" parent="serviceContext"> |
36 | 13 | <property name="moduleService"> |
37 | | - <list> |
38 | | - <value>org.openmrs.module.ugandaemrreports.api.UgandaEMRReportsService</value> |
39 | | - <ref bean="ugandaemrreports.UgandaEMRSyncService" /> |
| 14 | + <list merge="true"> |
| 15 | + <value>org.openmrs.module.reportingcompatibility.service.ReportService</value> |
| 16 | + <bean class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> |
| 17 | + <property name="transactionManager"><ref bean="transactionManager"/></property> |
| 18 | + <property name="target"> |
| 19 | + <bean class="org.openmrs.report.impl.ReportServiceImpl"> |
| 20 | + <property name="reportDAO"> |
| 21 | + <bean class="org.openmrs.report.db.hibernate.HibernateReportDAO"> |
| 22 | + <property name="sessionFactory"><ref bean="sessionFactory"/></property> |
| 23 | + </bean> |
| 24 | + </property> |
| 25 | + <property name="renderers"> |
| 26 | + <map> |
| 27 | + <entry> |
| 28 | + <key><value>org.openmrs.report.impl.TsvReportRenderer</value></key> |
| 29 | + <bean class="org.openmrs.report.impl.TsvReportRenderer"/> |
| 30 | + </entry> |
| 31 | + <entry> |
| 32 | + <key><value>org.openmrs.report.impl.CsvReportRenderer</value></key> |
| 33 | + <bean class="org.openmrs.report.impl.CsvReportRenderer"/> |
| 34 | + </entry> |
| 35 | + </map> |
| 36 | + </property> |
| 37 | + </bean> |
| 38 | + </property> |
| 39 | + <property name="preInterceptors"> |
| 40 | + <ref bean="serviceInterceptors" /> |
| 41 | + </property> |
| 42 | + <property name="transactionAttributeSource"> |
| 43 | + <bean class="org.springframework.transaction.annotation.AnnotationTransactionAttributeSource"/> |
| 44 | + </property> |
| 45 | + </bean> |
40 | 46 | </list> |
41 | 47 | </property> |
42 | 48 | </bean> |
|
0 commit comments