← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13252: Removed DefaultUserPopulator

 

------------------------------------------------------------
revno: 13252
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-12-16 14:05:53 +0100
message:
  Removed DefaultUserPopulator
removed:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/UserDefaultPopulator.java
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/DefaultIdentifiableObjectManager.java
  dhis-2/dhis-services/dhis-service-core/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 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/DefaultIdentifiableObjectManager.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/DefaultIdentifiableObjectManager.java	2013-12-16 11:09:13 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/DefaultIdentifiableObjectManager.java	2013-12-16 13:05:53 +0000
@@ -73,7 +73,7 @@
 
         for ( GenericIdentifiableObjectStore<IdentifiableObject> store : identifiableObjectStores )
         {
-            if ( store != null && store.getClass() != null )
+            if ( store != null && store.getClazz() != null )
             {
                 identifiableObjectStoreMap.put( store.getClazz(), store );
             }
@@ -83,7 +83,7 @@
 
         for ( GenericNameableObjectStore<NameableObject> store : nameableObjectStores )
         {
-            if ( store != null && store.getClass() != null )
+            if ( store != null && store.getClazz() != null )
             {
                 nameableObjectStoreMap.put( store.getClazz(), store );
             }

=== removed file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/UserDefaultPopulator.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/UserDefaultPopulator.java	2013-09-08 15:32:46 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/UserDefaultPopulator.java	1970-01-01 00:00:00 +0000
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.hisp.dhis.user;
-
-import org.hisp.dhis.system.startup.AbstractStartupRoutine;
-
- /**
- * @author Nguyen Kim Lai
- *
- * @version UserDefaultPopulator.java 9:06:11 PM Sep 8, 2013 $
- */
-public class UserDefaultPopulator
-    extends AbstractStartupRoutine
-{
-    public static final String USER_NAME = "anonymous";
-    
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-    
-    private UserService userService;
-    
-    public void setUserService( UserService userService )
-    {
-        this.userService = userService;
-    }
-
-    // -------------------------------------------------------------------------
-    // AbstractStartupRoutine implementation
-    // -------------------------------------------------------------------------
-
-    @Override
-    public void execute()
-        throws Exception
-    {
-        UserCredentials usercredential = userService.getUserCredentialsByUsername( USER_NAME );
-        
-        if( usercredential == null )
-        {
-            User user = new User();
-            usercredential = new UserCredentials();
-            usercredential.setUsername( USER_NAME );
-            usercredential.setPassword( USER_NAME );
-            usercredential.setUser( user );
-            user.setSurname( USER_NAME );
-            user.setFirstName( USER_NAME );
-            user.setUserCredentials( usercredential );
-            
-            userService.addUserCredentials( usercredential );
-            userService.addUser( user );
-        }
-    }
-}
-

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml	2013-12-16 10:17:33 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml	2013-12-16 13:05:53 +0000
@@ -894,13 +894,7 @@
     <property name="runlevel" value="7" />
     <property name="skipInTests" value="true" />
   </bean>
-  
-  <!--<bean id="org.hisp.dhis.user.UserDefaultPopulator" class="org.hisp.dhis.user.UserDefaultPopulator">
-    <property name="userService" ref="org.hisp.dhis.user.UserService" />
-    <property name="runlevel" value="5" />
-    <property name="skipInTests" value="true" />
-  </bean>-->
-  
+    
   <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
     <property name="targetObject" ref="org.hisp.dhis.system.startup.StartupRoutineExecutor" />
     <property name="targetMethod" value="addStartupRoutines" />
@@ -917,7 +911,6 @@
           <ref local="org.hisp.dhis.startup.ExpressionUpgrader" />
           <ref local="org.hisp.dhis.startup.ConfigurationPopulator" />
           <ref local="org.hisp.dhis.startup.I18nLocalePopulator" />
-          <!--<ref local="org.hisp.dhis.user.UserDefaultPopulator" />-->
         </list>
       </list>
     </property>