← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18230: Sql view, cleanup

 

------------------------------------------------------------
revno: 18230
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-02-11 23:54:43 +0100
message:
  Sql view, cleanup
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/AddSqlViewAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/GetSqlViewObjectAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/RemoveSqlViewAction.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-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/AddSqlViewAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/AddSqlViewAction.java	2015-02-11 22:50:44 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/AddSqlViewAction.java	2015-02-11 22:54:43 +0000
@@ -28,19 +28,17 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import com.opensymphony.xwork2.Action;
 import org.hisp.dhis.sqlview.SqlView;
 import org.hisp.dhis.sqlview.SqlViewService;
 
+import com.opensymphony.xwork2.Action;
+
 /**
  * @author Dang Duy Hieu
- * @version $Id AddSqlViewAction.java July 06, 2010$
  */
 public class AddSqlViewAction
     implements Action
 {
-    private static final String REGEX = "\\s+";
-
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
@@ -93,8 +91,8 @@
     {
         SqlView sqlView = new SqlView();
 
-        sqlView.setName( reduceWhiteSpaces( name ) );
-        sqlView.setDescription( reduceWhiteSpaces( description ) );
+        sqlView.setName( name );
+        sqlView.setDescription( description );
         sqlView.setSqlQuery( sqlquery );
         sqlView.setQuery( query );
 
@@ -102,13 +100,4 @@
 
         return SUCCESS;
     }
-
-    // -------------------------------------------------------------------------
-    // Supporting methods
-    // -------------------------------------------------------------------------
-
-    private String reduceWhiteSpaces( String input )
-    {
-        return input.replaceAll( REGEX, " " ).trim();
-    }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/GetSqlViewObjectAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/GetSqlViewObjectAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/GetSqlViewObjectAction.java	2015-02-11 22:54:43 +0000
@@ -81,11 +81,6 @@
     public String execute()
         throws Exception
     {
-        if ( id == null || (id.intValue() == -1) )
-        {
-            return ERROR;
-        }
-
         sqlViewObject = sqlViewService.getSqlView( id );
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/RemoveSqlViewAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/RemoveSqlViewAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/RemoveSqlViewAction.java	2015-02-11 22:54:43 +0000
@@ -69,11 +69,6 @@
     public String execute()
         throws Exception
     {
-        if ( id == null || (id.intValue() == -1) )
-        {
-            return ERROR;
-        }
-
         sqlViewService.deleteSqlView( sqlViewService.getSqlView( id ) );
 
         return SUCCESS;