dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #18019
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7426: local/in bug replace userStore service to userService service
------------------------------------------------------------
revno: 7426
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-06-27 14:53:24 +0530
message:
local/in bug replace userStore service to userService service
modified:
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateLastUpdatedDataSetResultAction.java
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/mobile/action/GenerateLastUpdatedMobileDataSetResultAction.java
local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml
local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/action/AddMultipleUserAction.java
local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/action/AddUserAction.java
local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/meta/action/GenerateMetaDataReportResultAction.java
local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.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 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateLastUpdatedDataSetResultAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateLastUpdatedDataSetResultAction.java 2012-03-19 06:07:21 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateLastUpdatedDataSetResultAction.java 2012-06-27 09:23:24 +0000
@@ -52,7 +52,7 @@
import org.hisp.dhis.period.PeriodType;
import org.hisp.dhis.user.User;
import org.hisp.dhis.user.UserCredentials;
-import org.hisp.dhis.user.UserStore;
+import org.hisp.dhis.user.UserService;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.support.rowset.SqlRowSet;
@@ -137,13 +137,21 @@
this.displayPropertyHandler = displayPropertyHandler;
}
*/
+ private UserService userService;
+
+ public void setUserService( UserService userService )
+ {
+ this.userService = userService;
+ }
+
+ /*
private UserStore userStore;
public void setUserStore( UserStore userStore )
{
this.userStore = userStore;
}
-
+ */
@SuppressWarnings("unused")
private Comparator<OrganisationUnit> orgUnitComparator;
@@ -565,12 +573,13 @@
String tempUserName = sqlResultSet.getString( 1 );
if( tempUserName != null)
- {
- UserCredentials userCredentials = userStore.getUserCredentialsByUsername( tempUserName );
-
+ { UserCredentials userCredentials = userService.getUserCredentialsByUsername( tempUserName );
+ //UserCredentials userCredentials = userStore.getUserCredentialsByUsername( tempUserName );
+ //User user = userStore.getByName( tempUserName );
if( userCredentials != null )
{
- User user = userStore.getUser( userCredentials.getId() );
+ User user = userService.getUser( userCredentials.getId() );
+ //User user = userStore.getUser( userCredentials.getId() );
if( user != null )
{
=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/mobile/action/GenerateLastUpdatedMobileDataSetResultAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/mobile/action/GenerateLastUpdatedMobileDataSetResultAction.java 2012-02-02 09:56:51 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/mobile/action/GenerateLastUpdatedMobileDataSetResultAction.java 2012-06-27 09:23:24 +0000
@@ -51,7 +51,7 @@
import org.hisp.dhis.period.PeriodType;
import org.hisp.dhis.user.User;
import org.hisp.dhis.user.UserCredentials;
-import org.hisp.dhis.user.UserStore;
+import org.hisp.dhis.user.UserService;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.support.rowset.SqlRowSet;
@@ -135,13 +135,20 @@
{
this.displayPropertyHandler = displayPropertyHandler;
}
-*/
+
private UserStore userStore;
public void setUserStore( UserStore userStore )
{
this.userStore = userStore;
}
+*/
+ private UserService userService;
+
+ public void setUserService( UserService userService )
+ {
+ this.userService = userService;
+ }
@SuppressWarnings("unused")
private Comparator<OrganisationUnit> orgUnitComparator;
@@ -596,12 +603,13 @@
if( tempUserName != null)
{
- UserCredentials userCredentials = userStore.getUserCredentialsByUsername( tempUserName );
-
+ //UserCredentials userCredentials = userStore.getUserCredentialsByUsername( tempUserName );
+ UserCredentials userCredentials = userService.getUserCredentialsByUsername( tempUserName );
+ //User user = userStore.getByName( tempUserName );
if( userCredentials != null )
{
- User user = userStore.getUser( userCredentials.getId() );
-
+ //User user = userStore.getUser( userCredentials.getId() );
+ User user = userService.getUser( userCredentials.getId() );
if( user != null )
{
storedby += user.getFirstName() + " "+ user.getSurname() + " , ";
=== modified file 'local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml 2012-06-05 08:26:29 +0000
+++ local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml 2012-06-27 09:23:24 +0000
@@ -854,9 +854,12 @@
<property name="organisationUnitService">
<ref bean="org.hisp.dhis.organisationunit.OrganisationUnitService"/>
</property>
- <property name="userStore">
+<!-- <property name="userStore">
<ref bean="org.hisp.dhis.user.UserStore"/>
- </property>
+ </property>-->
+ <property name="userService">
+ <ref bean="org.hisp.dhis.user.UserService"/>
+ </property>
<property name="jdbcTemplate" ref="jdbcTemplate"/>
</bean>
@@ -944,8 +947,11 @@
<property name="organisationUnitService">
<ref bean="org.hisp.dhis.organisationunit.OrganisationUnitService"/>
</property>
- <property name="userStore">
+ <!--<property name="userStore">
<ref bean="org.hisp.dhis.user.UserStore"/>
+ </property>-->
+ <property name="userService">
+ <ref bean="org.hisp.dhis.user.UserService"/>
</property>
<property name="jdbcTemplate" ref="jdbcTemplate"/>
<!--<property name="dataValueService" ref="org.hisp.dhis.datavalue.DataValueService"/>-->
=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/action/AddMultipleUserAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/action/AddMultipleUserAction.java 2011-10-24 11:27:50 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/action/AddMultipleUserAction.java 2012-06-27 09:23:24 +0000
@@ -17,7 +17,7 @@
import org.hisp.dhis.user.User;
import org.hisp.dhis.user.UserAuthorityGroup;
import org.hisp.dhis.user.UserCredentials;
-import org.hisp.dhis.user.UserStore;
+import org.hisp.dhis.user.UserService;
import com.opensymphony.xwork2.Action;
@@ -34,14 +34,14 @@
{
this.reportService = reportService;
}
-
+ /*
private UserStore userStore;
public void setUserStore( UserStore userStore )
{
this.userStore = userStore;
}
-
+ */
private PasswordManager passwordManager;
public void setPasswordManager( PasswordManager passwordManager )
@@ -56,6 +56,13 @@
this.organisationUnitService = organisationUnitService;
}
+ private UserService userService;
+
+ public void setUserService( UserService userService )
+ {
+ this.userService = userService;
+ }
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -92,13 +99,13 @@
orgUnits.add( orgUId );
Collection<User> tempUserList = orgUId.getUsers();
-
int flag = 0;
if ( tempUserList != null )
{
for ( User u : tempUserList )
{
- UserCredentials uc = userStore.getUserCredentials( u );
+ //UserCredentials uc = userStore.getUserCredentials( u );
+ UserCredentials uc = userService.getUserCredentials( u );
if ( uc != null && uc.getUsername().equalsIgnoreCase( userId ) )
flag = 1;
}
@@ -118,12 +125,17 @@
userCredentials.setUser( user );
userCredentials.setUsername( userId );
userCredentials.setPassword( passwordManager.encodePassword( userId, passWord ) );
-
- UserAuthorityGroup group = userStore.getUserAuthorityGroup( userRoleId );
+
+ UserAuthorityGroup group = userService.getUserAuthorityGroup( userRoleId );
+
+ //UserAuthorityGroup group = userStore.getUserAuthorityGroup( userRoleId );
userCredentials.getUserAuthorityGroups().add( group );
- userStore.addUser( user );
- userStore.addUserCredentials( userCredentials );
+ //userStore.addUser( user );
+ //userStore.addUserCredentials( userCredentials );
+
+ userService.addUser( user );
+ userService.addUserCredentials( userCredentials );
System.out.println( orgUnitname + " Created" );
orgunitcount++;
}
=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/action/AddUserAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/action/AddUserAction.java 2011-04-27 17:15:13 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/action/AddUserAction.java 2012-06-27 09:23:24 +0000
@@ -13,7 +13,7 @@
import org.hisp.dhis.user.User;
import org.hisp.dhis.user.UserAuthorityGroup;
import org.hisp.dhis.user.UserCredentials;
-import org.hisp.dhis.user.UserStore;
+import org.hisp.dhis.user.UserService;
import com.opensymphony.xwork2.Action;
@@ -24,13 +24,14 @@
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
+ /*
private UserStore userStore;
public void setUserStore( UserStore userStore )
{
this.userStore = userStore;
}
-
+ */
private PasswordManager passwordManager;
public void setPasswordManager( PasswordManager passwordManager )
@@ -52,6 +53,13 @@
this.organisationUnitGroupService = organisationUnitGroupService;
}
+ private UserService userService;
+
+ public void setUserService( UserService userService )
+ {
+ this.userService = userService;
+ }
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -92,7 +100,8 @@
{
for ( User u : tempUserList )
{
- UserCredentials uc = userStore.getUserCredentials( u );
+ //UserCredentials uc = userStore.getUserCredentials( u );
+ UserCredentials uc = userService.getUserCredentials( u );
if ( uc != null && uc.getUsername().equalsIgnoreCase( username ) )
flag = 1;
}
@@ -119,11 +128,15 @@
userCredentials.setPassword( passwordManager.encodePassword( username, rawPassword ) );
//Hard Coded with the Subcenter UserRole Id
- UserAuthorityGroup group = userStore.getUserAuthorityGroup( 8 );
+ UserAuthorityGroup group = userService.getUserAuthorityGroup( 8 );
+ //UserAuthorityGroup group = userStore.getUserAuthorityGroup( 8 );
userCredentials.getUserAuthorityGroups().add( group );
- userStore.addUser( user );
- userStore.addUserCredentials( userCredentials );
+ //userStore.addUser( user );
+ //userStore.addUserCredentials( userCredentials );
+
+ userService.addUser( user );
+ userService.addUserCredentials( userCredentials );
System.out.println( username + " Created" );
}// OrgUnit For Loop End
=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/meta/action/GenerateMetaDataReportResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/meta/action/GenerateMetaDataReportResultAction.java 2012-02-02 09:56:51 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/meta/action/GenerateMetaDataReportResultAction.java 2012-06-27 09:23:24 +0000
@@ -41,7 +41,7 @@
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.reports.ReportService;
import org.hisp.dhis.user.User;
-import org.hisp.dhis.user.UserStore;
+import org.hisp.dhis.user.UserService;
import org.hisp.dhis.validation.ValidationRule;
import org.hisp.dhis.validation.ValidationRuleGroup;
import org.hisp.dhis.validation.ValidationRuleService;
@@ -141,13 +141,21 @@
{
this.validationRuleService = validationRuleService;
}
-
+ /*
private UserStore userStore;
public void setUserStore( UserStore userStore )
{
this.userStore = userStore;
}
+ */
+ private UserService userService;
+
+ public void setUserService( UserService userService )
+ {
+ this.userService = userService;
+ }
+
private ReportService reportService;
@@ -311,8 +319,9 @@
List<DataSet> datasetList = new ArrayList<DataSet>( dataSetService.getAllDataSets() );
int countdataset = datasetList.size();
-
- Collection<User> UserList = new ArrayList<User>( userStore.getAllUsers() );
+
+ //Collection<User> UserList = new ArrayList<User>( userStore.getAllUsers() );
+ Collection<User> UserList = new ArrayList<User>( userService.getAllUsers() );
int user = UserList.size();
// ----------------------------------------------------------------------
@@ -1922,8 +1931,8 @@
public void generateUserList()
throws Exception
{
- List<User> userList = new ArrayList<User>( userStore.getAllUsers() );
-
+ //List<User> userList = new ArrayList<User>( userStore.getAllUsers() );
+ List<User> userList = new ArrayList<User>( userService.getAllUsers() );
// String outputReportPath = System.getenv( "DHIS2_HOME" ) +
// File.separator + raFolderName + File.separator
// + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
=== modified file 'local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml 2012-04-16 08:47:07 +0000
+++ local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml 2012-06-27 09:23:24 +0000
@@ -518,7 +518,8 @@
<property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
<property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
<property name="validationRuleService" ref="org.hisp.dhis.validation.ValidationRuleService" />
- <property name="userStore" ref="org.hisp.dhis.user.UserStore" />
+ <!--<property name="userStore" ref="org.hisp.dhis.user.UserStore" />-->
+ <property name="userService" ref="org.hisp.dhis.user.UserService" />
<property name="expressionService" ref="org.hisp.dhis.expression.ExpressionService" />
<property name="reportService" ref="org.hisp.dhis.reports.ReportService"/>
<property name="jdbcTemplate" ref="jdbcTemplate"/>
@@ -1059,9 +1060,12 @@
<bean id="org.hisp.dhis.reports.action.AddUserAction"
class="org.hisp.dhis.reports.action.AddUserAction" scope="prototype">
- <property name="userStore">
+ <property name="userService">
+ <ref bean="org.hisp.dhis.user.UserService"/>
+ </property>
+<!-- <property name="userStore">
<ref bean="org.hisp.dhis.user.UserStore"/>
- </property>
+ </property>-->
<property name="passwordManager">
<ref bean="org.hisp.dhis.security.PasswordManager"/>
</property>
@@ -1078,9 +1082,12 @@
<bean id="org.hisp.dhis.reports.action.AddMultipleUserAction"
class="org.hisp.dhis.reports.action.AddMultipleUserAction" scope="prototype">
- <property name="userStore">
+<!-- <property name="userStore">
<ref bean="org.hisp.dhis.user.UserStore"/>
- </property>
+ </property>-->
+ <property name="userService">
+ <ref bean="org.hisp.dhis.user.UserService"/>
+ </property>
<property name="passwordManager">
<ref bean="org.hisp.dhis.security.PasswordManager"/>
</property>