dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #04834
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1613: Add Translate function for ReportExcel module.
------------------------------------------------------------
revno: 1613
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: trunk
timestamp: Thu 2010-03-11 13:27:12 +0700
message:
Add Translate function for ReportExcel module.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcel.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelItem.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/excelitem/ExcelItem.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/excelitem/ExcelItemGroup.java
dhis-2/dhis-i18n/dhis-i18n-db/src/main/java/org/hisp/dhis/i18n/DefaultI18nService.java
dhis-2/dhis-i18n/dhis-i18n-db/src/main/java/org/hisp/dhis/i18n/I18nObject.java
dhis-2/dhis-i18n/dhis-i18n-db/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-services/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/DefaultReportExcelService.java
dhis-2/dhis-services/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/excelitem/DefaultExcelItemService.java
dhis-2/dhis-services/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/excelitem/hibernate/HibernateExcelItemStore.java
dhis-2/dhis-services/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/hibernate/HibernateReportExcelStore.java
dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/excelitem/hibernate/ExcelItem.hbm.xml
dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/excelitem/hibernate/ExcelItemGroup.hbm.xml
dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/hibernate/DataElementGroupOrder.hbm.xml
dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/hibernate/PeriodColumn.hbm.xml
dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/hibernate/ReportExcel.hbm.xml
dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/hibernate/ReportExcelItem.hbm.xml
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/excelitemgroup/action/ListAllExcelItemGroupAction.java
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module.properties
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/excelitemgroups.vm
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/excelitems.vm
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/reportItem.js
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/reportItems.vm
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/reports.vm
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription.
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcel.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcel.java 2010-02-24 07:28:03 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcel.java 2010-03-11 06:27:12 +0000
@@ -26,6 +26,7 @@
*/
package org.hisp.dhis.reportexcel;
+import java.io.Serializable;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
@@ -39,7 +40,7 @@
* @author Tran Thanh Tri
* @version $Id$
*/
-public abstract class ReportExcel
+public abstract class ReportExcel implements Serializable
{
public static class XML_TAG
{
@@ -170,6 +171,12 @@
return false;
return true;
}
+
+ @Override
+ public String toString()
+ {
+ return "[" + name + "]";
+ }
// ----------------------------------------------------------------------
// Support methord
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelItem.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelItem.java 2009-10-26 15:39:29 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelItem.java 2010-03-11 06:27:12 +0000
@@ -1,5 +1,7 @@
package org.hisp.dhis.reportexcel;
+import java.io.Serializable;
+
/*
* Copyright (c) 2004-2007, University of Oslo
* All rights reserved.
@@ -31,7 +33,7 @@
* @author Tran Thanh Tri
* @version $Id$
*/
-public class ReportExcelItem
+public class ReportExcelItem implements Serializable
{
public static class XML_TAG
{
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/excelitem/ExcelItem.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/excelitem/ExcelItem.java 2009-11-23 17:43:36 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/excelitem/ExcelItem.java 2010-03-11 06:27:12 +0000
@@ -1,6 +1,8 @@
package org.hisp.dhis.reportexcel.excelitem;
-public class ExcelItem
+import java.io.Serializable;
+
+public class ExcelItem implements Serializable
{
private int id;
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/excelitem/ExcelItemGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/excelitem/ExcelItemGroup.java 2010-03-08 04:35:44 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/excelitem/ExcelItemGroup.java 2010-03-11 06:27:12 +0000
@@ -27,6 +27,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import java.io.Serializable;
import java.util.List;
import java.util.Set;
@@ -40,7 +41,7 @@
* @version $Id$
*/
-public class ExcelItemGroup
+public class ExcelItemGroup implements Serializable
{
private int id;
=== modified file 'dhis-2/dhis-i18n/dhis-i18n-db/src/main/java/org/hisp/dhis/i18n/DefaultI18nService.java'
--- dhis-2/dhis-i18n/dhis-i18n-db/src/main/java/org/hisp/dhis/i18n/DefaultI18nService.java 2010-01-19 13:51:49 +0000
+++ dhis-2/dhis-i18n/dhis-i18n-db/src/main/java/org/hisp/dhis/i18n/DefaultI18nService.java 2010-03-11 06:27:12 +0000
@@ -84,7 +84,7 @@
// -------------------------------------------------------------------------
public void internationalise( Object object )
- {
+ {
if ( isCollection( object ) )
{
internationaliseCollection( (Collection<?>)object );
@@ -96,7 +96,7 @@
private void internationalise( Object object, Locale locale )
{
I18nObject i18nObject = isI18nObject( object );
-
+
if ( i18nObject != null && locale != null )
{
Collection<Translation> translations = translationService.getTranslations( getClassName( object ), getId( object ), locale );
@@ -143,27 +143,27 @@
{
return;
}
-
+
I18nObject i18nObject = isI18nObject( intObjects.iterator().next() );
-
+
+
Locale locale = localeManager.getCurrentLocale();
if ( i18nObject != null && locale != null )
- {
+ {
Collection<Translation> allTranslations = translationService.getTranslations( i18nObject.getClassName(), locale );
-
+
Collection<Translation> fallbackTranslations = null; // Not initialized unless needed
Map<String, String> fallbackTranslationsMap = null; // Not initialized unless needed
for ( Object object : intObjects )
{
Map<String, String> translations = getTranslationsForObject( allTranslations, getId( object ) );
-
for ( Map.Entry<String,String> translation : translations.entrySet() )
{
String property = translation.getKey();
String value = translation.getValue();
-
+
if ( value != null && !value.isEmpty() )
{
setProperty( object, property, value );
@@ -196,7 +196,7 @@
public void addObject( Object object )
{
I18nObject i18nObject = isI18nObject( object );
-
+
Locale locale = localeManager.getCurrentLocale();
if ( i18nObject != null && locale != null )
=== modified file 'dhis-2/dhis-i18n/dhis-i18n-db/src/main/java/org/hisp/dhis/i18n/I18nObject.java'
--- dhis-2/dhis-i18n/dhis-i18n-db/src/main/java/org/hisp/dhis/i18n/I18nObject.java 2009-11-04 09:15:04 +0000
+++ dhis-2/dhis-i18n/dhis-i18n-db/src/main/java/org/hisp/dhis/i18n/I18nObject.java 2010-03-11 06:27:12 +0000
@@ -65,7 +65,7 @@
{
return false;
}
-
+
return className.equalsIgnoreCase( object.getClass().getSimpleName() );
}
}
=== modified file 'dhis-2/dhis-i18n/dhis-i18n-db/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-i18n/dhis-i18n-db/src/main/resources/META-INF/dhis/beans.xml 2010-03-10 09:10:48 +0000
+++ dhis-2/dhis-i18n/dhis-i18n-db/src/main/resources/META-INF/dhis/beans.xml 2010-03-11 06:27:12 +0000
@@ -151,6 +151,69 @@
</property>
</bean>
+ <bean id="I18nReportExcelNormal" class="org.hisp.dhis.i18n.I18nObject">
+ <property name="className" value="ReportExcelNormal" />
+ <property name="propertyNames">
+ <list>
+ <value>name</value>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="I18nReportExcelCategory" class="org.hisp.dhis.i18n.I18nObject">
+ <property name="className" value="ReportExcelCategory" />
+ <property name="propertyNames">
+ <list>
+ <value>name</value>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="I18nReportExcelOganiztionGroupListing" class="org.hisp.dhis.i18n.I18nObject">
+ <property name="className" value="ReportExcelOganiztionGroupListing" />
+ <property name="propertyNames">
+ <list>
+ <value>name</value>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="I18nReportExcelPeriodColumnListing" class="org.hisp.dhis.i18n.I18nObject">
+ <property name="className" value="ReportExcelPeriodColumnListing" />
+ <property name="propertyNames">
+ <list>
+ <value>name</value>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="I18nReportExcelItem" class="org.hisp.dhis.i18n.I18nObject">
+ <property name="className" value="ReportExcelItem" />
+ <property name="propertyNames">
+ <list>
+ <value>name</value>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="I18nExcelItemGroup" class="org.hisp.dhis.i18n.I18nObject">
+ <property name="className" value="ExcelItemGroup" />
+ <property name="propertyNames">
+ <list>
+ <value>name</value>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="I18nExcelItem" class="org.hisp.dhis.i18n.I18nObject">
+ <property name="className" value="ExcelItem" />
+ <property name="propertyNames">
+ <list>
+ <value>name</value>
+ </list>
+ </property>
+ </bean>
+
<!-- I18nService -->
<bean id="org.hisp.dhis.i18n.I18nService" class="org.hisp.dhis.i18n.DefaultI18nService">
@@ -172,6 +235,13 @@
<ref bean="I18nIndicatorGroupSet" />
<ref bean="I18nDataSet" />
<ref bean="I18nOrganisationUnit" />
+ <ref bean="I18nReportExcelNormal" />
+ <ref bean="I18nReportExcelCategory" />
+ <ref bean="I18nReportExcelOganiztionGroupListing" />
+ <ref bean="I18nReportExcelPeriodColumnListing" />
+ <ref bean="I18nReportExcelItem" />
+ <ref bean="I18nExcelItemGroup" />
+ <ref bean="I18nExcelItem" />
</list>
</property>
</bean>
=== modified file 'dhis-2/dhis-services/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/DefaultReportExcelService.java'
--- dhis-2/dhis-services/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/DefaultReportExcelService.java 2010-02-24 08:56:35 +0000
+++ dhis-2/dhis-services/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/DefaultReportExcelService.java 2010-03-11 06:27:12 +0000
@@ -26,10 +26,13 @@
*/
package org.hisp.dhis.reportexcel;
+import static org.hisp.dhis.i18n.I18nUtils.i18n;
+
import java.util.ArrayList;
import java.util.Collection;
import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.i18n.I18nService;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.period.Period;
import org.hisp.dhis.reportexcel.status.DataEntryStatus;
@@ -41,7 +44,7 @@
/**
* @author Tran Thanh Tri
- * @version $Id$
+ * @version $Id: DefaultReportExcelService.java 2010-03-11 11:52:20Z Chau Thu Tran $ $
*/
@Transactional
public class DefaultReportExcelService
@@ -65,50 +68,65 @@
this.userStore = userStore;
}
+ private I18nService i18nService;
+
+ public void setI18nService( I18nService i18nService )
+ {
+ this.i18nService = i18nService;
+ }
+
// --------------------------------------
// Service of Report
// --------------------------------------
public int addReportExcel( ReportExcel report )
{
- return reportStore.addReportExcel( report );
+ int id = reportStore.addReportExcel( report );
+
+ i18nService.addObject( report );
+
+ return id;
}
public void updateReportExcel( ReportExcel report )
{
reportStore.updateReportExcel( report );
+
+ i18nService.verify( report );
}
public void deleteReportExcel( int id )
{
+ i18nService.removeObject( reportStore.getReportExcel( id ) );
+
reportStore.deleteReportExcel( id );
}
public ReportExcel getReportExcel( int id )
{
- return reportStore.getReportExcel( id );
+ return i18n( i18nService, reportStore.getReportExcel( id ) );
}
public ReportExcel getReportExcel( String name )
{
- return reportStore.getReportExcel( name );
+ return i18n( i18nService, reportStore.getReportExcel( name ) );
}
public Collection<ReportExcel> getReportExcelsByOrganisationUnit( OrganisationUnit organisationUnit )
{
- return reportStore.getReportExcelsByOrganisationUnit( organisationUnit );
+ return i18n( i18nService, reportStore.getReportExcelsByOrganisationUnit( organisationUnit ) );
}
public Collection<ReportExcel> getALLReportExcel()
{
- return reportStore.getALLReportExcel();
+ return i18n( i18nService, reportStore.getALLReportExcel() );
}
public Collection<ReportExcel> getReportExcels( User user, boolean superUser, String group )
{
if ( user == null || superUser )
{
- return this.getReportsByGroup( group );
+ return i18n( i18nService, this.getReportsByGroup( group ) );
}
else
@@ -119,10 +137,10 @@
for ( UserAuthorityGroup ugroup : credentials.getUserAuthorityGroups() )
{
- reports.addAll( ugroup.getReportExcels() );
+ reports.addAll( i18n( i18nService, ugroup.getReportExcels() ) );
}
- reports.retainAll( this.getReportsByGroup( group ) );
+ reports.retainAll( i18n( i18nService, this.getReportsByGroup( group ) ) );
return reports;
}
@@ -130,12 +148,12 @@
public Collection<String> getReportExcelGroups()
{
- return reportStore.getReportExcelGroups();
+ return i18n( i18nService, reportStore.getReportExcelGroups() );
}
public Collection<ReportExcel> getReportsByGroup( String group )
{
- return reportStore.getReportsByGroup( group );
+ return i18n( i18nService, reportStore.getReportsByGroup( group ) );
}
public Collection<String> getALLReportExcelTemplates()
@@ -155,7 +173,7 @@
public void updateReportExcelSystemByTemplate( String curName, String newName )
{
reportStore.updateReportWithExcelTemplate( curName, newName );
-
+
}
// --------------------------------------
@@ -165,31 +183,37 @@
public void addReportExcelItem( ReportExcelItem reportItem )
{
reportStore.addReportExcelItem( reportItem );
+
+ i18nService.addObject( reportItem );
}
public void updateReportExcelItem( ReportExcelItem reportItem )
{
reportStore.updateReportExcelItem( reportItem );
+
+ i18nService.verify( reportItem );
}
public void deleteReportExcelItem( int id )
{
+ i18nService.removeObject( reportStore.getReportExcelItem( id ) );
+
reportStore.deleteReportExcelItem( id );
}
public ReportExcelItem getReportExcelItem( int id )
{
- return reportStore.getReportExcelItem( id );
+ return i18n( i18nService, reportStore.getReportExcelItem( id ) );
}
public Collection<ReportExcelItem> getALLReportExcelItem()
{
- return reportStore.getALLReportExcelItem();
+ return i18n( i18nService, reportStore.getALLReportExcelItem() );
}
public Collection<ReportExcelItem> getReportExcelItem( int sheetNo, Integer reportId )
{
- return reportStore.getReportExcelItem( sheetNo, reportId );
+ return i18n( i18nService, reportStore.getReportExcelItem( sheetNo, reportId ) );
}
public Collection<Integer> getSheets( Integer reportId )
@@ -273,5 +297,5 @@
{
reportStore.updatePeriodColumn( periodColumn );
}
-
+
}
=== modified file 'dhis-2/dhis-services/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/excelitem/DefaultExcelItemService.java'
--- dhis-2/dhis-services/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/excelitem/DefaultExcelItemService.java 2010-03-08 04:35:44 +0000
+++ dhis-2/dhis-services/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/excelitem/DefaultExcelItemService.java 2010-03-11 06:27:12 +0000
@@ -27,8 +27,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import static org.hisp.dhis.i18n.I18nUtils.i18n;
+
import java.util.Collection;
+import org.hisp.dhis.i18n.I18nService;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.reportexcel.DataElementGroupOrder;
import org.springframework.transaction.annotation.Transactional;
@@ -53,44 +56,53 @@
this.excelItemStore = excelItemStore;
}
+ private I18nService i18nService;
+
+ public void setI18nService( I18nService service )
+ {
+ i18nService = service;
+ }
+
// --------------------------------------
// Excelitem group Services
// --------------------------------------
public int addExcelItemGroup( ExcelItemGroup excelItemGroup )
{
-
- return excelItemStore.addExcelItemGroup( excelItemGroup );
+ int id = excelItemStore.addExcelItemGroup( excelItemGroup );
+
+ i18nService.addObject( excelItemGroup );
+
+ return id;
}
public void deleteExcelItemGroup( int id )
{
+ i18nService.removeObject( excelItemStore.getExcelItemGroup( id ) );
excelItemStore.deleteExcelItemGroup( id );
}
public Collection<ExcelItemGroup> getAllExcelItemGroup()
{
-
- return excelItemStore.getAllExcelItemGroup();
+ return i18n( i18nService, excelItemStore.getAllExcelItemGroup() );
}
public ExcelItemGroup getExcelItemGroup( int id )
{
-
- return excelItemStore.getExcelItemGroup( id );
+ return i18n( i18nService, excelItemStore.getExcelItemGroup( id ) );
}
public void updateExcelItemGroup( ExcelItemGroup excelItemGroup )
{
-
excelItemStore.updateExcelItemGroup( excelItemGroup );
+
+ i18nService.verify( excelItemGroup );
}
public Collection<ExcelItemGroup> getExcelItemGroups( OrganisationUnit organisationUnit )
{
-
- return excelItemStore.getExcelItemGroups( organisationUnit );
+ return i18n( i18nService, excelItemStore.getExcelItemGroups( organisationUnit ) );
}
// --------------------------------------
@@ -100,31 +112,39 @@
public int addExcelItem( ExcelItem excelItem )
{
- return excelItemStore.addExcelItem( excelItem );
+ int id = excelItemStore.addExcelItem( excelItem );
+
+ i18nService.addObject( excelItem );
+
+ return id;
}
public void deleteExcelItem( int id )
{
+ i18nService.removeObject( excelItemStore.getExcelItem( id ) );
+
excelItemStore.deleteExcelItem( id );
}
public Collection<ExcelItem> getAllExcelItem()
{
- return excelItemStore.getAllExcelItem();
+ return i18n( i18nService, excelItemStore.getAllExcelItem() );
}
public void updateExcelItem( ExcelItem excelItem )
{
excelItemStore.updateExcelItem( excelItem );
+
+ i18nService.verify( excelItem );
}
public ExcelItem getExcelItem( int id )
{
- return excelItemStore.getExcelItem( id );
+ return i18n( i18nService, excelItemStore.getExcelItem( id ) );
}
// --------------------------------------
=== modified file 'dhis-2/dhis-services/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/excelitem/hibernate/HibernateExcelItemStore.java'
--- dhis-2/dhis-services/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/excelitem/hibernate/HibernateExcelItemStore.java 2010-03-08 04:35:44 +0000
+++ dhis-2/dhis-services/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/excelitem/hibernate/HibernateExcelItemStore.java 2010-03-11 06:27:12 +0000
@@ -13,7 +13,6 @@
import org.hisp.dhis.reportexcel.excelitem.ExcelItem;
import org.hisp.dhis.reportexcel.excelitem.ExcelItemGroup;
import org.hisp.dhis.reportexcel.excelitem.ExcelItemStore;
-import org.hisp.dhis.user.User;
/*
* Copyright (c) 2004-2007, University of Oslo
=== modified file 'dhis-2/dhis-services/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/hibernate/HibernateReportExcelStore.java'
--- dhis-2/dhis-services/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/hibernate/HibernateReportExcelStore.java 2010-02-25 04:22:49 +0000
+++ dhis-2/dhis-services/dhis-service-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/hibernate/HibernateReportExcelStore.java 2010-03-11 06:27:12 +0000
@@ -130,6 +130,8 @@
Criteria criteria = session.createCriteria( ReportExcel.class );
+ criteria.setCacheable( true );
+
return criteria.list();
}
=== modified file 'dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/META-INF/dhis/beans.xml 2009-10-30 10:01:26 +0000
+++ dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/META-INF/dhis/beans.xml 2010-03-11 06:27:12 +0000
@@ -14,6 +14,7 @@
<bean id="org.hisp.dhis.reportexcel.ReportExcelService" class="org.hisp.dhis.reportexcel.DefaultReportExcelService">
<property name="reportStore" ref="org.hisp.dhis.reportexcel.ReportExcelStore" />
<property name="userStore" ref="org.hisp.dhis.user.UserStore" />
+ <property name="i18nService" ref="org.hisp.dhis.i18n.I18nService" />
</bean>
@@ -35,5 +36,6 @@
class="org.hisp.dhis.reportexcel.excelitem.DefaultExcelItemService">
<property name="excelItemStore"
ref="org.hisp.dhis.reportexcel.excelitem.ExcelItemStore" />
+ <property name="i18nService" ref="org.hisp.dhis.i18n.I18nService" />
</bean>
</beans>
=== modified file 'dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/excelitem/hibernate/ExcelItem.hbm.xml'
--- dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/excelitem/hibernate/ExcelItem.hbm.xml 2010-02-23 04:26:05 +0000
+++ dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/excelitem/hibernate/ExcelItem.hbm.xml 2010-03-11 06:27:12 +0000
@@ -8,31 +8,33 @@
<class name="org.hisp.dhis.reportexcel.excelitem.ExcelItem"
table="excelitem">
+ <cache usage="read-write" />
+
<id name="id" column="excelitemid">
<generator class="native" />
</id>
-
- <properties name="uniqueKey" unique="true">
-
- <property name="name" column="name" not-null="true"/>
-
+
+ <properties name="uniqueKey" unique="true">
+
+ <property name="name" column="name" not-null="true" />
+
<many-to-one name="excelItemGroup" column="excelItemGroupId"
- class="org.hisp.dhis.reportexcel.excelitem.ExcelItemGroup"
- foreign-key="fk_exceltitem_group" lazy="false" insert="true" />
+ class="org.hisp.dhis.reportexcel.excelitem.ExcelItemGroup"
+ foreign-key="fk_exceltitem_group" lazy="false" insert="true" />
</properties>
-
-
-
-
- <property name="expression" column="expression" not-null="true"/>
-
- <property name="row" column="excelrow" not-null="true"/>
-
- <property name="column" column="excelcolumn" not-null="true"/>
-
- <property name="sheetNo" column="sheetNo" not-null="true"/>
-
-
+
+
+
+
+ <property name="expression" column="expression" not-null="true" />
+
+ <property name="row" column="excelrow" not-null="true" />
+
+ <property name="column" column="excelcolumn" not-null="true" />
+
+ <property name="sheetNo" column="sheetNo" not-null="true" />
+
+
</class>
</hibernate-mapping>
=== modified file 'dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/excelitem/hibernate/ExcelItemGroup.hbm.xml'
--- dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/excelitem/hibernate/ExcelItemGroup.hbm.xml 2010-03-08 04:35:44 +0000
+++ dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/excelitem/hibernate/ExcelItemGroup.hbm.xml 2010-03-11 06:27:12 +0000
@@ -6,6 +6,8 @@
<class name="org.hisp.dhis.reportexcel.excelitem.ExcelItemGroup"
table="excelitemgroup">
+ <cache usage="read-write" />
+
<id name="id" column="excelitemgroupid">
<generator class="native" />
</id>
=== modified file 'dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/hibernate/DataElementGroupOrder.hbm.xml'
--- dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/hibernate/DataElementGroupOrder.hbm.xml 2009-09-17 07:12:56 +0000
+++ dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/hibernate/DataElementGroupOrder.hbm.xml 2010-03-11 06:27:12 +0000
@@ -4,6 +4,7 @@
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="org.hisp.dhis.reportexcel.DataElementGroupOrder" table="reportexcel_dataelementgrouporders">
+ <cache usage="read-write"/>
<id name="id" column="id">
<generator class="native" />
</id>
=== modified file 'dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/hibernate/PeriodColumn.hbm.xml'
--- dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/hibernate/PeriodColumn.hbm.xml 2009-11-13 10:28:52 +0000
+++ dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/hibernate/PeriodColumn.hbm.xml 2010-03-11 06:27:12 +0000
@@ -4,6 +4,7 @@
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="org.hisp.dhis.reportexcel.PeriodColumn" table="reportexcel_periodcolumns">
+ <cache usage="read-write"/>
<id name="id" column="periodcolumnid">
<generator class="native" />
</id>
=== modified file 'dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/hibernate/ReportExcel.hbm.xml'
--- dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/hibernate/ReportExcel.hbm.xml 2010-02-24 07:28:03 +0000
+++ dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/hibernate/ReportExcel.hbm.xml 2010-03-11 06:27:12 +0000
@@ -4,6 +4,9 @@
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="org.hisp.dhis.reportexcel.ReportExcel" table="reportexcels">
+
+ <cache usage="read-write"/>
+
<id name="id" column="reportexcelid">
<generator class="native" />
</id>
=== modified file 'dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/hibernate/ReportExcelItem.hbm.xml'
--- dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/hibernate/ReportExcelItem.hbm.xml 2009-12-14 08:26:13 +0000
+++ dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/hibernate/ReportExcelItem.hbm.xml 2010-03-11 06:27:12 +0000
@@ -4,6 +4,9 @@
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="org.hisp.dhis.reportexcel.ReportExcelItem" table="reportexcel_items">
+
+ <cache usage="read-write"/>
+
<id name="id" column="reportexcelitemid">
<generator class="native" />
</id>
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/excelitemgroup/action/ListAllExcelItemGroupAction.java'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/excelitemgroup/action/ListAllExcelItemGroupAction.java 2010-03-05 08:27:33 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/excelitemgroup/action/ListAllExcelItemGroupAction.java 2010-03-11 06:27:12 +0000
@@ -39,57 +39,65 @@
import com.opensymphony.xwork2.Action;
-public class ListAllExcelItemGroupAction implements Action {
-
- // -------------------------------------------------------------
- // Dependency
- // -------------------------------------------------------------
-
- private ExcelItemService excelItemService;
-
- private PeriodService periodService;
-
- // -------------------------------------------------------------
- // Input && Output
- // -------------------------------------------------------------
-
- private List<ExcelItemGroup> excelItemGroups;
-
- private List<PeriodType> periodTypes;
-
- // -------------------------------------------------------------
- // Getters and Setters
- // -------------------------------------------------------------
-
- public void setExcelItemService(ExcelItemService excelItemService) {
- this.excelItemService = excelItemService;
- }
-
- public List<ExcelItemGroup> getExcelItemGroups() {
- return excelItemGroups;
- }
-
- public List<PeriodType> getPeriodTypes() {
- return periodTypes;
- }
-
- public void setPeriodService(PeriodService periodService) {
- this.periodService = periodService;
- }
-
- // -------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------
-
- public String execute() throws Exception {
-
- excelItemGroups = new ArrayList<ExcelItemGroup>( excelItemService.getAllExcelItemGroup());
-
- Collections.sort( excelItemGroups, new ExcelItemGroupComparator());
-
- periodTypes = periodService.getAllPeriodTypes();
-
- return SUCCESS;
- }
+public class ListAllExcelItemGroupAction
+ implements Action
+{
+
+ // -------------------------------------------------------------
+ // Dependency
+ // -------------------------------------------------------------
+
+ private ExcelItemService excelItemService;
+
+ private PeriodService periodService;
+
+ // -------------------------------------------------------------
+ // Input && Output
+ // -------------------------------------------------------------
+
+ private List<ExcelItemGroup> excelItemGroups;
+
+ private List<PeriodType> periodTypes;
+
+ // -------------------------------------------------------------
+ // Getters and Setters
+ // -------------------------------------------------------------
+
+ public void setExcelItemService( ExcelItemService excelItemService )
+ {
+ this.excelItemService = excelItemService;
+ }
+
+ public List<ExcelItemGroup> getExcelItemGroups()
+ {
+ return excelItemGroups;
+ }
+
+ public List<PeriodType> getPeriodTypes()
+ {
+ return periodTypes;
+ }
+
+ public void setPeriodService( PeriodService periodService )
+ {
+ this.periodService = periodService;
+ }
+
+ // -------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------
+
+ public String execute()
+ throws Exception
+ {
+
+ excelItemGroups = new ArrayList<ExcelItemGroup>( excelItemService.getAllExcelItemGroup() );
+
+ Collections.sort( excelItemGroups, new ExcelItemGroupComparator() );
+
+ periodTypes = periodService.getAllPeriodTypes();
+
+ return SUCCESS;
+ }
}
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module.properties 2010-03-10 10:28:44 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module.properties 2010-03-11 06:27:12 +0000
@@ -207,11 +207,14 @@
association_roles = Association roles
file_type_not_supported = File type not supported
override_confirm = File is exist. Do you want to override ?
+ready_in_use = File is ready in use. Can not delete !
+free = Free
+intro_configuration = Set a path to the directory where the excel template files are stored.
+intro_reports = Create reports and its items and to assign the organisation units or the organisation unit groups to the reports.
+intro_data_status = View the data entry status to know about data entered, reports finished or not finished yet with data entry.
+intro_clean_up = Clean files from temporary directory.
+intro_excel_item = Create template from Excel file in order to import data into database.
+intro_excel_template_management = Manage Template Excel files.
+translation_translate = Translate
template_using = File is using
-template_pending = File is pending
-intro_configuration = Set the path to the directory only store files excel template. For example: C:\ABC
-intro_reports = Create, update, view and delete the excel report. A report excel containing many report items. Excel report can in a variety of different reports. Excel report for assignment to one or more units or group units and options list.
-intro_data_status = This function is used to view the status input of data (Data is entered or not done or any missing one, etc. ..).
-intro_clean_up = This feature allows users to delete the temporary files generated during the generating report or previewing report.
-intro_excel_item = Create, update, delete and view the elements for importing data from excel files. This excel items closer to report items.
-intro_excel_template_management = Upload, rename, search, download and delete the file extension .xls or .xlsx. Users can identify which files are used and unused files to. Automatically, allowing to update excel reporting system when file names which are used to be changed.
+template_pending = File is pending
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/excelitemgroups.vm'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/excelitemgroups.vm 2010-03-08 16:36:21 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/excelitemgroups.vm 2010-03-11 06:27:12 +0000
@@ -29,22 +29,15 @@
<td align="left">
<a href="openExcelItemGroupAssociations.action?excelItemGroupId=$excelItemGroup.id" title="$i18n.getString( 'associations' )"><img src="../images/assign.png" alt="$i18n.getString( 'associations' )"></a>
<a href="listExcelItems.action?excelItemGroupId=$excelItemGroup.id" title="$i18n.getString( 'excel_item' )"><img src="../images/add_section.png" alt="$i18n.getString( 'excelitem' )"></a>
+ <a href="javascript:mode = 'edit'; openUpdateExcelItemGroup( '$excelItemGroup.id' );" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
+ <a href="javascript:translate( 'ExcelItemGroup', '$excelItemGroup.id' )" title="$i18n.getString( "translation_translate" )"><img src="../images/i18n.png" alt="$i18n.getString( "translation_translate" )"></a>
<a href="javascript:removeItem($excelItemGroup.id, '$excelItemGroup.name','$i18n.getString( 'confirm_delete' )', 'deleteExcelItemGroup.action');" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
- <a href="javascript:mode = 'edit'; openUpdateExcelItemGroup( '$excelItemGroup.id' );" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
#if($excelItemGroup.isOrganisationUnitGroupListing())
<a href="openUpdateOrgnisationUnitGroupForExcelItemGroup.action?id=$excelItemGroup.id" title="$i18n.getString( 'organisation_unit_group' )"><img src="images/group_1.jpg"/></a>
#end
#if($excelItemGroup.isCategory())
<a href="listDataElementGroupOrderForExcelItemGroup.action?id=$excelItemGroup.id" title="$i18n.getString( 'dataelement_groups' )"><img src="images/group.jpg"/></a>
#end
- <!-- #if($report.isOrganisationUnitGroupListing())
- <a href="openUpdateOrgnisationUnitGroupListingReport.action?id=$report.id" title="$i18n.getString( 'organisation_unit_group' )"><img src="images/group_1.jpg"/></a>
- #end
- #if($report.isCategory())
- <a href="listDataElementGroupOrder.action?id=$report.id" title="$i18n.getString( 'dataelement_groups' )"><img src="images/group.jpg"/></a>
-
- #end-->
-
</td>
</tr>
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/excelitems.vm'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/excelitems.vm 2010-02-23 04:26:05 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/excelitems.vm 2010-03-11 06:27:12 +0000
@@ -35,8 +35,9 @@
<td>$excelItem.column</td>
<td>$excelItem.expression</td>
<td align="center">
+ <a href="javascript:mode='update'; openUpdateExcelItem( '$excelItem.id' );" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
+ <a href="javascript:translate( 'ExcelItem', '$excelItem.id' )" title="$i18n.getString( "translation_translate" )"><img src="../images/i18n.png" alt="$i18n.getString( "translation_translate" )"></a>
<a href="javascript:removeItem( $excelItem.id, '$excelItem.name', '$i18n.getString( 'confirm_delete' )', 'deleteExcelItem.action');" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
- <a href="javascript:mode='update'; openUpdateExcelItem( '$excelItem.id' );" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
</td>
</tr>
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/reportItem.js'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/reportItem.js 2010-03-10 03:08:56 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/reportItem.js 2010-03-11 06:27:12 +0000
@@ -154,16 +154,14 @@
name:$("#name").val(),
expression:$("#expression").val(),
row:$("#row").val(),
- column:$("#column").val(),
- sheetNo:$("#sheetNo").val(),
+ column:$("#column").val(),
reportId:reportId,
itemType:$("#itemType").val(),
periodType:$("#periodType").val(),
-
+ sheetNo:$("#sheetNo").val()
}, function (data){
window.location.reload();
},'xml');
-
}
/*
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/reportItems.vm'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/reportItems.vm 2010-03-08 04:35:44 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/reportItems.vm 2010-03-11 06:27:12 +0000
@@ -48,8 +48,9 @@
<td>$encoder.htmlEncode( $reportItem.expression )</td>
<td>$encoder.htmlEncode( $reportItem.sheetNo )</td>
<td align="center">
+ <a href="javascript:openUpdateReportItem( '$reportItem.id' );" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
+ <a href="javascript:translate( 'ReportExcelItem', '$reportItem.id' )" title="$i18n.getString( "translation_translate" )"><img src="../images/i18n.png" alt="$i18n.getString( "translation_translate" )"></a>
<a href="javascript:removeItem($reportItem.id, '$reportItem.name','$i18n.getString( 'confirm_delete' )', 'deleteReportExcelItem.action');" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
- <a href="javascript:openUpdateReportItem( '$reportItem.id' );" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
</td>
</tr>
#end
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/reports.vm'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/reports.vm 2010-03-08 16:36:21 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/reports.vm 2010-03-11 06:27:12 +0000
@@ -17,7 +17,7 @@
<th>$i18n.getString('name')</th>
<th>$i18n.getString('report_type')</th>
<th>$i18n.getString('excel_template')</th>
- <th width="170px">$i18n.getString('operations')</th>
+ <th width="200px">$i18n.getString('operations')</th>
</tr>
</thead>
<tbody id="list">
@@ -29,11 +29,9 @@
<td align="left">
<a href="openDefineAssociationsForm.action?reportId=$report.id" title="$i18n.getString( 'define_associations' )"><img src="../images/assign.png" alt="$i18n.getString( 'define_associations' )"></a>
<a href="listReportExcelItemAction.action?reportId=$report.id" title="$i18n.getString( 'report_item' )"><img src="../images/add_section.png" alt="$i18n.getString( 'report_item' )"></a>
+ <a href="javascript:openUpdateReportReportExcel( $report.id );" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
+ <a href="javascript:translate( '$report.getClass().getSimpleName()', '$report.id' )" title="$i18n.getString( "translation_translate" )"><img src="../images/i18n.png" alt="$i18n.getString( "translation_translate" )"></a>
<a href="javascript:removeItem( $report.id, '$report.name', '$i18n.getString( 'confirm_delete' )', 'deleteReportExcel.action');" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
- <a href="javascript:openUpdateReportReportExcel( $report.id );" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
- <!--
- <a href="javascript:backupReportExcel( $report.id );" title="$i18n.getString( 'backup' )"><img src="../images/open.png" alt="$i18n.getString( 'backup' )"></a>
- -->
#if($report.isOrganisationUnitGroupListing())
<a href="openUpdateOrgnisationUnitGroupListingReport.action?id=$report.id" title="$i18n.getString( 'organisation_unit_group' )"><img src="images/group_1.jpg"/></a>
<a href="organisationUnitAtLevels.action?id=$report.id" title="$i18n.getString( 'set_organisationunit_group_level' )"><img src="images/organisationunitlevel.png" alt="$i18n.getString( 'set_organisationunit_group_level' )"/></a>