← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2142: Removed resouretable _orgunitgroupsetstructure from sqlview func.

 

------------------------------------------------------------
revno: 2142
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: trunk
timestamp: Fri 2010-09-17 02:01:55 +0700
message:
  Removed resouretable _orgunitgroupsetstructure from sqlview func.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlViewJoinLib.java
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/sqlview/jdbc/JdbcSqlViewExpandStore.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlViewDesignTool.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/resourceTableForm.vm


--
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/sqlview/SqlViewJoinLib.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlViewJoinLib.java	2010-08-24 07:43:37 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlViewJoinLib.java	2010-09-16 19:01:55 +0000
@@ -33,7 +33,6 @@
  */
 public class SqlViewJoinLib
 {
-
     public static final String COCN_JOIN_CS = "JOIN _categorystructure AS _cs ON _cocn.categoryoptioncomboid = _cs.categoryoptioncomboid \n";
 
     public static final String COCN_JOIN_DV = "JOIN datavalue AS dv ON _cocn.categoryoptioncomboid = dv.categoryoptioncomboid \n";
@@ -48,8 +47,6 @@
 
     public static final String DV_JOIN_OUS = "JOIN _orgunitstructure AS _ous ON dv.sourceid = _ous.organisationunitid \n";
 
-    public static final String DV_JOIN_OUGSS = "JOIN _orgunitgroupsetstructure AS _ougss ON dv.sourceid = _ougss.organisationunitid \n";
-
     public static final String DV_JOIN_OUSTGSS = "JOIN _organisationunitgroupsetstructure AS _oustgss ON dv.sourceid = _oustgss.organisationunitid \n";
 
     public static final String OUS_JOIN_DV = "JOIN datavalue AS dv ON _ous.organisationunitid = dv.sourceid \n";
@@ -92,13 +89,6 @@
     public static final String COCN_JOIN_OUS = COCN_JOIN_DV + DV_JOIN_OUS;
 
     /**
-     * COCN_JOIN_OUGSS presents to the relationship between two resourcetables
-     * _CategoryOptionComboname and _OrgUnitGroupSetStructure through the INNER
-     * JOIN between DataValue and _OrgUnitGroupSetStructure
-     */
-    public static final String COCN_JOIN_OUGSS = COCN_JOIN_DV + DV_JOIN_OUGSS;
-
-    /**
      * COCN_JOIN_OUSTGSS presents to the relationship between two resourcetables
      * _CategoryOptionComboname and _OrganisationUnitGroupSetStructure through
      * the INNER JOIN between DataValue and _OrganisationUnitGroupSetStructure
@@ -157,13 +147,6 @@
     public static final String DEGSS_JOIN_OUS = DEGSS_JOIN_DV + DV_JOIN_OUS;
 
     /**
-     * DEGSS_JOIN_OUGSS presents to the relationship between two resourcetables
-     * _DataElementGroupSetStructure and _OrgUnitGroupSetStructure through the
-     * INNER JOIN between DataValue and _OrgUnitGroupSetStructure
-     */
-    public static final String DEGSS_JOIN_OUGSS = DEGSS_JOIN_DV + DV_JOIN_OUGSS;
-
-    /**
      * DEGSS_JOIN_OUSTGSS presents to the relationship between two
      * resourcetables _DataElementGroupSetStructure and
      * _OrganisationUnitGroupSetStructure through the INNER JOIN between

=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/sqlview/jdbc/JdbcSqlViewExpandStore.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/sqlview/jdbc/JdbcSqlViewExpandStore.java	2010-09-16 10:04:16 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/sqlview/jdbc/JdbcSqlViewExpandStore.java	2010-09-16 19:01:55 +0000
@@ -262,7 +262,7 @@
             holder.close();
         }
     }
-    
+
     @Override
     public String setUpJoinQuery( Collection<String> tableList )
     {
@@ -292,12 +292,6 @@
                     // "COCN and OUS"
                     joinQuery += SqlViewJoinLib.COCN_JOIN_OUS;
                 }
-                else if ( tableList.contains( "_ougss" ) )
-                {
-                    // "COCN and OUGSS"
-                    joinQuery += SqlViewJoinLib.COCN_JOIN_OUGSS;
-
-                }
                 else if ( tableList.contains( "_oustgss" ) )
                 {
                     // "COCN and OUSTGSS"
@@ -312,12 +306,7 @@
             {
                 joinQuery += "_orgunitstructure AS _ous \n";
 
-                if ( tableList.contains( "_ougss" ) )
-                {
-                    // "OUS and OUGSS"
-                    joinQuery += SqlViewJoinLib.OUS_JOIN_OUGSS;
-                }
-                else if ( tableList.contains( "_oustgss" ) )
+                if ( tableList.contains( "_oustgss" ) )
                 {
                     // "OUS and OUSTGSS"
                     joinQuery += SqlViewJoinLib.OUS_JOIN_OUSTGSS;
@@ -343,43 +332,6 @@
             }
 
             // -----------------------------------------------------------------
-            // ORGUNITGROUPSETSTRUCTURE
-            // -----------------------------------------------------------------
-            else if ( tableList.contains( "_ougss" ) )
-            {
-                joinQuery += "_orgunitgroupsetstructure AS _ougss \n";
-
-                if ( tableList.contains( "_cocn" ) )
-                {
-                    // "OUGSS and COCN"
-                    joinQuery += SqlViewJoinLib.OUGSS_JOIN_COCN;
-                }
-                else if ( tableList.contains( "_ous" ) )
-                {
-                    // "OUGSS and OUS"
-                    joinQuery += SqlViewJoinLib.OUGSS_JOIN_OUS;
-                }
-                else if ( tableList.contains( "_cs" ) )
-                {
-                    // "OUGSS and COCN"
-                    joinQuery += SqlViewJoinLib.OUGSS_JOIN_COCN;
-
-                    // "COCN and CS"
-                    joinQuery += SqlViewJoinLib.COCN_JOIN_CS;
-                }
-                else if ( tableList.contains( "_degss" ) )
-                {
-                    // "OUGSS and DEGSS"
-                    joinQuery += SqlViewJoinLib.OUGSS_JOIN_DEGSS;
-                }
-                else if ( tableList.contains( "_oustgss" ) )
-                {
-                    // "OUGSS and OUSTGSS"
-                    joinQuery += SqlViewJoinLib.OUGSS_JOIN_OUSTGSS;
-                }
-            }
-
-            // -----------------------------------------------------------------
             // _CATEGORYSTRUCTURE
             // -----------------------------------------------------------------
             else if ( tableList.contains( "_cs" ) )
@@ -397,11 +349,6 @@
                     // "COCN and OUS"
                     joinQuery += SqlViewJoinLib.COCN_JOIN_OUS;
                 }
-                else if ( tableList.contains( "_ougss" ) )
-                {
-                    // "COCN and OUGSS"
-                    joinQuery += SqlViewJoinLib.COCN_JOIN_OUGSS;
-                }
                 else if ( tableList.contains( "_degss" ) )
                 {
                     // "COCN and DEGSS"
@@ -431,11 +378,6 @@
                     // "DEGSS and OUS"
                     joinQuery += SqlViewJoinLib.DEGSS_JOIN_OUS;
                 }
-                else if ( tableList.contains( "_ougss" ) )
-                {
-                    // "DEGSS and OUGSS"
-                    joinQuery += SqlViewJoinLib.DEGSS_JOIN_OUGSS;
-                }
                 else if ( tableList.contains( "_cs" ) )
                 {
                     // "DEGSS and COCN and CS"
@@ -476,11 +418,6 @@
                     // "OUSTGSS and OUS"
                     joinQuery += SqlViewJoinLib.OUSTGSS_JOIN_OUS;
                 }
-                else if ( tableList.contains( "_ougss" ) )
-                {
-                    // "OUSTGSS and OUGSS"
-                    joinQuery += SqlViewJoinLib.OUSTGSS_JOIN_OUGSS;
-                }
             }
         }
         else if ( tableList.size() == 3 )
@@ -495,19 +432,11 @@
                 // "COCN and OUS"
                 joinQuery += SqlViewJoinLib.COCN_JOIN_OUS;
 
-                // "DV and OUS"
-                joinQuery += SqlViewJoinLib.DV_JOIN_OUS;
-
                 if ( tableList.contains( "_degss" ) )
                 {
                     // "DV and DEGSS"
                     joinQuery += SqlViewJoinLib.DV_JOIN_DEGSS;
                 }
-                else if ( tableList.contains( "_ougss" ) )
-                {
-                    // "OUS and OUGSS"
-                    joinQuery += SqlViewJoinLib.OUS_JOIN_OUGSS;
-                }
                 else if ( tableList.contains( "_oustgss" ) )
                 {
                     // "OUS and OUSTGSS"
@@ -521,34 +450,7 @@
             }
 
             // -----------------------------------------------------------------
-            // CategoryOptionComboname OrgUnitGroupSetStructure
-            // -----------------------------------------------------------------
-            else if ( tableList.contains( "_cocn" ) && tableList.contains( "_ougss" ) )
-            {
-                joinQuery += "_categoryoptioncomboname AS _cocn \n";
-
-                // "COCN and OUGSS"
-                joinQuery += SqlViewJoinLib.COCN_JOIN_OUGSS;
-
-                if ( tableList.contains( "_cs" ) )
-                {
-                    // "COCN and CS"
-                    joinQuery += SqlViewJoinLib.COCN_JOIN_CS;
-                }
-                else if ( tableList.contains( "_degss" ) )
-                {
-                    // "DV and DEGSS"
-                    joinQuery += SqlViewJoinLib.DV_JOIN_DEGSS;
-                }
-                else if ( tableList.contains( "_oustgss" ) )
-                {
-                    // "OUGSS and OUSTGSS"
-                    joinQuery += SqlViewJoinLib.OUGSS_JOIN_OUSTGSS;
-                }
-            }
-
-            // -----------------------------------------------------------------
-            // CategoryOptionComboname _categorystructure
+            // CategoryOptionComboname _CategoryStructure
             // -----------------------------------------------------------------
             else if ( tableList.contains( "_cocn" ) && tableList.contains( "_cs" ) )
             {
@@ -570,7 +472,7 @@
             }
 
             // -----------------------------------------------------------------
-            // CategoryOptionComboname _organisationunitgroupsetstructure
+            // CategoryOptionComboname _OrganisationUnitGroupSetStructure
             // -----------------------------------------------------------------
             else if ( tableList.contains( "_cocn" ) && tableList.contains( "_oustgss" )
                 && tableList.contains( "_degss" ) )
@@ -585,45 +487,7 @@
             }
 
             // -----------------------------------------------------------------
-            // OrgUnitStructure OrgUnitGroupSetStructure
-            // -----------------------------------------------------------------
-            else if ( tableList.contains( "_ous" ) && tableList.contains( "_ougss" ) )
-            {
-                if ( tableList.contains( "_cs" ) )
-                {
-                    joinQuery += "_categorystructure AS _cs \n";
-
-                    // "CS and COCN"
-                    joinQuery += SqlViewJoinLib.CS_JOIN_COCN;
-
-                    // "COCN and OUS"
-                    joinQuery += SqlViewJoinLib.COCN_JOIN_OUS;
-
-                    // "OUS and OUGSS"
-                    joinQuery += SqlViewJoinLib.OUS_JOIN_OUGSS;
-
-                }
-                else if ( tableList.contains( "_degss" ) )
-                {
-                    joinQuery += "_dataelementgroupsetstructure AS _degss \n";
-
-                    // "DEGSS and OUS"
-                    joinQuery += SqlViewJoinLib.DEGSS_JOIN_OUS;
-
-                    // "OUS and OUGSS"
-                    joinQuery += SqlViewJoinLib.OUS_JOIN_OUGSS;
-                }
-                else if ( tableList.contains( "_oustgss" ) )
-                {
-                    joinQuery += "_orgunitstructure AS _ous \n";
-
-                    // "OUS and OUGSS and OUSTGSS"
-                    joinQuery += SqlViewJoinLib.OUS_JOIN_OUGSS + SqlViewJoinLib.OUGSS_JOIN_OUSTGSS;
-                }
-            }
-
-            // -----------------------------------------------------------------
-            // OrgUnitStructure _categorystructure
+            // OrgUnitStructure _CategoryStructure
             // -----------------------------------------------------------------
             else if ( tableList.contains( "_ous" ) && tableList.contains( "_cs" ) )
             {
@@ -648,7 +512,7 @@
             }
 
             // -----------------------------------------------------------------
-            // OrgUnitStructure _dataelementgroupsetstructure
+            // OrgUnitStructure _DataelementGroupSetStructure
             // -----------------------------------------------------------------
             else if ( tableList.contains( "_ous" ) && tableList.contains( "_degss" ) && tableList.contains( "_oustgss" ) )
             {
@@ -663,48 +527,7 @@
             }
 
             // -----------------------------------------------------------------
-            // OrgUnitGroupSetStructure _categorystructure
-            // -----------------------------------------------------------------
-            else if ( tableList.contains( "_ougss" ) && tableList.contains( "_cs" ) )
-            {
-                joinQuery += "_categorystructure AS _cs \n";
-
-                // "CS and COCN"
-                joinQuery += SqlViewJoinLib.CS_JOIN_COCN;
-
-                // "COCN and OUGSS"
-                joinQuery += SqlViewJoinLib.COCN_JOIN_OUGSS;
-
-                if ( tableList.contains( "_degss" ) )
-                {
-                    // "DV and DEGSS"
-                    joinQuery += SqlViewJoinLib.DV_JOIN_DEGSS;
-                }
-                else if ( tableList.contains( "_oustgss" ) )
-                {
-                    // "OUGSS and OUSTGSS"
-                    joinQuery += SqlViewJoinLib.OUGSS_JOIN_OUSTGSS;
-                }
-            }
-
-            // -----------------------------------------------------------------
-            // OrgUnitGroupSetStructure _dataelementgroupsetstructure
-            // -----------------------------------------------------------------
-            else if ( tableList.contains( "_ougss" ) && tableList.contains( "_degss" )
-                && tableList.contains( "_oustgss" ) )
-            {
-                joinQuery += "_dataelementgroupsetstructure AS _degss \n";
-
-                // "DEGSS and OUGSS"
-                joinQuery += SqlViewJoinLib.DEGSS_JOIN_OUGSS;
-
-                // "OUGSS and OUSTGSS"
-                joinQuery += SqlViewJoinLib.OUGSS_JOIN_OUSTGSS;
-
-            }
-
-            // -----------------------------------------------------------------
-            // _categorystructure _dataelementgroupsetstructure
+            // _CategoryStructure _DataelementGroupSetStructure
             // -----------------------------------------------------------------
             else if ( tableList.contains( "_cs" ) && tableList.contains( "_degss" ) && tableList.contains( "_oustgss" ) )
             {
@@ -721,51 +544,9 @@
         else if ( tableList.size() == 4 )
         {
             // -----------------------------------------------------------------
-            // CategoryOptionComboname OrgUnitStructure OrgUnitGroupSetStructure
-            // -----------------------------------------------------------------
-            if ( tableList.contains( "_cocn" ) && tableList.contains( "_ous" ) && tableList.contains( "_ougss" ) )
-            {
-                if ( tableList.contains( "_cs" ) )
-                {
-                    joinQuery += "_categorystructure AS _cs \n";
-
-                    // "CS and COCN"
-                    joinQuery += SqlViewJoinLib.CS_JOIN_COCN;
-
-                    // "COCN and OUS"
-                    joinQuery += SqlViewJoinLib.COCN_JOIN_OUS;
-
-                    // "OUS and OUGSS"
-                    joinQuery += SqlViewJoinLib.OUS_JOIN_OUGSS;
-
-                }
-                else if ( tableList.contains( "_degss" ) )
-                {
-                    joinQuery += "_categoryoptioncomboname AS _cocn \n";
-
-                    // "COCN and DEGSS"
-                    joinQuery += SqlViewJoinLib.COCN_JOIN_DEGSS;
-
-                    // "DV and OUS and OUGSS"
-                    joinQuery += SqlViewJoinLib.DV_JOIN_OUS + SqlViewJoinLib.OUS_JOIN_OUGSS;
-
-                }
-                else if ( tableList.contains( "_oustgss" ) )
-                {
-                    joinQuery += "_categoryoptioncomboname AS _cocn \n";
-
-                    // "COCN and OUS"
-                    joinQuery += SqlViewJoinLib.COCN_JOIN_OUS;
-
-                    // "OUS and OUGSS and OUSTGSS"
-                    joinQuery += SqlViewJoinLib.OUS_JOIN_OUGSS + SqlViewJoinLib.OUGSS_JOIN_OUSTGSS;
-
-                }
-            }
-            // -----------------------------------------------------------------
-            // CategoryOptionComboname OrgUnitStructure _categorystructure
-            // -----------------------------------------------------------------
-            else if ( tableList.contains( "_cocn" ) && tableList.contains( "_ous" ) && tableList.contains( "_cs" ) )
+            // _CategoryOptionComboname _OrgUnitStructure _CategoryStructure
+            // -----------------------------------------------------------------
+            if ( tableList.contains( "_cocn" ) && tableList.contains( "_ous" ) && tableList.contains( "_cs" ) )
             {
                 if ( tableList.contains( "_degss" ) )
                 {
@@ -794,8 +575,8 @@
             }
 
             // -----------------------------------------------------------------
-            // CategoryOptionComboname OrgUnitStructure
-            // _dataelementgroupsetstructure
+            // _CategoryOptionComboname _OrgUnitStructure
+            // _DataelementGroupSetStructure
             // -----------------------------------------------------------------
             else if ( tableList.contains( "_cocn" ) && tableList.contains( "_ous" ) && tableList.contains( "_degss" )
                 && tableList.contains( "_oustgss" ) )
@@ -814,38 +595,8 @@
             }
 
             // -----------------------------------------------------------------
-            // CategoryOptionComboname OrgUnitGroupSetStructure
-            // _categorystructure
-            // -----------------------------------------------------------------
-            else if ( tableList.contains( "_cocn" ) && tableList.contains( "_ougss" ) && tableList.contains( "_cs" ) )
-            {
-                joinQuery += "_categorystructure AS _cs \n";
-
-                // "CS and COCN"
-                joinQuery += SqlViewJoinLib.CS_JOIN_COCN;
-
-                if ( tableList.contains( "_degss" ) )
-                {
-                    // "COCN and DEGSS"
-                    joinQuery += SqlViewJoinLib.COCN_JOIN_DEGSS;
-
-                    // "DV and OUGSS"
-                    joinQuery += SqlViewJoinLib.DV_JOIN_OUGSS;
-
-                }
-                else if ( tableList.contains( "_oustgss" ) )
-                {
-                    // "COCN and OUGSS"
-                    joinQuery += SqlViewJoinLib.COCN_JOIN_OUGSS;
-
-                    // "OUGSS and OUSTGSS"
-                    joinQuery += SqlViewJoinLib.OUGSS_JOIN_OUSTGSS;
-                }
-            }
-
-            // -----------------------------------------------------------------
-            // _categoryoptioncomboname _categorystructure
-            // _dataelementgroupsetstructure
+            // _CategoryOptionComboname _CategoryStructure
+            // _DataelementGroupSetStructure
             // -----------------------------------------------------------------
             else if ( tableList.contains( "_cocn" ) && tableList.contains( "_cs" ) && tableList.contains( "_degss" )
                 && tableList.contains( "_oustgss" ) )
@@ -864,52 +615,14 @@
             }
 
             // -----------------------------------------------------------------
-            // _orgunitstructure _orgunitgroupsetstructure _categorystructure
-            // -----------------------------------------------------------------
-            else if ( tableList.contains( "_ous" ) && tableList.contains( "_ougss" ) && tableList.contains( "_cs" ) )
-            {
-                joinQuery += "_categorystructure AS _cs \n";
-
-                // "CS and COCN"
-                joinQuery += SqlViewJoinLib.CS_JOIN_COCN;
-
-                if ( tableList.contains( "_degss" ) )
-                {
-                    // "COCN and DEGSS"
-                    joinQuery += SqlViewJoinLib.COCN_JOIN_DEGSS;
-
-                    // "DV and OUS and OUGSS"
-                    joinQuery += SqlViewJoinLib.DV_JOIN_OUS + SqlViewJoinLib.OUS_JOIN_OUGSS;
-
-                }
-                else if ( tableList.contains( "_oustgss" ) )
-                {
-                    // "DV and OUS"
-                    joinQuery += SqlViewJoinLib.DV_JOIN_OUS;
-
-                    // "OUS and OUGSS and OUSTGSS"
-                    joinQuery += SqlViewJoinLib.OUS_JOIN_OUGSS + SqlViewJoinLib.OUGSS_JOIN_OUSTGSS;
-                }
-            }
-
-            // -----------------------------------------------------------------
-            // _orgunitstructure _dataelementgroupsetstructure
-            // _organisationunitgroupsetstructure
+            // _OrgunitStructure _DataelementGroupSetStructure
+            // _OrganisationunitGroupSetStructure
             // -----------------------------------------------------------------
             else if ( tableList.contains( "_ous" ) && tableList.contains( "_degss" ) && tableList.contains( "_oustgss" ) )
             {
                 joinQuery += "_organisationunitgroupsetstructure AS _oustgss \n";
 
-                if ( tableList.contains( "_ougss" ) )
-                {
-                    // "OUSTGSS and OUGSS and OUS"
-                    joinQuery += SqlViewJoinLib.OUSTGSS_JOIN_OUGSS + SqlViewJoinLib.OUGSS_JOIN_OUS;
-
-                    // "OUS and DEGSS"
-                    joinQuery += SqlViewJoinLib.OUS_JOIN_DEGSS;
-
-                }
-                else if ( tableList.contains( "_cs" ) )
+                if ( tableList.contains( "_cs" ) )
                 {
                     // "OUSTGSS and OUS and COCN"
                     joinQuery += SqlViewJoinLib.OUSTGSS_JOIN_OUS + SqlViewJoinLib.OUS_JOIN_COCN;
@@ -918,147 +631,25 @@
                     joinQuery += SqlViewJoinLib.COCN_JOIN_CS;
                 }
             }
-
-            // -----------------------------------------------------------------
-            // OrgUnitGroupSetStructure _categorystructure
-            // _dataelementgroupsetstructure
-            // -----------------------------------------------------------------
-            else if ( tableList.contains( "_ougss" ) && tableList.contains( "_cs" ) && tableList.contains( "_degss" )
-                && tableList.contains( "_oustgss" ) )
-            {
-                joinQuery += "_categorystructure AS _cs \n";
-
-                // "CS and COCN and DEGSS"
-                joinQuery += SqlViewJoinLib.CS_JOIN_COCN + SqlViewJoinLib.COCN_JOIN_DEGSS;
-
-                // "DV and OUGSS and OUSTGSS"
-                joinQuery += SqlViewJoinLib.DV_JOIN_OUGSS + SqlViewJoinLib.OUGSS_JOIN_OUSTGSS;
-
-            }
         }
         else if ( tableList.size() == 5 )
         {
             // -----------------------------------------------------------------
-            // _categoryoptioncomboname _orgunitstructure
-            // _orgunitgroupsetstructure _categorystructure
-            // -----------------------------------------------------------------
-            if ( tableList.contains( "_cocn" ) && tableList.contains( "_ous" ) && tableList.contains( "_ougss" )
-                && tableList.contains( "_cs" ) )
-            {
-                joinQuery += "_categorystructure AS _cs \n";
-
-                // "CS and COCN"
-                joinQuery += SqlViewJoinLib.CS_JOIN_COCN;
-
-                if ( tableList.contains( "_degss" ) )
-                {
-                    // "COCN and DEGSS"
-                    joinQuery += SqlViewJoinLib.COCN_JOIN_DEGSS;
-
-                    // "DV and OUS and OUGSS"
-                    joinQuery += SqlViewJoinLib.DV_JOIN_OUS + SqlViewJoinLib.OUS_JOIN_OUGSS;
-
-                }
-                else if ( tableList.contains( "_oustgss" ) )
-                {
-                    // "COCN and OUS"
-                    joinQuery += SqlViewJoinLib.COCN_JOIN_OUS;
-
-                    // "OUS and OUGSS and OUSTGSS"
-                    joinQuery += SqlViewJoinLib.OUS_JOIN_OUGSS + SqlViewJoinLib.OUGSS_JOIN_OUSTGSS;
-                }
-            }
-
-            // -----------------------------------------------------------------
-            // _categoryoptioncomboname _orgunitstructure
-            // _dataelementgroupsetstructure _organisationunitgroupsetstructure
+            // _CategoryOptionComboname _OrgUnitStructure
+            // _DataelementGroupSetStructure _OrganisationunitGroupSetStructure
             // -----------------------------------------------------------------
             if ( tableList.contains( "_cocn" ) && tableList.contains( "_ous" ) && tableList.contains( "_degss" )
-                && tableList.contains( "_oustgss" ) )
-            {
-                if ( tableList.contains( "_cs" ) )
-                {
-                    joinQuery += "_categorystructure AS _cs \n";
-
-                    // "CS and COCN and DEGSS"
-                    joinQuery += SqlViewJoinLib.CS_JOIN_COCN + SqlViewJoinLib.COCN_JOIN_DEGSS;
-
-                    // "DV and OUS and OUSTGSS"
-                    joinQuery += SqlViewJoinLib.DV_JOIN_OUS + SqlViewJoinLib.OUS_JOIN_OUSTGSS;
-
-                }
-                else if ( tableList.contains( "_ougss" ) )
-                {
-                    joinQuery += "_categoryoptioncomboname AS _cocn \n";
-
-                    // "COCN and DEGSS"
-                    joinQuery += SqlViewJoinLib.COCN_JOIN_DEGSS;
-
-                    // "DV and OUGSS"
-                    joinQuery += SqlViewJoinLib.DV_JOIN_OUS;
-
-                    // "DEGSS and OUS and OUGSS and OUSTGSS"
-                    joinQuery += SqlViewJoinLib.OUS_JOIN_OUGSS + SqlViewJoinLib.OUGSS_JOIN_OUSTGSS;
-
-                }
-            }
-
-            // -----------------------------------------------------------------
-            // _categoryoptioncomboname _orgunitgroupsetstructure
-            // _categorystructure _dataelementgroupsetstructure
-            // -----------------------------------------------------------------
-            else if ( tableList.contains( "_cocn" ) && tableList.contains( "_ougss" ) && tableList.contains( "_cs" )
-                && tableList.contains( "_degss" ) && tableList.contains( "_oustgss" ) )
-            {
-                joinQuery += "_categorystructure AS _cs \n";
-
-                // "CS and COCN and DEGSS"
-                joinQuery += SqlViewJoinLib.CS_JOIN_COCN + SqlViewJoinLib.COCN_JOIN_DEGSS;
-
-                // "DV and OUGSS and OUSTGSS"
-                joinQuery += SqlViewJoinLib.DV_JOIN_OUGSS + SqlViewJoinLib.OUGSS_JOIN_OUSTGSS;
-            }
-
-            // -----------------------------------------------------------------
-            // _orgunitstructure _orgunitgroupsetstructure
-            // _categorystructure _dataelementgroupsetstructure
-            // _organisationunitgroupsetstructure
-            // -----------------------------------------------------------------
-            else if ( tableList.contains( "_ous" ) && tableList.contains( "_ougss" ) && tableList.contains( "_cs" )
-                && tableList.contains( "_degss" ) && tableList.contains( "_oustgss" ) )
-            {
-                joinQuery += "_organisationunitgroupsetstructure AS _oustgss \n";
-
-                // "OUSTGSS and OUGSS and OUS"
-                joinQuery += SqlViewJoinLib.OUSTGSS_JOIN_OUGSS + SqlViewJoinLib.OUGSS_JOIN_OUS;
-
-                // "OUS and DEGSS"
-                joinQuery += SqlViewJoinLib.OUS_JOIN_DEGSS;
-
-                // "DV and COCN and CS"
-                joinQuery += SqlViewJoinLib.DV_JOIN_COCN + SqlViewJoinLib.COCN_JOIN_CS;
-            }
-        }
-        else if ( tableList.size() == 6 )
-        {
-            // -----------------------------------------------------------------
-            // CategoryOptionComboname OrgUnitStructure OrgUnitGroupSetStructure
-            // _categorystructure _dataelementgroupsetstructure
-            // _organisationunitgroupsetstructure
-            // -----------------------------------------------------------------
-            if ( tableList.contains( "_cocn" ) && tableList.contains( "_ous" ) && tableList.contains( "_ougss" )
-                && tableList.contains( "_cs" ) && tableList.contains( "_degss" ) && tableList.contains( "_oustgss" ) )
-            {
-                joinQuery += "_categorystructure AS _cs \n";
-
-                // "CS and COCN and DEGSS"
-                joinQuery += SqlViewJoinLib.CS_JOIN_COCN + SqlViewJoinLib.COCN_JOIN_DEGSS;
-
-                // "DV and OUS"
-                joinQuery += SqlViewJoinLib.DV_JOIN_OUS;
-
-                // "OUS and OUGSS and OUSTGSS"
-                joinQuery += SqlViewJoinLib.OUS_JOIN_OUGSS + SqlViewJoinLib.OUGSS_JOIN_OUSTGSS;
+                && tableList.contains( "_oustgss" ) && tableList.contains( "_cs" ) )
+            {
+
+                joinQuery += "_categorystructure AS _cs \n";
+
+                // "CS and COCN and DEGSS"
+                joinQuery += SqlViewJoinLib.CS_JOIN_COCN + SqlViewJoinLib.COCN_JOIN_DEGSS;
+
+                // "DV and OUS and OUSTGSS"
+                joinQuery += SqlViewJoinLib.DV_JOIN_OUS + SqlViewJoinLib.OUS_JOIN_OUSTGSS;
+
             }
         }
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml	2010-09-16 10:04:16 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml	2010-09-16 19:01:55 +0000
@@ -397,8 +397,8 @@
 			class="org.hisp.dhis.dataadmin.action.sqlview.GetSqlViewObjectAction">
 			<result name="success" type="velocity">/main.vm</result>
 			<param name="menu">/dhis-web-maintenance-dataadmin/menu.vm</param>
-			<param name="page">
-				/dhis-web-maintenance-dataadmin/updateSqlViewForm.vm</param>
+			<param name="page">/dhis-web-maintenance-dataadmin/updateSqlViewForm.vm</param>
+			<param name="stylesheets">style/jquery.autocomplete.css</param>
 			<param name="javascripts">
 				javascript/sqlViewData.js
 				,javascript/sqlView.js

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlViewDesignTool.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlViewDesignTool.js	2010-08-24 07:43:37 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlViewDesignTool.js	2010-09-16 19:01:55 +0000
@@ -14,7 +14,6 @@
 	htmlTables = "<option value=\"null\">[ "+i18n_resourcetables+" ]</option>";
 	htmlTables += "<option value=\"_cocn\">_CategoryOptionComboname</option>";
 	htmlTables += "<option value=\"_ous\">_OrgUnitStructure</option>";
-	htmlTables += "<option value=\"_ougss\">_OrgUnitGroupSetStructure</option>";
 	htmlTables += "<option value=\"_cs\">_CategoryStructure</option>";
 	htmlTables += "<option value=\"_degss\">_DataElementGroupSetStructure</option>";
 	htmlTables += "<option value=\"_icgss\">_IndicatorGroupSetStructure</option>";

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/resourceTableForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/resourceTableForm.vm	2010-09-16 10:11:43 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/resourceTableForm.vm	2010-09-16 19:01:55 +0000
@@ -2,32 +2,32 @@
 <h3>$i18n.getString( "resource_table" ) #openHelp( "resourceTables" )</h3>
 
 <p>
-    <input type="checkbox" name="resourceTableCheckBox" id="organisationUnit">
+    <input type="checkbox" name="resourceTableCheckBox" id="organisationUnit"/>
     <label for="organisationUnit">$i18n.getString( "organisation_unit_structure" ) <span style="color:#606060">(_orgunitstructure)</span></label>
 </p>
 
 <p>
-	<input type="checkbox" name="resourceTableCheckBox" id="dataElementGroupSetStructure">
+	<input type="checkbox" name="resourceTableCheckBox" id="dataElementGroupSetStructure"/>
 	<label for="dataElementGroupSetStructure">$i18n.getString( "data_element_group_set_structure" ) <span style="color:#606060">(_dataelementgroupsetstructure)</span></label>
 </p>
 
 <p>
-    <input type="checkbox" name="resourceTableCheckBox" id="indicatorGroupSetStructure">
+    <input type="checkbox" name="resourceTableCheckBox" id="indicatorGroupSetStructure"/>
     <label for="indicatorGroupSetStructure">$i18n.getString( "indicator_group_set_structure" ) <span style="color:#606060">(_indicatorgroupsetstructure)</span></label>
 </p>
 
 <p>
-    <input type="checkbox" name="resourceTableCheckBox" id="organisationUnitGroupSetStructure">
+    <input type="checkbox" name="resourceTableCheckBox" id="organisationUnitGroupSetStructure"/>
     <label for="organisationUnitGroupSetStructure">$i18n.getString( "organisation_unit_group_set_structure" ) <span style="color:#606060">(_organisationunitgroupsetstructure)</span></label>
 </p>
 
 <p>
-	<input type="checkbox" name="resourceTableCheckBox" id="categoryStructure">
+	<input type="checkbox" name="resourceTableCheckBox" id="categoryStructure"/>
 	<label for="categoryStructure">$i18n.getString( "category_structure" ) <span style="color:#606060">(_categorystructure)</span></label>
 </p>
 
 <p>
-    <input type="checkbox" name="resourceTableCheckBox" id="categoryOptionComboName">
+    <input type="checkbox" name="resourceTableCheckBox" id="categoryOptionComboName"/>
     <label for="categoryOptionComboName">$i18n.getString( "data_element_category_option_combo_name" ) <span style="color:#606060">(_categoryoptioncomboname)</span></label>
 </p>
 
@@ -35,8 +35,8 @@
 <table>
 	<tr>
 		<td>
-			<input type="button" value='$i18n.getString( "select_all" )' id="selectAllButton" onclick="toggleAll()" style="width:100px">
-		    <input type="button" value='$i18n.getString( "generate_resource_tables" )' onclick="generateResourceTable()" style="width:150px"> 
+			<input type="button" value='$i18n.getString( "select_all" )' id="selectAllButton" onclick="toggleAll()" style="width:100px"/>
+		    <input type="button" value='$i18n.getString( "generate_resource_tables" )' onclick="generateResourceTable()" style="width:150px"/> 
 		</td>
 	</tr>