------------------------------------------------------------
revno: 15300
committer: Lars Helge Overland <larshe...@gmail.com>
branch nick: dhis2
timestamp: Mon 2014-05-19 13:42:06 +0200
message:
  Web light module, cleaned up code style
modified:
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserService.java
  
dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/relationship/DefaultRelationshipService.java
  
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/GetInterpretation.java
  
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/GetInterpretations.java
  
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/PostInterpretationComment.java


--
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/user/DefaultUserService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserService.java	2014-05-16 09:24:56 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserService.java	2014-05-19 11:42:06 +0000
@@ -682,7 +682,7 @@
 
         boolean onlyManageWithinUserGroups = (Boolean) systemSettingManager.getSystemSetting( KEY_ONLY_MANAGE_WITHIN_USER_GROUPS, false );
 
-        if ( onlyManageWithinUserGroups && !currentUserCredentials.getAllAuthorities().contains( "ALL" ) )
+        if ( onlyManageWithinUserGroups && !currentUserCredentials.getAllAuthorities().contains( UserAuthorityGroup.AUTHORITY_ALL ) )
         {
             if ( userCredentials.getUser().getGroups() != null )
             {

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/relationship/DefaultRelationshipService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/relationship/DefaultRelationshipService.java	2014-05-16 15:26:10 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/relationship/DefaultRelationshipService.java	2014-05-19 11:42:06 +0000
@@ -30,6 +30,7 @@
 
 import java.util.Collection;
 
+import org.apache.commons.lang.NotImplementedException;
 import org.hisp.dhis.trackedentity.TrackedEntityInstance;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -90,7 +91,6 @@
     public Collection<Relationship> getRelationships( TrackedEntityInstance entityInstanceA,
         RelationshipType relationshipType )
     {
-        // TODO Auto-generated method stub
-        return null;
+        throw new NotImplementedException();
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/GetInterpretation.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/GetInterpretation.java	2014-05-19 07:34:54 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/GetInterpretation.java	2014-05-19 11:42:06 +0000
@@ -1,52 +1,22 @@
 package org.hisp.dhis.light.interpretation.action;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.hisp.dhis.interpretation.Interpretation;
 import org.hisp.dhis.interpretation.InterpretationService;
 
 import com.opensymphony.xwork2.Action;
 
 /**
- * 
  * @author Paul Mark Castillo
- * 
  */
 public class GetInterpretation
     implements Action
 {
-    /**
-     * 
-     */
-    private static final Log log = LogFactory.getLog( GetInterpretations.class );
-
-    /**
-     * 
-     */
-    public GetInterpretation()
-    {
-    }
-
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
 
-    /**
-     * 
-     */
     private InterpretationService interpretationService;
 
-    /**
-     * @return the interpretationService
-     */
-    public InterpretationService getInterpretationService()
-    {
-        return interpretationService;
-    }
-
-    /**
-     * @param interpretationService the interpretationService to set
-     */
     public void setInterpretationService( InterpretationService interpretationService )
     {
         this.interpretationService = interpretationService;
@@ -56,43 +26,25 @@
     // Input & Output
     // -------------------------------------------------------------------------
 
-    /**
-     * 
-     */
     private int interpretationId;
 
-    /**
-     * @return the interpretationId
-     */
     public int getInterpretationId()
     {
         return interpretationId;
     }
 
-    /**
-     * @param interpretationId the interpretationId to set
-     */
     public void setInterpretationId( int interpretationId )
     {
         this.interpretationId = interpretationId;
     }
 
-    /**
-     * 
-     */
     private Interpretation interpretation;
 
-    /**
-     * @return the interpretation
-     */
     public Interpretation getInterpretation()
     {
         return interpretation;
     }
 
-    /**
-     * @param interpretation the interpretation to set
-     */
     public void setInterpretation( Interpretation interpretation )
     {
         this.interpretation = interpretation;
@@ -106,7 +58,8 @@
     public String execute()
         throws Exception
     {
-        setInterpretation( interpretationService.getInterpretation( getInterpretationId() ) );
+        setInterpretation( interpretationService.getInterpretation( interpretationId ) );
+        
         return SUCCESS;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/GetInterpretations.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/GetInterpretations.java	2014-05-19 07:34:54 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/GetInterpretations.java	2014-05-19 11:42:06 +0000
@@ -6,53 +6,23 @@
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.hisp.dhis.interpretation.Interpretation;
 import org.hisp.dhis.interpretation.InterpretationService;
 
 import com.opensymphony.xwork2.Action;
 
 /**
- * 
  * @author Paul Mark Castillo
- * 
  */
 public class GetInterpretations
     implements Action, Comparator<Interpretation>
 {
-    /**
-     * 
-     */
-    private static final Log log = LogFactory.getLog( GetInterpretations.class );
-
-    /**
-     * 
-     */
-    public GetInterpretations()
-    {
-    }
-
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
 
-    /**
-     * 
-     */
     private InterpretationService interpretationService;
 
-    /**
-     * @return the interpretationService
-     */
-    public InterpretationService getInterpretationService()
-    {
-        return interpretationService;
-    }
-
-    /**
-     * @param interpretationService the interpretationService to set
-     */
     public void setInterpretationService( InterpretationService interpretationService )
     {
         this.interpretationService = interpretationService;
@@ -62,22 +32,13 @@
     // Input & Output
     // -------------------------------------------------------------------------
 
-    /**
-     * 
-     */
-    List<Interpretation> interpretations;
+    private List<Interpretation> interpretations;
 
-    /**
-     * @return the interpretations
-     */
     public List<Interpretation> getInterpretations()
     {
         return interpretations;
     }
 
-    /**
-     * @param interpretations the interpretations to set
-     */
     public void setInterpretations( List<Interpretation> interpretations )
     {
         this.interpretations = interpretations;
@@ -96,6 +57,7 @@
         List<Interpretation> finalInterpretations = new ArrayList<Interpretation>();
 
         Iterator<Interpretation> i = tempInterpretations.iterator();
+    
         while ( i.hasNext() )
         {
             Interpretation currentInterpretation = i.next();

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/PostInterpretationComment.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/PostInterpretationComment.java	2014-05-19 07:34:54 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/PostInterpretationComment.java	2014-05-19 11:42:06 +0000
@@ -1,52 +1,22 @@
 package org.hisp.dhis.light.interpretation.action;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.hisp.dhis.interpretation.Interpretation;
 import org.hisp.dhis.interpretation.InterpretationService;
 
 import com.opensymphony.xwork2.Action;
 
 /**
- * 
- * @author Paul Mark Castillo
- * 
+ * @author Paul Mark Castillo 
  */
 public class PostInterpretationComment
     implements Action
 {
-    /**
-     * 
-     */
-    private static final Log log = LogFactory.getLog( GetInterpretations.class );
-
-    /**
-     * 
-     */
-    public PostInterpretationComment()
-    {
-    }
-
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
-
-    /**
-     * 
-     */
+    
     private InterpretationService interpretationService;
 
-    /**
-     * @return the interpretationService
-     */
-    public InterpretationService getInterpretationService()
-    {
-        return interpretationService;
-    }
-
-    /**
-     * @param interpretationService the interpretationService to set
-     */
     public void setInterpretationService( InterpretationService interpretationService )
     {
         this.interpretationService = interpretationService;
@@ -56,66 +26,37 @@
     // Input & Output
     // -------------------------------------------------------------------------
 
-    /**
-     * 
-     */
     private int interpretationId;
 
-    /**
-     * @return the interpretationId
-     */
     public int getInterpretationId()
     {
         return interpretationId;
     }
 
-    /**
-     * @param interpretationId the interpretationId to set
-     */
     public void setInterpretationId( int interpretationId )
     {
         this.interpretationId = interpretationId;
     }
 
-    /**
-     * 
-     */
     private Interpretation interpretation;
 
-    /**
-     * @return the interpretation
-     */
     public Interpretation getInterpretation()
     {
         return interpretation;
     }
 
-    /**
-     * @param interpretation the interpretation to set
-     */
     public void setInterpretation( Interpretation interpretation )
     {
         this.interpretation = interpretation;
     }
 
-    /**
-     * 
-     */
     private String comment;
 
-    /**
-     * 
-     * @return
-     */
     public String getComment()
     {
         return comment;
     }
 
-    /**
-     * 
-     * @param comment
-     */
     public void setComment( String comment )
     {
         this.comment = comment;
@@ -130,7 +71,9 @@
         throws Exception
     {
         setInterpretation( interpretationService.getInterpretation( getInterpretationId() ) );
+        
         interpretationService.addInterpretationComment( getInterpretation().getUid(), getComment() );
+        
         return SUCCESS;
     }
 }

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to     : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp

Reply via email to