dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #07792
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2290: delete JChartServiceTest because it failue
------------------------------------------------------------
revno: 2290
committer: Tran Thanh Tri <Tran Thanh Tri@compaq>
branch nick: trunk
timestamp: Fri 2010-10-01 10:04:13 +0700
message:
delete JChartServiceTest because it failue
removed:
dhis-2/dhis-services/dhis-service-excel-reporting/src/test/java/org/hisp/dhis/jchart/JChartServiceTest.java
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/jchart/JChart.java
dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/jchart/hibernate/JChart.hbm.xml
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/struts.xml
--
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/jchart/JChart.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/jchart/JChart.java 2010-09-30 09:37:41 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/jchart/JChart.java 2010-10-01 03:04:13 +0000
@@ -37,6 +37,7 @@
import org.hisp.dhis.period.PeriodType;
import org.hisp.dhis.period.comparator.AscendingPeriodComparator;
import org.hisp.dhis.period.comparator.PeriodComparator;
+import org.hisp.dhis.user.UserAuthorityGroup;
/**
* @author Tran Thanh Tri
@@ -53,7 +54,7 @@
private int id;
private String title;
-
+
private Set<JChartSeries> series = new HashSet<JChartSeries>();
private Set<Period> periods = new HashSet<Period>();
@@ -62,6 +63,8 @@
private String loadPeriodBy;
+ private Set<UserAuthorityGroup> userRoles = new HashSet<UserAuthorityGroup>();
+
/*
* This string is json format
*/
@@ -117,7 +120,7 @@
return ps;
}
-
+
public List<Period> getdAscendingPeriodSorted()
{
List<Period> ps = new ArrayList<Period>( this.periods );
@@ -127,6 +130,16 @@
return ps;
}
+ public void addUserAuthorityGroup( UserAuthorityGroup userAuthorityGroup )
+ {
+ this.userRoles.add( userAuthorityGroup );
+ }
+
+ public void clearAllUserRoles()
+ {
+ this.userRoles.clear();
+ }
+
// -------------------------------------------
// Getter & Setter
// -------------------------------------------
@@ -150,7 +163,7 @@
{
this.title = title;
}
-
+
public String getLegend()
{
return legend;
@@ -201,6 +214,16 @@
this.loadPeriodBy = loadPeriodBy;
}
+ public Set<UserAuthorityGroup> getUserRoles()
+ {
+ return userRoles;
+ }
+
+ public void setUserRoles( Set<UserAuthorityGroup> userRoles )
+ {
+ this.userRoles = userRoles;
+ }
+
// -------------------------------------------
// Hash Code & Equal
// -------------------------------------------
=== modified file 'dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/jchart/hibernate/JChart.hbm.xml'
--- dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/jchart/hibernate/JChart.hbm.xml 2010-09-30 09:37:41 +0000
+++ dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/org/hisp/dhis/jchart/hibernate/JChart.hbm.xml 2010-10-01 03:04:13 +0000
@@ -16,7 +16,7 @@
<property name="loadPeriodBy" column="loadperiodby" not-null="true"/>
<many-to-one name="periodType" column="periodtypeid" class="org.hisp.dhis.period.PeriodType"
- foreign-key="fk_jchart_periodtypeid" not-null="true" lazy="false"/>
+ foreign-key="fk_jchart_periodtypeid" not-null="true" lazy="false"/>
<set name="series" cascade="all" table="jchart_jchartseries">
<key column="jchartid"/>
@@ -28,6 +28,11 @@
<many-to-many column="periodid" class="org.hisp.dhis.period.Period" foreign-key="pk_jchart_period"/>
</set>
+ <set name="userRoles" table="jchart_userroles">
+ <key column="jchartid"/>
+ <many-to-many column="userroleid" class="org.hisp.dhis.user.UserAuthorityGroup" foreign-key="pk_jchart_userroleid"/>
+ </set>
+
<property name="legend" column="legend" length="1000"/>
=== removed file 'dhis-2/dhis-services/dhis-service-excel-reporting/src/test/java/org/hisp/dhis/jchart/JChartServiceTest.java'
--- dhis-2/dhis-services/dhis-service-excel-reporting/src/test/java/org/hisp/dhis/jchart/JChartServiceTest.java 2010-09-30 09:37:41 +0000
+++ dhis-2/dhis-services/dhis-service-excel-reporting/src/test/java/org/hisp/dhis/jchart/JChartServiceTest.java 1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.jchart;
-
-import static junit.framework.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import org.hisp.dhis.DhisSpringTest;
-import org.junit.Test;
-
-public class JChartServiceTest
- extends DhisSpringTest
-{
- private JChartSevice jchartService;
-
- private JChart jchart;
-
- @Override
- public void setUpTest()
- throws Exception
- {
- jchartService = (JChartSevice) getBean( JChartSevice.ID );
-
- jchart = new JChart();
- jchart.setTitle( "A" );
- jchart.setSubtitle( "B" );
- jchart.setType( "line" );
- jchart.setShowLegend( true );
-
- }
-
- @Test
- public void testSaveJChart()
- {
- // int id = jchartService.addJChart( jchart );
-
- //JChart j = jchartService.getJChart( id );
-
- String a = "a";
- String b = "a";
-
- assertTrue( a.equals( b ));
- }
-
-
-
-}
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml 2010-09-30 09:37:41 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml 2010-10-01 03:04:13 +0000
@@ -1423,6 +1423,20 @@
scope="prototype">
<property name="jchartService" ref="org.hisp.dhis.jchart.JChartService" />
</bean>
+
+ <bean id="org.hisp.dhis.reportexcel.jchart.action.UpdateJChartUserRoleAction"
+ class="org.hisp.dhis.reportexcel.jchart.action.UpdateJChartUserRoleAction"
+ scope="prototype">
+ <property name="jchartService" ref="org.hisp.dhis.jchart.JChartService" />
+ <property name="userStore" ref="org.hisp.dhis.user.UserStore" />
+ </bean>
+
+ <bean id="org.hisp.dhis.reportexcel.jchart.action.UpdateJChartUserRoleFormAction"
+ class="org.hisp.dhis.reportexcel.jchart.action.UpdateJChartUserRoleFormAction"
+ scope="prototype">
+ <property name="jchartService" ref="org.hisp.dhis.jchart.JChartService" />
+ <property name="userStore" ref="org.hisp.dhis.user.UserStore" />
+ </bean>
<bean id="org.hisp.dhis.reportexcel.jchart.action.draw.DrawJChartAction"
class="org.hisp.dhis.reportexcel.jchart.action.draw.DrawJChartAction"
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/struts.xml 2010-09-30 09:37:41 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/struts.xml 2010-10-01 03:04:13 +0000
@@ -1486,6 +1486,20 @@
<param name="requiredAuthorities">F_EXCEL_REPORT_ADMINISTRATION</param>
</action>
+ <action name="jchartAssociation"
+ class="org.hisp.dhis.reportexcel.jchart.action.UpdateJChartUserRoleFormAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-excel-reporting/chart/jchartAssociation.vm</param>
+ <param name="menu">/dhis-web-excel-reporting/menu.vm</param>
+ <param name="requiredAuthorities">F_EXCEL_REPORT_ADMINISTRATION</param>
+ </action>
+
+ <action name="updateJChartAssociation"
+ class="org.hisp.dhis.reportexcel.jchart.action.UpdateJChartUserRoleAction">
+ <result name="success" type="redirect">jcharts.action</result>
+ <param name="requiredAuthorities">F_EXCEL_REPORT_ADMINISTRATION</param>
+ </action>
+
<action name="viewJCharts"
class="org.hisp.dhis.reportexcel.datasetcompleted.action.GetSelectedOrganisationUnitAction">
<result name="success" type="chain">viewJChartsChain</result>