dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #09390
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2475: Removed the autojoin function in sqlview, the joins were not so relevant
Merge authors:
Lars Helge Øverland (larshelge)
------------------------------------------------------------
revno: 2475 [merge]
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-01-06 18:10:46 +0100
message:
Removed the autojoin function in sqlview, the joins were not so relevant
removed:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/AutoJoinResourceTablesAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/GetResourcePropertiesAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/images/
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/images/goback.png
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/jquery.autocomplete.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlViewData.js
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/jsonJoinQuery.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonResourceProperties.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/style/
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/style/jquery.autocomplete.css
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlViewExpandStore.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlViewService.java
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/sqlview/DefaultSqlViewService.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/META-INF/dhis/beans.xml
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/addSqlViewForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlView.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateSqlViewForm.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/SqlViewExpandStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlViewExpandStore.java 2010-09-16 10:04:16 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlViewExpandStore.java 2011-01-06 17:07:18 +0000
@@ -16,8 +16,6 @@
Collection<String> getAllSqlViewNames();
- Collection<String> getAllResourceProperties( String resourceTableName );
-
boolean isViewTableExists( String viewTableName );
boolean createView( SqlView sqlViewInstance );
@@ -29,6 +27,4 @@
String setUpViewTableName( String input );
String testSqlGrammar( String sql );
-
- String setUpJoinQuery( Collection<String> tables );
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlViewService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlViewService.java 2010-09-16 10:04:16 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlViewService.java 2011-01-06 17:07:18 +0000
@@ -63,8 +63,6 @@
Collection<String> getAllSqlViewNames();
- Collection<String> getAllResourceProperties( String resourceTableName );
-
boolean isViewTableExists( String viewTableName );
boolean createAllViewTables();
@@ -78,6 +76,4 @@
SqlViewTable getDataSqlViewTable( String viewTableName );
String testSqlGrammar( String sql );
-
- String setUpJoinQuery( Collection<String> tableList );
}
=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/sqlview/DefaultSqlViewService.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/sqlview/DefaultSqlViewService.java 2010-10-04 08:56:54 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/sqlview/DefaultSqlViewService.java 2011-01-06 17:07:18 +0000
@@ -158,24 +158,12 @@
}
@Override
- public Collection<String> getAllResourceProperties( String resourceTableName )
- {
- return sqlViewExpandStore.getAllResourceProperties( resourceTableName );
- }
-
- @Override
public String testSqlGrammar( String sql )
{
return sqlViewExpandStore.testSqlGrammar( sql );
}
@Override
- public String setUpJoinQuery( Collection<String> tables )
- {
- return sqlViewExpandStore.setUpJoinQuery( tables );
- }
-
- @Override
public void dropViewTable( String sqlViewTableName )
{
sqlViewExpandStore.dropViewTable( sqlViewTableName );
=== 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-11-18 06:46:03 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/sqlview/jdbc/JdbcSqlViewExpandStore.java 2011-01-06 17:07:18 +0000
@@ -30,7 +30,6 @@
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Collection;
@@ -40,10 +39,8 @@
import org.amplecode.quick.StatementHolder;
import org.amplecode.quick.StatementManager;
-import org.hisp.dhis.sqlview.ResourceTableNameMap;
import org.hisp.dhis.sqlview.SqlView;
import org.hisp.dhis.sqlview.SqlViewExpandStore;
-import org.hisp.dhis.sqlview.SqlViewJoinLib;
import org.hisp.dhis.sqlview.SqlViewTable;
import org.springframework.jdbc.BadSqlGrammarException;
import org.springframework.jdbc.core.JdbcTemplate;
@@ -63,8 +60,6 @@
private static final String PREFIX_VIEWNAME = "_view";
- private static final String ENDLINE = "<br/>";
-
private static final String[] types = { "VIEW" };
private static final Pattern p = Pattern.compile( "\\W" );
@@ -124,38 +119,6 @@
}
@Override
- public Collection<String> getAllResourceProperties( String resourceTableName )
- {
- final StatementHolder holder = statementManager.getHolder();
- Set<String> propertiesName = new HashSet<String>();
-
- try
- {
- ResultSet rs = holder.getStatement().executeQuery(
- PREFIX_SELECT_QUERY + ResourceTableNameMap.getResourceNameByAlias( resourceTableName ) + " LIMIT 1" );
- ResultSetMetaData rsmd = rs.getMetaData();
-
- int countCols = rsmd.getColumnCount();
-
- for ( int i = 1; i <= countCols; i++ )
- {
- propertiesName.add( rsmd.getColumnName( i ) );
- }
-
- }
- catch ( SQLException e )
- {
- e.printStackTrace();
- }
- finally
- {
- holder.close();
- }
-
- return propertiesName;
- }
-
- @Override
public boolean isViewTableExists( String viewTableName )
{
final StatementHolder holder = statementManager.getHolder();
@@ -236,19 +199,16 @@
@Override
public String testSqlGrammar( String sql )
{
- String errorMessage = "";
-
try
{
jdbcTemplate.queryForList( sql );
}
- catch ( BadSqlGrammarException bge )
+ catch ( BadSqlGrammarException ex )
{
- errorMessage = setUpMessage( bge.getRootCause().toString() );
- return errorMessage;
+ return ex.getMessage();
}
- return errorMessage;
+ return "";
}
@Override
@@ -270,399 +230,6 @@
}
}
- @Override
- public String setUpJoinQuery( Collection<String> tableList )
- {
- String joinQuery = "";
-
- if ( tableList.size() == 2 )
- {
- // -----------------------------------------------------------------
- // CATEGORYOPTIONCOMBONAME
- // -----------------------------------------------------------------
- if ( tableList.contains( "_cocn" ) )
- {
- joinQuery += "_categoryoptioncomboname AS _cocn \n";
-
- if ( tableList.contains( "_cs" ) )
- {
- // "COCN and CS"
- joinQuery += SqlViewJoinLib.COCN_JOIN_CS;
- }
- else if ( tableList.contains( "_degss" ) )
- {
- // "COCN and DEGSS"
- joinQuery += SqlViewJoinLib.COCN_JOIN_DEGSS;
- }
- else if ( tableList.contains( "_ous" ) )
- {
- // "COCN and OUS"
- joinQuery += SqlViewJoinLib.COCN_JOIN_OUS;
- }
- else if ( tableList.contains( "_oustgss" ) )
- {
- // "COCN and OUSTGSS"
- joinQuery += SqlViewJoinLib.COCN_JOIN_OUSTGSS;
- }
- }
-
- // -----------------------------------------------------------------
- // ORGUNITSTRUCTURE
- // -----------------------------------------------------------------
- else if ( tableList.contains( "_ous" ) )
- {
- joinQuery += "_orgunitstructure AS _ous \n";
-
- if ( tableList.contains( "_oustgss" ) )
- {
- // "OUS and OUSTGSS"
- joinQuery += SqlViewJoinLib.OUS_JOIN_OUSTGSS;
- }
- else if ( tableList.contains( "_cocn" ) )
- {
- // "OUS and COCN"
- joinQuery += SqlViewJoinLib.OUS_JOIN_COCN;
- }
- else if ( tableList.contains( "_degss" ) )
- {
- // "OUS and DEGSS"
- joinQuery += SqlViewJoinLib.OUS_JOIN_DEGSS;
- }
- else if ( tableList.contains( "_cs" ) )
- {
- // "OUS and COCN"
- joinQuery += SqlViewJoinLib.OUS_JOIN_COCN;
-
- // "COCN and CS"
- joinQuery += SqlViewJoinLib.COCN_JOIN_CS;
- }
- }
-
- // -----------------------------------------------------------------
- // _CATEGORYSTRUCTURE
- // -----------------------------------------------------------------
- else if ( tableList.contains( "_cs" ) )
- {
- joinQuery += "_categorystructure AS _cs \n";
-
- // "COCN and CS"
- joinQuery += SqlViewJoinLib.COCN_JOIN_CS;
-
- if ( tableList.contains( "_cocn" ) )
- {
- }
- else if ( tableList.contains( "_ous" ) )
- {
- // "COCN and OUS"
- joinQuery += SqlViewJoinLib.COCN_JOIN_OUS;
- }
- else if ( tableList.contains( "_degss" ) )
- {
- // "COCN and DEGSS"
- joinQuery += SqlViewJoinLib.COCN_JOIN_DEGSS;
- }
- else if ( tableList.contains( "_oustgss" ) )
- {
- // "COCN and OUSTGSS"
- joinQuery += SqlViewJoinLib.COCN_JOIN_OUSTGSS;
- }
- }
-
- // -----------------------------------------------------------------
- // _DATAELEMENTGROUPSETSTRUCTURE
- // -----------------------------------------------------------------
- else if ( tableList.contains( "_degss" ) )
- {
- joinQuery += "_dataelementgroupsetstructure AS _degss \n";
-
- if ( tableList.contains( "_cocn" ) )
- {
- // "DEGSS and COCN"
- joinQuery += SqlViewJoinLib.DEGSS_JOIN_COCN;
- }
- else if ( tableList.contains( "_ous" ) )
- {
- // "DEGSS and OUS"
- joinQuery += SqlViewJoinLib.DEGSS_JOIN_OUS;
- }
- else if ( tableList.contains( "_cs" ) )
- {
- // "DEGSS and COCN and CS"
- joinQuery += SqlViewJoinLib.DEGSS_JOIN_COCN + SqlViewJoinLib.COCN_JOIN_CS;
- }
- else if ( tableList.contains( "_oustgss" ) )
- {
- // "DEGSS and OUSTGSS"
- joinQuery += SqlViewJoinLib.DEGSS_JOIN_OUSTGSS;
- }
- }
-
- // -----------------------------------------------------------------
- // _ORGANISATIONUNITGROUPSETSTRUCTURE
- // -----------------------------------------------------------------
- else if ( tableList.contains( "_oustgss" ) )
- {
- joinQuery += "_organisationunitgroupsetstructure AS _oustgss \n";
-
- if ( tableList.contains( "_cocn" ) || tableList.contains( "_cs" ) )
- {
- // "OUSTGSS and COCN"
- joinQuery += SqlViewJoinLib.OUSTGSS_JOIN_COCN;
-
- if ( tableList.contains( "_cs" ) )
- {
- // "COCN and CS"
- joinQuery += SqlViewJoinLib.COCN_JOIN_CS;
- }
- }
- else if ( tableList.contains( "_degss" ) )
- {
- // "OUSTGSS and DEGSS"
- joinQuery += SqlViewJoinLib.OUSTGSS_JOIN_DEGSS;
- }
- else if ( tableList.contains( "_ous" ) )
- {
- // "OUSTGSS and OUS"
- joinQuery += SqlViewJoinLib.OUSTGSS_JOIN_OUS;
- }
- }
- }
- else if ( tableList.size() == 3 )
- {
- // -----------------------------------------------------------------
- // CategoryOptionComboname OrgUnitStructure
- // -----------------------------------------------------------------
- if ( tableList.contains( "_cocn" ) && tableList.contains( "_ous" ) )
- {
- joinQuery += "_categoryoptioncomboname AS _cocn \n";
-
- // "COCN and OUS"
- joinQuery += SqlViewJoinLib.COCN_JOIN_OUS;
-
- if ( tableList.contains( "_degss" ) )
- {
- // "DV and DEGSS"
- joinQuery += SqlViewJoinLib.DV_JOIN_DEGSS;
- }
- else if ( tableList.contains( "_oustgss" ) )
- {
- // "OUS and OUSTGSS"
- joinQuery += SqlViewJoinLib.OUS_JOIN_OUSTGSS;
- }
- else if ( tableList.contains( "_cs" ) )
- {
- // "COCN and CS"
- joinQuery += SqlViewJoinLib.COCN_JOIN_CS;
- }
- }
-
- // -----------------------------------------------------------------
- // CategoryOptionComboname _CategoryStructure
- // -----------------------------------------------------------------
- else if ( tableList.contains( "_cocn" ) && tableList.contains( "_cs" ) )
- {
- joinQuery += "_categorystructure AS _cs \n";
-
- // "CS and COCN"
- joinQuery += SqlViewJoinLib.CS_JOIN_COCN;
-
- if ( tableList.contains( "_degss" ) )
- {
- // "DV and DEGSS"
- joinQuery += SqlViewJoinLib.COCN_JOIN_DEGSS;
- }
- else if ( tableList.contains( "_oustgss" ) )
- {
- // "DV and OUSTGSS"
- joinQuery += SqlViewJoinLib.DV_JOIN_OUSTGSS;
- }
- }
-
- // -----------------------------------------------------------------
- // CategoryOptionComboname _OrganisationUnitGroupSetStructure
- // -----------------------------------------------------------------
- else if ( tableList.contains( "_cocn" ) && tableList.contains( "_oustgss" )
- && tableList.contains( "_degss" ) )
- {
- joinQuery += "_categoryoptioncomboname AS _cocn \n";
-
- // "COCN and OUSTGSS"
- joinQuery += SqlViewJoinLib.COCN_JOIN_OUSTGSS;
-
- // "DV and DEGSS"
- joinQuery += SqlViewJoinLib.DV_JOIN_DEGSS;
- }
-
- // -----------------------------------------------------------------
- // OrgUnitStructure _CategoryStructure
- // -----------------------------------------------------------------
- else if ( tableList.contains( "_ous" ) && tableList.contains( "_cs" ) )
- {
- joinQuery += "_categorystructure AS _cs \n";
-
- // "CS and COCN"
- joinQuery += SqlViewJoinLib.CS_JOIN_COCN;
-
- // "COCN and OUS"
- joinQuery += SqlViewJoinLib.COCN_JOIN_OUS;
-
- if ( tableList.contains( "_degss" ) )
- {
- // "DV and DEGSS"
- joinQuery += SqlViewJoinLib.DV_JOIN_DEGSS;
- }
- else if ( tableList.contains( "_oustgss" ) )
- {
- // "OUS and OUSTGSS"
- joinQuery += SqlViewJoinLib.OUS_JOIN_OUSTGSS;
- }
- }
-
- // -----------------------------------------------------------------
- // OrgUnitStructure _DataelementGroupSetStructure
- // -----------------------------------------------------------------
- else if ( tableList.contains( "_ous" ) && tableList.contains( "_degss" ) && tableList.contains( "_oustgss" ) )
- {
- joinQuery += "_dataelementgroupsetstructure AS _degss \n";
-
- // "DEGSS and OUS"
- joinQuery += SqlViewJoinLib.DEGSS_JOIN_OUS;
-
- // "OUS and OUSTGSS"
- joinQuery += SqlViewJoinLib.OUS_JOIN_OUSTGSS;
-
- }
-
- // -----------------------------------------------------------------
- // _CategoryStructure _DataelementGroupSetStructure
- // -----------------------------------------------------------------
- else if ( 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 OUSTGSS"
- joinQuery += SqlViewJoinLib.DV_JOIN_OUSTGSS;
-
- }
- }
- else if ( tableList.size() == 4 )
- {
- // -----------------------------------------------------------------
- // _CategoryOptionComboname _OrgUnitStructure _CategoryStructure
- // -----------------------------------------------------------------
- if ( tableList.contains( "_cocn" ) && tableList.contains( "_ous" ) && tableList.contains( "_cs" ) )
- {
- if ( tableList.contains( "_degss" ) )
- {
- 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;
-
- }
- else if ( tableList.contains( "_oustgss" ) )
- {
- joinQuery += "_orgunitstructure AS _ous \n";
-
- // "OUS and OUSTGSS"
- joinQuery += SqlViewJoinLib.OUS_JOIN_OUSTGSS;
-
- // "OUSTGSS and COCN"
- joinQuery += SqlViewJoinLib.OUSTGSS_JOIN_COCN;
-
- // "COCN and CS"
- joinQuery += SqlViewJoinLib.COCN_JOIN_CS;
- }
- }
-
- // -----------------------------------------------------------------
- // _CategoryOptionComboname _OrgUnitStructure
- // _DataelementGroupSetStructure
- // -----------------------------------------------------------------
- else if ( tableList.contains( "_cocn" ) && tableList.contains( "_ous" ) && tableList.contains( "_degss" )
- && tableList.contains( "_oustgss" ) )
- {
- joinQuery += "_orgunitstructure AS _ous \n";
-
- // "OUS and OUSTGSS"
- joinQuery += SqlViewJoinLib.OUS_JOIN_OUSTGSS;
-
- // "OUSTGSS and DEGSS"
- joinQuery += SqlViewJoinLib.OUSTGSS_JOIN_DEGSS;
-
- // "DV and COCN"
- joinQuery += SqlViewJoinLib.DV_JOIN_COCN;
-
- }
-
- // -----------------------------------------------------------------
- // _CategoryOptionComboname _CategoryStructure
- // _DataelementGroupSetStructure
- // -----------------------------------------------------------------
- else if ( tableList.contains( "_cocn" ) && tableList.contains( "_cs" ) && tableList.contains( "_degss" )
- && tableList.contains( "_oustgss" ) )
- {
- joinQuery += "_categorystructure AS _cs \n";
-
- // "CS and COCN"
- joinQuery += SqlViewJoinLib.CS_JOIN_COCN;
-
- // "COCN and DEGSS"
- joinQuery += SqlViewJoinLib.COCN_JOIN_DEGSS;
-
- // "DV and OUSTGSS
- joinQuery += SqlViewJoinLib.DV_JOIN_OUSTGSS;
-
- }
-
- // -----------------------------------------------------------------
- // _OrgunitStructure _DataelementGroupSetStructure
- // _OrganisationunitGroupSetStructure
- // -----------------------------------------------------------------
- else if ( tableList.contains( "_ous" ) && tableList.contains( "_degss" ) && tableList.contains( "_oustgss" ) )
- {
- joinQuery += "_organisationunitgroupsetstructure AS _oustgss \n";
-
- if ( tableList.contains( "_cs" ) )
- {
- // "OUSTGSS and OUS and COCN"
- joinQuery += SqlViewJoinLib.OUSTGSS_JOIN_OUS + SqlViewJoinLib.OUS_JOIN_COCN;
-
- // "COCN and CS"
- joinQuery += SqlViewJoinLib.COCN_JOIN_CS;
- }
- }
- }
- else if ( tableList.size() == 5 )
- {
- // -----------------------------------------------------------------
- // _CategoryOptionComboname _OrgUnitStructure
- // _DataelementGroupSetStructure _OrganisationunitGroupSetStructure
- // -----------------------------------------------------------------
- if ( tableList.contains( "_cocn" ) && tableList.contains( "_ous" ) && tableList.contains( "_degss" )
- && 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;
-
- }
- }
-
- return joinQuery;
- }
-
// -------------------------------------------------------------------------
// Supporting methods
// -------------------------------------------------------------------------
@@ -683,12 +250,4 @@
stm.execute( sql );
return stm.getResultSet();
}
-
- private String setUpMessage( String input )
- {
- input = input.replaceFirst( "(?i)\\s*error:", ENDLINE + ENDLINE + "ERROR:" ).replaceFirst( "(?i)\\s*hint:",
- ENDLINE + "HINT:" ).replaceFirst( "(?i)\\s*Position:", ENDLINE + "POSITION:" );
-
- return input;
- }
}
\ No newline at end of file
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/AutoJoinResourceTablesAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/AutoJoinResourceTablesAction.java 2010-08-24 07:43:37 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/AutoJoinResourceTablesAction.java 1970-01-01 00:00:00 +0000
@@ -1,106 +0,0 @@
-package org.hisp.dhis.dataadmin.action.sqlview;
-
-/*
- * Copyright (c) 2004-2010, 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.
- */
-import java.util.Collection;
-
-import org.hisp.dhis.sqlview.SqlViewService;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Dang Duy Hieu
- * @version $Id AutoJoinResourceTablesAction.java Aug 16, 2010$
- */
-public class AutoJoinResourceTablesAction
- implements Action
-{
-
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private SqlViewService sqlViewService;
-
- public void setSqlViewService( SqlViewService sqlViewService )
- {
- this.sqlViewService = sqlViewService;
- }
-
- // -------------------------------------------------------------------------
- // Input
- // -------------------------------------------------------------------------
-
- private Collection<String> tableList;
-
- public void setTableList( Collection<String> tableList )
- {
- this.tableList = tableList;
- }
-
- // -------------------------------------------------------------------------
- // Output
- // -------------------------------------------------------------------------
-
- private String fromJoinQuery;
-
- public String getFromJoinQuery()
- {
- return fromJoinQuery;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- public String execute()
- {
- fromJoinQuery = "FROM "
- + (tableList.contains( "_icgss" ) ? "_indicatorgroupsetstructure" : "");
-
- tableList.remove( "_icgss" );
-
- if ( !tableList.isEmpty() )
- {
- if ( fromJoinQuery.equalsIgnoreCase( "from _indicatorgroupsetstructure" ) )
- {
- fromJoinQuery += " AS _icgss, ";
- }
-
- if ( tableList.size() == 1 )
- {
- fromJoinQuery += tableList.iterator().next();
- }
- else if ( tableList.size() > 1 )
- {
- fromJoinQuery += sqlViewService.setUpJoinQuery( tableList );
- }
- }
-
- return SUCCESS;
- }
-}
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/GetResourcePropertiesAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/GetResourcePropertiesAction.java 2010-08-09 03:57:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/GetResourcePropertiesAction.java 1970-01-01 00:00:00 +0000
@@ -1,85 +0,0 @@
-package org.hisp.dhis.dataadmin.action.sqlview;
-
-/*
- * Copyright (c) 2004-2010, 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.
- */
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.hisp.dhis.sqlview.SqlViewService;
-
-import com.opensymphony.xwork2.ActionSupport;
-
-/**
- * @author Dang Duy Hieu
- * @version $Id GetSqlViewListAction.java July 20, 2010$
- */
-public class GetResourcePropertiesAction
- extends ActionSupport
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private SqlViewService sqlViewService;
-
- public void setSqlViewService( SqlViewService sqlViewService )
- {
- this.sqlViewService = sqlViewService;
- }
-
- // -------------------------------------------------------------------------
- // Getters & Setters
- // -------------------------------------------------------------------------
-
- private String name;
-
- public void setName( String name )
- {
- this.name = name;
- }
-
- private List<String> resourceProperties;
-
- public List<String> getResourceProperties()
- {
- return resourceProperties;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- public String execute()
- throws Exception
- {
- resourceProperties = new ArrayList<String>( sqlViewService.getAllResourceProperties( name ) );
-
- return SUCCESS;
- }
-
-}
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/META-INF/dhis/beans.xml 2010-11-08 09:21:24 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/META-INF/dhis/beans.xml 2011-01-06 17:07:18 +0000
@@ -326,17 +326,5 @@
scope="prototype">
<property name="sqlViewService" ref="org.hisp.dhis.sqlview.SqlViewService" />
</bean>
-
- <bean id="org.hisp.dhis.dataadmin.action.sqlview.GetResourcePropertiesAction"
- class="org.hisp.dhis.dataadmin.action.sqlview.GetResourcePropertiesAction"
- scope="prototype">
- <property name="sqlViewService" ref="org.hisp.dhis.sqlview.SqlViewService" />
- </bean>
-
- <bean id="org.hisp.dhis.dataadmin.action.sqlview.AutoJoinResourceTablesAction"
- class="org.hisp.dhis.dataadmin.action.sqlview.AutoJoinResourceTablesAction"
- scope="prototype">
- <property name="sqlViewService" ref="org.hisp.dhis.sqlview.SqlViewService" />
- </bean>
-
+
</beans>
=== 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-11-08 09:21:24 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml 2011-01-06 17:07:18 +0000
@@ -355,12 +355,7 @@
<param name="menu">/dhis-web-maintenance-dataadmin/menu.vm</param>
<param name="page">/dhis-web-maintenance-dataadmin/addSqlViewForm.vm</param>
<param name="stylesheets">style/jquery.autocomplete.css</param>
- <param name="javascripts">
- javascript/sqlViewData.js
- ,javascript/sqlView.js
- ,javascript/sqlViewDesignTool.js
- ,javascript/jquery.autocomplete.js
- </param>
+ <param name="javascripts">javascript/sqlView.js</param>
<param name="requiredAuthorities">F_SQLVIEW_ADD</param>
</action>
@@ -386,19 +381,13 @@
<param name="menu">/dhis-web-maintenance-dataadmin/menu.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
- ,javascript/sqlViewDesignTool.js
- ,javascript/jquery.autocomplete.js
- </param>
+ <param name="javascripts">javascript/sqlView.js</param>
<param name="requiredAuthorities">F_SQLVIEW_UPDATE</param>
</action>
<action name="updateSqlViewInstance"
class="org.hisp.dhis.dataadmin.action.sqlview.UpdateSqlViewAction">
- <result name="success" type="redirect">
- showSqlViewListForm.action</result>
+ <result name="success" type="redirect">showSqlViewListForm.action</result>
<result name="error" type="redirect">index.action</result>
<param name="requiredAuthorities">F_SQLVIEW_UPDATE</param>
</action>
@@ -443,13 +432,5 @@
<param name="requiredAuthorities">F_SQLVIEW_MANAGEMENT</param>
</action>
- <action name="getResourceProperties" class="org.hisp.dhis.dataadmin.action.sqlview.GetResourcePropertiesAction">
- <result name="success" type="velocity-json">/dhis-web-maintenance-dataadmin/jsonResourceProperties.vm</result>
- </action>
-
- <action name="autoJoinResourceTables" class="org.hisp.dhis.dataadmin.action.sqlview.AutoJoinResourceTablesAction">
- <result name="success" type="velocity-json">/dhis-web-maintenance-dataadmin/jsonJoinQuery.vm</result>
- </action>
-
</package>
</struts>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addSqlViewForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addSqlViewForm.vm 2010-09-25 20:13:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addSqlViewForm.vm 2011-01-06 17:00:27 +0000
@@ -1,23 +1,10 @@
<script>
-//-----------------------------------------------------------------------
-//init jQuery validation for addSqlViewForm
-//-----------------------------------------------------------------------
+jQuery(document).ready(function() {
- jQuery(document).ready(function() {
-
- validation( 'addSqlViewForm', function() {
- validateAddUpdateSqlView( 'add' );
- });
-
- hideById("mainDesignQueryDiv");
- initHtml(i18n_resourcetables, i18n_sorttypes);
- initField("resource-table-combo1", "sort-property-combo1");
- applyAutocompleteSupporting(jQuery.merge(criteria_clone, keywords), "sqlquery", $("#sqlquery").width() );
- applyAutocompleteSupporting(criteria_operators, "criteria_and_property1", 225 );
- applyAutocompleteSupporting(criteria_operators, "criteria_or_property1", 225 );
-
+ validation( 'addSqlViewForm', function() {
+ validateAddUpdateSqlView( 'add' );
});
-
+});
</script>
<input type="hidden" id="curLocaleCode" value="$locale.getLanguage()_$locale.getCountry()"/>
@@ -44,97 +31,10 @@
<tr>
<td></td>
<td><input type="submit" value="$i18n.getString( 'save' )" style="width:10em"/>
- <input type="button" value="$i18n.getString( 'cancel' )" id="cancel" name="cancel" onclick="window.location.href='showSqlViewListForm.action'" style="width:10em"/>
- <input type="button" value="$i18n.getString( 'show_advance' )" id="advance_button" name="advance_button" onclick="showOrHideDesignQueryDiv()" style="width:10em"/></td>
+ <input type="button" value="$i18n.getString( 'cancel' )" id="cancel" name="cancel" onclick="window.location.href='showSqlViewListForm.action'" style="width:10em"/>
</tr>
</table>
</form>
-<br/><br/>
-
-<div id="mainDesignQueryDiv">
- <table id="mainTable">
- <tr id="mainRow">
- <td id="appendedColumn1">
- <table>
- <tr>
- <td></td>
- <td align="center"><label style="color:white" class="ui-widget-header ui-corner-all">
- $encoder.htmlEncode( $i18n.getString( "header_field" )) 1</label>
- <img src="../images/transparent.gif" align="right"/></td>
- </tr>
- <tr><td><label for="sql_statement">$encoder.htmlEncode($i18n.getString( "resource_table" )): </label></td>
- <td><select id="resource-table-combo1" style="width:180px" onchange="loadResourceProperties(this.value, 1)">
- </select></td>
- </tr>
- <tr><td><label for="sql_statement">$encoder.htmlEncode($i18n.getString( "field" )): </label></td>
- <td><select id="resource-property-combo1" style="width:180px" onchange="checkSelectedField(this.value, 1)">
- </select></td>
- </tr>
- <tr>
- <td><label for="sql_statement">$encoder.htmlEncode($i18n.getString( "alias" )): </label></td>
- <td><input id="alias-property1" style="width:175px" disabled /></td>
- </tr>
- <tr>
- <td><label for="sql_statement">$encoder.htmlEncode($i18n.getString( "show" )): </label></td>
- <td align="center"><input type="checkbox" name="show-checkbox"/></td>
- </tr>
- <tr>
- <td><label for="sql_statement">$encoder.htmlEncode($i18n.getString( "sort" )): </label></td>
- <td><select id="sort-property-combo1" style="width:180px" disabled >
- </select></td>
- </tr>
- <tr>
- <td><label for="sql_statement">$encoder.htmlEncode($i18n.getString( "criteria_and" )): </label></td>
- <td><input id="criteria_and_property1" style="width:175px" disabled /></td>
- </tr>
- <tr>
- <td><label for="sql_statement">$encoder.htmlEncode($i18n.getString( "criteria_or" )): </label></td>
- <td><input id="criteria_or_property1" style="width:175px" disabled /></td>
- </tr>
- <tr>
- <td><label for="sql_statement">$encoder.htmlEncode($i18n.getString( "group_by" )): </label></td>
- <td align="center"><input type="checkbox" id="groupby-property-checkbox1" disabled />
- <a href="javascript:appendField(1)" title="$encoder.htmlEncode($i18n.getString( 'append' ))">
- <img src="../images/add_small.png" alt="$encoder.htmlEncode($i18n.getString( 'append' ))" align="right"/></a>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table><br/>
- <input type="button" id="designQueryButton" value="$i18n.getString( 'generate_query' )" style="width:10em" onclick="getJoinTable()"/>
- <input type="button" value="$encoder.htmlEncode($i18n.getString( 'add_new_field' ))" onclick="generateQueryColumn('mainRow')"/>
- <input type="button" value="$encoder.htmlEncode($i18n.getString( 'reset' ))" onclick="removeAllQueryColumn()"/>
- <br/>
-</div>
<span id="message"></span>
-
-<script type="text/javascript">
-
- /**
- Global variables
- @param comboBoxNo comboBoxNo is the default number of comboBoxes
- */
- columnIndex = 1;
- curAppendedColumnId = "";
- advanceStatus = false;
-
- var i18n_header_field = "$encoder.jsEscape($i18n.getString( 'header_field' ) , "'")";
- var i18n_resourcetables = "$encoder.jsEscape($i18n.getString( 'select_resourcetables' ) , "'")";
- var i18n_properties = "$encoder.jsEscape($i18n.getString( 'select_properties' ) , "'")";
- var i18n_properties_welformed = "$encoder.jsEscape($i18n.getString( 'properties_welformed' ) , "'")";
- var i18n_syntax_error_parameter_required = "$encoder.jsEscape($i18n.getString( 'syntax_error_parameter_required' ) , "'")";
- var i18n_sorttypes = "$encoder.jsEscape($i18n.getString( 'select_sorttypes' ) , "'")";
- var i18n_ascending = "$encoder.jsEscape($i18n.getString( 'ascending' ) , "'")";
- var i18n_descending = "$encoder.jsEscape($i18n.getString( 'descending' ) , "'")";
- var i18n_cannot_remove_any_more = "$encoder.jsEscape($i18n.getString( 'cannot_remove_any_more' ) , "'")";
- var i18n_show_advance = "$encoder.jsEscape($i18n.getString( 'show_advance' ) , "'")";
- var i18n_hide_advance = "$encoder.jsEscape($i18n.getString( 'hide_advance' ) , "'")";
- var i18n_close = "$encoder.jsEscape($i18n.getString( 'close' ) , "'")";
- var i18n_append = "$encoder.jsEscape($i18n.getString( 'append' ) , "'")";
- var i18n_resourcetable_at_position = "$encoder.jsEscape($i18n.getString( 'resourcetable_at_position' ) , "'")";
- var i18n_unselected_yet = "$encoder.jsEscape($i18n.getString( 'unselected_yet' ) , "'")";
-
-</script>
\ No newline at end of file
=== removed directory 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/images'
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/images/goback.png'
Binary files dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/images/goback.png 2010-07-17 12:46:48 +0000 and dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/images/goback.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/jquery.autocomplete.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/jquery.autocomplete.js 2010-08-09 03:57:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/jquery.autocomplete.js 1970-01-01 00:00:00 +0000
@@ -1,808 +0,0 @@
-/*
- * jQuery Autocomplete plugin 1.1
- *
- * Copyright (c) 2009 Jörn Zaefferer
- *
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- *
- * Revision: $Id: jquery.autocomplete.js 15 2009-08-22 10:30:27Z joern.zaefferer $
- */
-
-;(function($) {
-
-$.fn.extend({
- autocomplete: function(urlOrData, options) {
- var isUrl = typeof urlOrData == "string";
- options = $.extend({}, $.Autocompleter.defaults, {
- url: isUrl ? urlOrData : null,
- data: isUrl ? null : urlOrData,
- delay: isUrl ? $.Autocompleter.defaults.delay : 10,
- max: options && !options.scroll ? 10 : 150
- }, options);
-
- // if highlight is set to false, replace it with a do-nothing function
- options.highlight = options.highlight || function(value) { return value; };
-
- // if the formatMatch option is not specified, then use formatItem for backwards compatibility
- options.formatMatch = options.formatMatch || options.formatItem;
-
- return this.each(function() {
- new $.Autocompleter(this, options);
- });
- },
- result: function(handler) {
- return this.bind("result", handler);
- },
- search: function(handler) {
- return this.trigger("search", [handler]);
- },
- flushCache: function() {
- return this.trigger("flushCache");
- },
- setOptions: function(options){
- return this.trigger("setOptions", [options]);
- },
- unautocomplete: function() {
- return this.trigger("unautocomplete");
- }
-});
-
-$.Autocompleter = function(input, options) {
-
- var KEY = {
- UP: 38,
- DOWN: 40,
- DEL: 46,
- TAB: 9,
- RETURN: 13,
- ESC: 27,
- COMMA: 188,
- PAGEUP: 33,
- PAGEDOWN: 34,
- BACKSPACE: 8
- };
-
- // Create $ object for input element
- var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass);
-
- var timeout;
- var previousValue = "";
- var cache = $.Autocompleter.Cache(options);
- var hasFocus = 0;
- var lastKeyPressCode;
- var config = {
- mouseDownOnSelect: false
- };
- var select = $.Autocompleter.Select(options, input, selectCurrent, config);
-
- var blockSubmit;
-
- // prevent form submit in opera when selecting with return key
- $.browser.opera && $(input.form).bind("submit.autocomplete", function() {
- if (blockSubmit) {
- blockSubmit = false;
- return false;
- }
- });
-
- // only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all
- $input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) {
- // a keypress means the input has focus
- // avoids issue where input had focus before the autocomplete was applied
- hasFocus = 1;
- // track last key pressed
- lastKeyPressCode = event.keyCode;
- switch(event.keyCode) {
-
- case KEY.UP:
- event.preventDefault();
- if ( select.visible() ) {
- select.prev();
- } else {
- onChange(0, true);
- }
- break;
-
- case KEY.DOWN:
- event.preventDefault();
- if ( select.visible() ) {
- select.next();
- } else {
- onChange(0, true);
- }
- break;
-
- case KEY.PAGEUP:
- event.preventDefault();
- if ( select.visible() ) {
- select.pageUp();
- } else {
- onChange(0, true);
- }
- break;
-
- case KEY.PAGEDOWN:
- event.preventDefault();
- if ( select.visible() ) {
- select.pageDown();
- } else {
- onChange(0, true);
- }
- break;
-
- // matches also semicolon
- case options.multiple && $.trim(options.multipleSeparator) == " " && KEY.COMMA:
- case KEY.TAB:
- case KEY.RETURN:
- if( selectCurrent() ) {
- // stop default to prevent a form submit, Opera needs special handling
- event.preventDefault();
- blockSubmit = true;
- return false;
- }
- break;
-
- case KEY.ESC:
- select.hide();
- break;
-
- default:
- clearTimeout(timeout);
- timeout = setTimeout(onChange, options.delay);
- break;
- }
- }).focus(function(){
- // track whether the field has focus, we shouldn't process any
- // results if the field no longer has focus
- hasFocus++;
- }).blur(function() {
- hasFocus = 0;
- if (!config.mouseDownOnSelect) {
- hideResults();
- }
- }).click(function() {
- // show select when clicking in a focused field
- if ( hasFocus++ > 1 && !select.visible() ) {
- onChange(0, true);
- }
- }).bind("search", function() {
- // TODO why not just specifying both arguments?
- var fn = (arguments.length > 1) ? arguments[1] : null;
- function findValueCallback(q, data) {
- var result;
- if( data && data.length ) {
- for (var i=0; i < data.length; i++) {
- if( data[i].result.toLowerCase() == q.toLowerCase() ) {
- result = data[i];
- break;
- }
- }
- }
- if( typeof fn == "function" ) fn(result);
- else $input.trigger("result", result && [result.data, result.value]);
- }
- $.each(trimWords($input.val()), function(i, value) {
- request(value, findValueCallback, findValueCallback);
- });
- }).bind("flushCache", function() {
- cache.flush();
- }).bind("setOptions", function() {
- $.extend(options, arguments[1]);
- // if we've updated the data, repopulate
- if ( "data" in arguments[1] )
- cache.populate();
- }).bind("unautocomplete", function() {
- select.unbind();
- $input.unbind();
- $(input.form).unbind(".autocomplete");
- });
-
-
- function selectCurrent() {
- var selected = select.selected();
- if( !selected )
- return false;
-
- var v = selected.result;
- previousValue = v;
-
- if ( options.multiple ) {
- var words = trimWords($input.val());
- if ( words.length > 1 ) {
- var seperator = options.multipleSeparator.length;
- var cursorAt = $(input).selection().start;
- var wordAt, progress = 0;
- $.each(words, function(i, word) {
- progress += word.length;
- if (cursorAt <= progress) {
- wordAt = i;
- return false;
- }
- progress += seperator;
- });
- words[wordAt] = v;
- // TODO this should set the cursor to the right position, but it gets overriden somewhere
- //$.Autocompleter.Selection(input, progress + seperator, progress + seperator);
- v = words.join( options.multipleSeparator );
- }
- v += options.multipleSeparator;
- }
-
- $input.val(v);
- hideResultsNow();
- $input.trigger("result", [selected.data, selected.value]);
- return true;
- }
-
- function onChange(crap, skipPrevCheck) {
- if( lastKeyPressCode == KEY.DEL ) {
- select.hide();
- return;
- }
-
- var currentValue = $input.val();
-
- if ( !skipPrevCheck && currentValue == previousValue )
- return;
-
- previousValue = currentValue;
-
- currentValue = lastWord(currentValue);
- if ( currentValue.length >= options.minChars) {
- $input.addClass(options.loadingClass);
- if (!options.matchCase)
- currentValue = currentValue.toLowerCase();
- request(currentValue, receiveData, hideResultsNow);
- } else {
- stopLoading();
- select.hide();
- }
- };
-
- function trimWords(value) {
- if (!value)
- return [""];
- if (!options.multiple)
- return [$.trim(value)];
- return $.map(value.split(options.multipleSeparator), function(word) {
- return $.trim(value).length ? $.trim(word) : null;
- });
- }
-
- function lastWord(value) {
- if ( !options.multiple )
- return value;
- var words = trimWords(value);
- if (words.length == 1)
- return words[0];
- var cursorAt = $(input).selection().start;
- if (cursorAt == value.length) {
- words = trimWords(value)
- } else {
- words = trimWords(value.replace(value.substring(cursorAt), ""));
- }
- return words[words.length - 1];
- }
-
- // fills in the input box w/the first match (assumed to be the best match)
- // q: the term entered
- // sValue: the first matching result
- function autoFill(q, sValue){
- // autofill in the complete box w/the first match as long as the user hasn't entered in more data
- // if the last user key pressed was backspace, don't autofill
- if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) {
- // fill in the value (keep the case the user has typed)
- $input.val($input.val() + sValue.substring(lastWord(previousValue).length));
- // select the portion of the value not typed by the user (so the next character will erase)
- $(input).selection(previousValue.length, previousValue.length + sValue.length);
- }
- };
-
- function hideResults() {
- clearTimeout(timeout);
- timeout = setTimeout(hideResultsNow, 200);
- };
-
- function hideResultsNow() {
- var wasVisible = select.visible();
- select.hide();
- clearTimeout(timeout);
- stopLoading();
- if (options.mustMatch) {
- // call search and run callback
- $input.search(
- function (result){
- // if no value found, clear the input box
- if( !result ) {
- if (options.multiple) {
- var words = trimWords($input.val()).slice(0, -1);
- $input.val( words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : "") );
- }
- else {
- $input.val( "" );
- $input.trigger("result", null);
- }
- }
- }
- );
- }
- };
-
- function receiveData(q, data) {
- if ( data && data.length && hasFocus ) {
- stopLoading();
- select.display(data, q);
- autoFill(q, data[0].value);
- select.show();
- } else {
- hideResultsNow();
- }
- };
-
- function request(term, success, failure) {
- if (!options.matchCase)
- term = term.toLowerCase();
- var data = cache.load(term);
- // recieve the cached data
- if (data && data.length) {
- success(term, data);
- // if an AJAX url has been supplied, try loading the data now
- } else if( (typeof options.url == "string") && (options.url.length > 0) ){
-
- var extraParams = {
- timestamp: +new Date()
- };
- $.each(options.extraParams, function(key, param) {
- extraParams[key] = typeof param == "function" ? param() : param;
- });
-
- $.ajax({
- // try to leverage ajaxQueue plugin to abort previous requests
- mode: "abort",
- // limit abortion to this input
- port: "autocomplete" + input.name,
- dataType: options.dataType,
- url: options.url,
- data: $.extend({
- q: lastWord(term),
- limit: options.max
- }, extraParams),
- success: function(data) {
- var parsed = options.parse && options.parse(data) || parse(data);
- cache.add(term, parsed);
- success(term, parsed);
- }
- });
- } else {
- // if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match
- select.emptyList();
- failure(term);
- }
- };
-
- function parse(data) {
- var parsed = [];
- var rows = data.split("\n");
- for (var i=0; i < rows.length; i++) {
- var row = $.trim(rows[i]);
- if (row) {
- row = row.split("|");
- parsed[parsed.length] = {
- data: row,
- value: row[0],
- result: options.formatResult && options.formatResult(row, row[0]) || row[0]
- };
- }
- }
- return parsed;
- };
-
- function stopLoading() {
- $input.removeClass(options.loadingClass);
- };
-
-};
-
-$.Autocompleter.defaults = {
- inputClass: "ac_input",
- resultsClass: "ac_results",
- loadingClass: "ac_loading",
- minChars: 1,
- delay: 400,
- matchCase: false,
- matchSubset: true,
- matchContains: false,
- cacheLength: 10,
- max: 100,
- mustMatch: false,
- extraParams: {},
- selectFirst: true,
- formatItem: function(row) { return row[0]; },
- formatMatch: null,
- autoFill: false,
- width: 0,
- multiple: false,
- multipleSeparator: " ",
- highlight: function(value, term) {
- return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>");
- },
- scroll: true,
- scrollHeight: 180
-};
-
-$.Autocompleter.Cache = function(options) {
-
- var data = {};
- var length = 0;
-
- function matchSubset(s, sub) {
- if (!options.matchCase)
- s = s.toLowerCase();
- var i = s.indexOf(sub);
- if (options.matchContains == "word"){
- i = s.toLowerCase().search("\\b" + sub.toLowerCase());
- }
- if (i == -1) return false;
- return i == 0 || options.matchContains;
- };
-
- function add(q, value) {
- if (length > options.cacheLength){
- flush();
- }
- if (!data[q]){
- length++;
- }
- data[q] = value;
- }
-
- function populate(){
- if( !options.data ) return false;
- // track the matches
- var stMatchSets = {},
- nullData = 0;
-
- // no url was specified, we need to adjust the cache length to make sure it fits the local data store
- if( !options.url ) options.cacheLength = 1;
-
- // track all options for minChars = 0
- stMatchSets[""] = [];
-
- // loop through the array and create a lookup structure
- for ( var i = 0, ol = options.data.length; i < ol; i++ ) {
- var rawValue = options.data[i];
- // if rawValue is a string, make an array otherwise just reference the array
- rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue;
-
- var value = options.formatMatch(rawValue, i+1, options.data.length);
- if ( value === false )
- continue;
-
- var firstChar = value.charAt(0).toLowerCase();
- // if no lookup array for this character exists, look it up now
- if( !stMatchSets[firstChar] )
- stMatchSets[firstChar] = [];
-
- // if the match is a string
- var row = {
- value: value,
- data: rawValue,
- result: options.formatResult && options.formatResult(rawValue) || value
- };
-
- // push the current match into the set list
- stMatchSets[firstChar].push(row);
-
- // keep track of minChars zero items
- if ( nullData++ < options.max ) {
- stMatchSets[""].push(row);
- }
- };
-
- // add the data items to the cache
- $.each(stMatchSets, function(i, value) {
- // increase the cache size
- options.cacheLength++;
- // add to the cache
- add(i, value);
- });
- }
-
- // populate any existing data
- setTimeout(populate, 25);
-
- function flush(){
- data = {};
- length = 0;
- }
-
- return {
- flush: flush,
- add: add,
- populate: populate,
- load: function(q) {
- if (!options.cacheLength || !length)
- return null;
- /*
- * if dealing w/local data and matchContains than we must make sure
- * to loop through all the data collections looking for matches
- */
- if( !options.url && options.matchContains ){
- // track all matches
- var csub = [];
- // loop through all the data grids for matches
- for( var k in data ){
- // don't search through the stMatchSets[""] (minChars: 0) cache
- // this prevents duplicates
- if( k.length > 0 ){
- var c = data[k];
- $.each(c, function(i, x) {
- // if we've got a match, add it to the array
- if (matchSubset(x.value, q)) {
- csub.push(x);
- }
- });
- }
- }
- return csub;
- } else
- // if the exact item exists, use it
- if (data[q]){
- return data[q];
- } else
- if (options.matchSubset) {
- for (var i = q.length - 1; i >= options.minChars; i--) {
- var c = data[q.substr(0, i)];
- if (c) {
- var csub = [];
- $.each(c, function(i, x) {
- if (matchSubset(x.value, q)) {
- csub[csub.length] = x;
- }
- });
- return csub;
- }
- }
- }
- return null;
- }
- };
-};
-
-$.Autocompleter.Select = function (options, input, select, config) {
- var CLASSES = {
- ACTIVE: "ac_over"
- };
-
- var listItems,
- active = -1,
- data,
- term = "",
- needsInit = true,
- element,
- list;
-
- // Create results
- function init() {
- if (!needsInit)
- return;
- element = $("<div/>")
- .hide()
- .addClass(options.resultsClass)
- .css("position", "absolute")
- .appendTo(document.body);
-
- list = $("<ul/>").appendTo(element).mouseover( function(event) {
- if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
- active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
- $(target(event)).addClass(CLASSES.ACTIVE);
- }
- }).click(function(event) {
- $(target(event)).addClass(CLASSES.ACTIVE);
- select();
- // TODO provide option to avoid setting focus again after selection? useful for cleanup-on-focus
- input.focus();
- return false;
- }).mousedown(function() {
- config.mouseDownOnSelect = true;
- }).mouseup(function() {
- config.mouseDownOnSelect = false;
- });
-
- if( options.width > 0 )
- element.css("width", options.width);
-
- needsInit = false;
- }
-
- function target(event) {
- var element = event.target;
- while(element && element.tagName != "LI")
- element = element.parentNode;
- // more fun with IE, sometimes event.target is empty, just ignore it then
- if(!element)
- return [];
- return element;
- }
-
- function moveSelect(step) {
- listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE);
- movePosition(step);
- var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE);
- if(options.scroll) {
- var offset = 0;
- listItems.slice(0, active).each(function() {
- offset += this.offsetHeight;
- });
- if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) {
- list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight());
- } else if(offset < list.scrollTop()) {
- list.scrollTop(offset);
- }
- }
- };
-
- function movePosition(step) {
- active += step;
- if (active < 0) {
- active = listItems.size() - 1;
- } else if (active >= listItems.size()) {
- active = 0;
- }
- }
-
- function limitNumberOfItems(available) {
- return options.max && options.max < available
- ? options.max
- : available;
- }
-
- function fillList() {
- list.empty();
- var max = limitNumberOfItems(data.length);
- for (var i=0; i < max; i++) {
- if (!data[i])
- continue;
- var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term);
- if ( formatted === false )
- continue;
- var li = $("<li/>").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0];
- $.data(li, "ac_data", data[i]);
- }
- listItems = list.find("li");
- if ( options.selectFirst ) {
- listItems.slice(0, 1).addClass(CLASSES.ACTIVE);
- active = 0;
- }
- // apply bgiframe if available
- if ( $.fn.bgiframe )
- list.bgiframe();
- }
-
- return {
- display: function(d, q) {
- init();
- data = d;
- term = q;
- fillList();
- },
- next: function() {
- moveSelect(1);
- },
- prev: function() {
- moveSelect(-1);
- },
- pageUp: function() {
- if (active != 0 && active - 8 < 0) {
- moveSelect( -active );
- } else {
- moveSelect(-8);
- }
- },
- pageDown: function() {
- if (active != listItems.size() - 1 && active + 8 > listItems.size()) {
- moveSelect( listItems.size() - 1 - active );
- } else {
- moveSelect(8);
- }
- },
- hide: function() {
- element && element.hide();
- listItems && listItems.removeClass(CLASSES.ACTIVE);
- active = -1;
- },
- visible : function() {
- return element && element.is(":visible");
- },
- current: function() {
- return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]);
- },
- show: function() {
- var offset = $(input).offset();
- element.css({
- width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(),
- top: offset.top + input.offsetHeight,
- left: offset.left
- }).show();
- if(options.scroll) {
- list.scrollTop(0);
- list.css({
- maxHeight: options.scrollHeight,
- overflow: 'auto'
- });
-
- if($.browser.msie && typeof document.body.style.maxHeight === "undefined") {
- var listHeight = 0;
- listItems.each(function() {
- listHeight += this.offsetHeight;
- });
- var scrollbarsVisible = listHeight > options.scrollHeight;
- list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight );
- if (!scrollbarsVisible) {
- // IE doesn't recalculate width when scrollbar disappears
- listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) );
- }
- }
-
- }
- },
- selected: function() {
- var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);
- return selected && selected.length && $.data(selected[0], "ac_data");
- },
- emptyList: function (){
- list && list.empty();
- },
- unbind: function() {
- element && element.remove();
- }
- };
-};
-
-$.fn.selection = function(start, end) {
- if (start !== undefined) {
- return this.each(function() {
- if( this.createTextRange ){
- var selRange = this.createTextRange();
- if (end === undefined || start == end) {
- selRange.move("character", start);
- selRange.select();
- } else {
- selRange.collapse(true);
- selRange.moveStart("character", start);
- selRange.moveEnd("character", end);
- selRange.select();
- }
- } else if( this.setSelectionRange ){
- this.setSelectionRange(start, end);
- } else if( this.selectionStart ){
- this.selectionStart = start;
- this.selectionEnd = end;
- }
- });
- }
- var field = this[0];
- if ( field.createTextRange ) {
- var range = document.selection.createRange(),
- orig = field.value,
- teststring = "<->",
- textLength = range.text.length;
- range.text = teststring;
- var caretAt = field.value.indexOf(teststring);
- field.value = orig;
- this.selection(caretAt, caretAt + textLength);
- return {
- start: caretAt,
- end: caretAt + textLength
- }
- } else if( field.selectionStart !== undefined ){
- return {
- start: field.selectionStart,
- end: field.selectionEnd
- }
- }
-};
-
-})(jQuery);
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlView.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlView.js 2010-10-01 07:03:45 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlView.js 2011-01-06 17:00:27 +0000
@@ -1,6 +1,3 @@
-/**
- * Sql View
- */
function validateAddUpdateSqlView( mode )
{
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlViewData.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlViewData.js 2010-08-19 09:25:55 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlViewData.js 1970-01-01 00:00:00 +0000
@@ -1,102 +0,0 @@
-
-var basic_operators =
-[
- '*', 'COUNT(*)', 'COUNT(a)', 'DISTINCT()',
- 'SUM(a)', 'MIN(a)', 'MAX(a)', 'AVG(a)',
- 'AND ()', 'OR ()', 'BETWEEN a AND b'
-];
-
-var criteria_operators =
-[
- '<', '< \'\'', '< (SELECT FROM WHERE)',
- '<=', '<= \'\'', '<= (SELECT FROM WHERE)',
- '>', '> \'\'', '> (SELECT FROM WHERE)',
- '>=', '>= \'\'', '>= (SELECT FROM WHERE)',
- '=', '= \'\'', '= (SELECT FROM WHERE)',
- '!=', '!= \'\'', '!= (SELECT FROM WHERE)',
- '<>', '<> \'\'', '<> (SELECT FROM WHERE)',
- 'LIKE', 'LIKE \'\'', 'LIKE \'%\'', 'LIKE \'%%\'',
- 'LIKE (SELECT FROM WHERE)', 'IN (SELECT FROM WHERE)',
- 'BETWEEN a AND b', 'IN (a, b)'
-];
-
-var criteria_clone =
-[
- '<', '< \'\'', '< (SELECT FROM WHERE)',
- '<=', '<= \'\'', '<= (SELECT FROM WHERE)',
- '>', '> \'\'', '> (SELECT FROM WHERE)',
- '>=', '>= \'\'', '>= (SELECT FROM WHERE)',
- '=', '= \'\'', '= (SELECT FROM WHERE)',
- '!=', '!= \'\'', '!= (SELECT FROM WHERE)',
- '<>', '<> \'\'', '<> (SELECT FROM WHERE)',
- 'LIKE', 'LIKE \'\'', 'LIKE \'%\'', 'LIKE \'%%\'',
- 'LIKE (SELECT FROM WHERE)', 'IN (a, b)', 'IN (SELECT FROM WHERE)'
-];
-
-var keywords =
-[
- 'SELECT', 'SELECT *', 'SELECT COUNT(*)', 'SELECT DISTINCT()',
- 'COUNT(a)', 'SUM(a)', 'MIN(a)', 'MAX(a)', 'AVG(a)', 'AS',
- 'FROM', 'WHERE', 'ORDER BY', 'GROUP BY', 'ASC', 'DESC',
- 'HAVING', 'HAVING COUNT(*)', 'HAVING SUM(a)', 'HAVING MIN(a)',
- 'HAVING MAX(a)', 'HAVING AVG(a)', 'AND ()', 'OR ()', 'BETWEEN a AND b',
- 'JOIN <table_name> ON', 'RIGHT JOIN <table_name> ON', 'LEFT JOIN <table_name> ON'
-];
-
-
-/**
- The Regex global variables
- Carefully, using the Regex with test() method if pattern has //g
- pattern.test(field_1) --> true
- pattern.test(field_2) --> false
-
- In which, field_1 IS field_2
-*/
-
-var resourceComboId = "resource-table-combo";
-var propertyComboId = "resource-property-combo";
-var aliasFieldId = "alias-property";
-var showCheckboxId = "show-checkbox";
-var sortComboId = "sort-property-combo";
-var criteriaANDFieldId = "criteria_and_property";
-var criteriaORFieldId = "criteria_or_property";
-var groupbyCheckboxId = "groupby-property-checkbox";
-
-var regexStar = /^\s*\*\s*$/;
-
-var regexCountStar = /\s*count\s*\(\s*\*\s*\)\s*/i;
-var regexSumStar = /\s*sum\s*\(.*\*.*/i;
-var regexMinStar = /\s*min\s*\(.*\*.*/i;
-var regexMaxStar = /\s*max\s*\(.*\*.*/i;
-var regexAvgStar = /\s*avg\s*\(.*\*.*/i;
-var regexAverageStar = /\s*average\s*\(.*\*.*/i;
-
-var regexCountOther = /\s*count\s*\(\s*/i;
-var regexSumOther = /\s*sum\s*\(\s*/i;
-var regexMinOther = /\s*min\s*\(\s*/i;
-var regexMaxOther = /\s*max\s*\(\s*/i;
-var regexAvgOther = /\s*avg\s*\(\s*/i;
-var regexAverageOther = /\s*average\s*\(\s*/i;
-
-var regexCount = /count/i;
-var regexSum = /sum/i;
-var regexMin = /min/i;
-var regexMax = /max/i;
-var regexAvg = /avg/i;
-var regexAverage = /average/i;
-
-var selectQuery = "SELECT ";
-var fromQuery = "FROM ";
-var whereQuery = "WHERE ";
-var sortQuery = "ORDER BY ";
-var havingbyQuery = "HAVING ";
-var groupbyQuery = "GROUP BY ";
-
-var tableList = [];
-var table = "";
-var field = "";
-var alias = "";
-var sorttype = "";
-
-var fields = [1];
-var insertType = "after";
\ No newline at end of file
=== removed 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-12-21 05:04:23 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlViewDesignTool.js 1970-01-01 00:00:00 +0000
@@ -1,460 +0,0 @@
-/**
- * Sql View Design Tool
- */
-
-// -------------------------------------------------------------------------------------
-// Inits the first field
-// -------------------------------------------------------------------------------------
-
-htmlTables = "";
-htmlSortTypes = "";
-
-function initHtml( i18n_resourcetables, i18n_sorttypes )
-{
- htmlTables = "<option value=\"null\">[ "+i18n_resourcetables+" ]</option>";
- htmlTables += "<option value=\"_cocn\">_CategoryOptionComboname</option>";
- htmlTables += "<option value=\"_ous\">_OrgUnitStructure</option>";
- htmlTables += "<option value=\"_cs\">_CategoryStructure</option>";
- htmlTables += "<option value=\"_degss\">_DataElementGroupSetStructure</option>";
- htmlTables += "<option value=\"_icgss\">_IndicatorGroupSetStructure</option>";
- htmlTables += "<option value=\"_oustgss\">_OrganisationUnitGroupSetStructure</option>";
-
- htmlSortTypes = "<option value=\"null\">[ "+i18n_sorttypes+" ]</option>";
- htmlSortTypes += "<option value=\"ASC\">ASCENDING</option>";
- htmlSortTypes += "<option value=\"DESC\">DESCENDING</option>";
-}
-
-function initField( tableComboId, sortComboId )
-{
- createTableCombobox( tableComboId );
- createSortTypeCombobox( sortComboId );
-}
-
-function createTableCombobox( tableComboId )
-{
- $("#"+tableComboId).append( htmlTables );
-}
-
-function createSortTypeCombobox( sortComboId )
-{
- $("#"+sortComboId).append( htmlSortTypes );
-}
-
-function loadResourceProperties( tableName, fieldIndex )
-{
- if ( tableName != "null" )
- {
- $.getJSON(
- "getResourceProperties.action",
- {
- "name": tableName
- },
- function( json )
- {
- var list = byId( propertyComboId+fieldIndex );
- clearList( list );
-
- if ( json.message == "success" )
- {
- var properties = json.resourceProperties;
-
- addOptionToList(list, "*", "*");
- addOptionToList(list, "COUNT(*)", "COUNT(*)");
-
- for ( var i = 0 ; i < properties.length ; i++ )
- {
- addOptionToList(list, properties[i].name, properties[i].name);
- }
- }
- }
- );
- }
- else
- {
- clearList( byId( propertyComboId+fieldIndex ) );
- }
-
- setMessage(tableName);
-}
-
-function checkSelectedField( fieldValue, fieldIndex )
-{
- var aliasElement = byId( aliasFieldId+fieldIndex );
- var sortElement = byId( sortComboId+fieldIndex );
- var criteriaANDElement = byId( criteriaANDFieldId+fieldIndex );
- var criteriaORElement = byId( criteriaORFieldId+fieldIndex );
- var groupbyElement = byId( groupbyCheckboxId+fieldIndex );
-
- if ( regexStar.test(fieldValue) )
- {
- aliasElement.value = "";
- aliasElement.disabled = true;
- sortElement.disabled = true;
- sortElement.options[0].selected = true;
- criteriaANDElement.value = "";
- criteriaORElement.value = "";
- criteriaANDElement.disabled = true;
- criteriaORElement.disabled = true;
- groupbyElement.disabled = true;
- groupbyElement.checked = false;
- }
- else if ( regexCountStar.test(fieldValue) )
- {
- aliasElement.disabled = false;
- sortElement.disabled = true;
- sortElement.options[0].selected = true;
- criteriaANDElement.disabled = false;
- criteriaORElement.disabled = false;
- groupbyElement.disabled = true;
- groupbyElement.checked = false;
- }
- else
- {
- aliasElement.disabled = false;
- sortElement.disabled = false;
- criteriaANDElement.disabled = false;
- criteriaORElement.disabled = false;
- groupbyElement.disabled = false;
- }
-}
-
-// -------------------------------------------------------------------------------------
-// Designs query
-// -------------------------------------------------------------------------------------
-
-function showOrHideDesignQueryDiv()
-{
- // if true its means div is showing
- if ( !advanceStatus )
- {
- $("#mainDesignQueryDiv").show("fast");
- $("#advance_button").val( i18n_hide_advance );
- }
- else
- {
- $("#mainDesignQueryDiv").hide("fast");
- $("#advance_button").val( i18n_show_advance );
- }
- advanceStatus = !advanceStatus;
-}
-
-function getJoinTable()
-{
- var alertMessage = "";
-
- for (var i = 0; i < fields.length; i++)
- {
- table = $("#"+resourceComboId+fields[i]).val();
-
- if ( table != "null" )
- {
- /**
- * FROM keyword
- */
- if ( getIndexByValue(table, tableList) == -1 )
- {
- tableList.push(table);
- }
- }
- else
- {
- alertMessage += i18n_resourcetable_at_position + " [ " + (i+1) + " ] " + i18n_unselected_yet + "\n";
- }
- }
-
- if ( alertMessage != "" )
- {
- alert( alertMessage );
- return;
- }
- else
- {
- getJoinQuery();
- }
-}
-
-function getJoinQuery()
-{
- var url = "autoJoinResourceTables.action?";
-
- for (var i in tableList)
- {
- url += "tableList=" + tableList[i];
- url += (i < tableList.length-1) ? "&" : "";
- }
-
- $.getJSON(
- url, function( json )
- {
- fromQuery = json.result;
- setUpQuery();
- }
- );
-}
-function setUpQuery()
-{
- var index = "";
- var shows = document.getElementsByName( showCheckboxId );
-
- for (var i = 0; i < shows.length; i++)
- {
- index = fields[i];
- table = $("#"+resourceComboId+index).val();
-
- if ( table != "null" )
- {
- field = checkFieldValid( table, $("#"+propertyComboId+index).val().trim() );
- alias = $("#"+aliasFieldId+index).val().trim();
- criteriaAND = $("#"+criteriaANDFieldId+index).val().trim();
- criteriaOR = $("#"+criteriaORFieldId+index).val().trim();
- sorttype = $("#"+sortComboId+index).val().trim();
- groupby = $("#"+groupbyCheckboxId+index).is(':checked');
-
- /**
- * SELECT keyword
- */
- if ( shows[i].checked )
- {
- if ( selectQuery != "SELECT " )
- {
- selectQuery += ", ";
- }
- selectQuery += field + ((alias != "") == true ? " AS " + alias : alias);
- }
-
- /**
- * WHERE and/or HAVING keyword
- */
- if ( criteriaAND != "" )
- {
- if ( regexCountOther.test(field) || regexSumOther.test(field) || regexMinOther.test(field) || regexMaxOther.test(field) || regexAvgOther.test(field) || regexAverageOther.test(field) )
- {
- if ( havingbyQuery != "HAVING " )
- {
- havingbyQuery += " AND ";
- }
- havingbyQuery += "("+ field + " " + criteriaAND +")" ;
- }
- else
- {
- if ( whereQuery != "WHERE " )
- {
- whereQuery += " AND ";
- }
- whereQuery += "("+ field + " " + criteriaAND +")" ;
- }
- }
- if ( criteriaOR != "" )
- {
- if ( regexCountOther.test(field) || regexSumOther.test(field) || regexMinOther.test(field) || regexMaxOther.test(field) || regexAvgOther.test(field) || regexAverageOther.test(field) )
- {
- if ( havingbyQuery != "HAVING " )
- {
- havingbyQuery += " OR ";
- }
- havingbyQuery += "("+ field + " " + criteriaOR +")" ;
- }
- else
- {
- if ( whereQuery != "WHERE " )
- {
- whereQuery += " OR ";
- }
- whereQuery += "("+ field + " " + criteriaOR +")" ;
- }
- }
-
- /**
- * ORDER BY keyword
- */
- if ( (sortQuery == "ORDER BY ") && ((sorttype == "ASC") || (sorttype == "DESC")) )
- {
- sortQuery += field + " " + sorttype;
- }
-
- /**
- * GROUP BY keyword
- */
- if ( groupby )
- {
- if ( groupbyQuery != "GROUP BY " )
- {
- groupbyQuery += ", ";
- }
- groupbyQuery += "(" + field + ")";
- }
- }
- }
-
- combineQuery();
- resetQuery();
-}
-
-function checkFieldValid( tableName, fieldValue )
-{
- if ( regexCountStar.test(fieldValue) )
- {
- return makeUpField( fieldValue.replace(regexCountStar, "COUNT("+tableName+".*)") );
- }
- else if ( regexCountOther.test(fieldValue) )
- {
- return makeUpField( fieldValue.replace(regexCountOther, "COUNT(") );
- }
-
- if ( regexSumOther.test(fieldValue) )
- {
- return makeUpField( fieldValue.replace(regexSumOther, "SUM(") );
- }
- else if ( regexMinOther.test(fieldValue) )
- {
- return makeUpField( fieldValue.replace(regexMinOther, "MIN(") );
- }
- else if ( regexMaxOther.test(fieldValue) )
- {
- return makeUpField( fieldValue.replace(regexMaxOther, "MAX(") );
- }
- else if ( regexAvgOther.test(fieldValue) )
- {
- return makeUpField( fieldValue.replace(regexAvgOther, "AVG(") );
- }
- else if ( regexAverageOther.test(fieldValue) )
- {
- return makeUpField( fieldValue.replace(regexAverageOther, "AVG(") );
- }
-
- return tableName + "." + fieldValue;
-}
-
-function makeUpField( fieldValue )
-{
- return fieldValue.replace(/\s+/g, " ").replace(/\s*\)/g, ")" );
-}
-
-function combineQuery()
-{
- var curValue = $("#sqlquery").val().trim();
- var result = selectQuery + "\n" + fromQuery;
- result += (whereQuery == "WHERE ") == true ? "" : whereQuery + "\n";
- result += (groupbyQuery == "GROUP BY ") == true ? "" : groupbyQuery + "\n";
- result += (havingbyQuery == "HAVING ") == true ? "" : havingbyQuery + "\n";
- result += (sortQuery == "ORDER BY ") == true ? "" : sortQuery + "\n";
-
- if ( (curValue != "SELECT") && (curValue != '') )
- {
- $("#sqlquery").val(curValue + "; \n\n" + result);
- }
- else
- {
- $("#sqlquery").val(result);
- }
-}
-
-function resetQuery()
-{
- selectQuery = "SELECT ";
- fromQuery = "FROM ";
- whereQuery = "WHERE ";
- sortQuery = "ORDER BY ";
- havingbyQuery = "HAVING ";
- groupbyQuery = "GROUP BY ";
-
- tableList = [];
- table = "";
- field = "";
- alias = "";
- sorttype = "";
-}
-
-function generateQueryColumn( mainId, insertPos )
-{
- columnIndex ++;
- curAppendedColumnId = "appendedColumn"+columnIndex;
-
- htmlString = "<td id=\""+curAppendedColumnId+"\"><table>";
- htmlString += "<tr><td align=\"center\"><label style=\"color:white\" class=\"ui-widget-header ui-corner-all\">"+i18n_header_field+" "+columnIndex+"</label>";
- htmlString += "<a href=\"javascript:closeAppendedField("+columnIndex+")\" title='"+i18n_close+"'>";
- htmlString += "<img src=\"../images/close.png\" alt='"+i18n_close+"' align=\"right\"/></a></td></tr>";
- htmlString += "<tr><td><select id=\""+resourceComboId+columnIndex+"\" style=\"width:180px\" onchange=\"loadResourceProperties(this.value, "+columnIndex+")\"></select></td></tr>";
- htmlString += "<tr><td><select id=\""+propertyComboId+columnIndex+"\" style=\"width:180px\" onchange=\"checkSelectedField(this.value, "+columnIndex+")\" onkeyup=\"\" onblur=\"\"></select></td></tr>";
- htmlString += "<tr><td><input id=\""+aliasFieldId+columnIndex+"\" style=\"width:175px\" disabled/></td></tr>";
- htmlString += "<tr><td align=\"center\"><input type=\"checkbox\" name=\""+showCheckboxId+"\"/></td></tr>";
- htmlString += "<tr><td><select id=\""+sortComboId+columnIndex+"\" style=\"width:180px\" disabled></select></td></tr>";
- htmlString += "<tr><td><input type=\"text\" id=\""+criteriaANDFieldId+columnIndex+"\" style=\"width:175px\" disabled/></td></tr>";
- htmlString += "<tr><td><input type=\"text\" id=\""+criteriaORFieldId+columnIndex+"\" style=\"width:175px\" disabled/></td></tr>";
- htmlString += "<tr><td align=\"center\"><input type=\"checkbox\" id=\""+groupbyCheckboxId+columnIndex+"\" disabled/>";
- htmlString += "<a href=\"javascript:appendField("+columnIndex+")\" title='"+i18n_append+"'>";
- htmlString += "<img src=\"../images/add_small.png\" alt='"+i18n_append+"' align=\"right\"/></a></td></tr>";
- htmlString += "</table></td>";
-
- if ( insertPos == insertType )
- {
- $("#appendedColumn"+mainId).after( htmlString );
- fields.splice( getIndexByValue(mainId, fields)+1, 0, columnIndex );
- }
- else
- {
- $("#"+mainId).append(htmlString);
- fields.push( columnIndex );
- }
-
- initField( resourceComboId+columnIndex, sortComboId+columnIndex );
- applyAutocompleteSupporting( criteria_operators, criteriaANDFieldId+columnIndex, 225 );
- applyAutocompleteSupporting( criteria_operators, criteriaORFieldId+columnIndex, 225 );
-}
-
-function getIndexById( elementId, array )
-{
- var number = eval(elementId.slice(14));
- return $.inArray(number, array);
-}
-
-function getIndexByValue( value, array )
-{
- return $.inArray(value, array);
-}
-
-function applyAutocompleteSupporting(data, fieldElementId, customWidth)
-{
- jQuery("#"+fieldElementId).autocomplete(data, {
- multiple: true,
- //autoFill: true,
- width: customWidth
- });
-}
-
-function removeAllQueryColumn()
-{
- if ( columnIndex == 1 )
- {
- alert( i18n_cannot_remove_any_more );
- }
- else
- {
- while ( columnIndex > 1 )
- {
- if ( byId(curAppendedColumnId) != null )
- {
- $("#"+curAppendedColumnId).remove();
- }
- columnIndex --;
- curAppendedColumnId = "appendedColumn"+columnIndex;
- }
-
- fields = Array("1");
- tableList = Array();
- }
-}
-
-function closeAppendedField( removedIndex )
-{
- $("#appendedColumn"+removedIndex).remove();
-
- fields = jQuery.grep( fields, function(value) {
- return value != removedIndex
- });
-}
-
-function appendField( previousIndex )
-{
- generateQueryColumn( previousIndex, insertType );
-}
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonJoinQuery.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonJoinQuery.vm 2010-08-19 09:25:55 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonJoinQuery.vm 1970-01-01 00:00:00 +0000
@@ -1,3 +0,0 @@
-{
- "result": "$!encoder.jsEncode( ${fromJoinQuery} )"
-}
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonResourceProperties.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonResourceProperties.vm 2010-08-19 09:25:55 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonResourceProperties.vm 1970-01-01 00:00:00 +0000
@@ -1,13 +0,0 @@
-#set( $size = $resourceProperties.size() )
-{
- "message": #if ( $size > 0 ) "success" #else "" #end,
- "resourceProperties":
- [
- #foreach( $resourceProperty in $resourceProperties )
- {
- "name": "$resourceProperty"
- }
- #if( $velocityCount < $size ),#end
- #end
- ]
-}
=== removed directory 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/style'
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/style/jquery.autocomplete.css'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/style/jquery.autocomplete.css 2010-08-09 03:57:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/style/jquery.autocomplete.css 1970-01-01 00:00:00 +0000
@@ -1,48 +0,0 @@
-.ac_results {
- padding: 0px;
- border: 1px solid black;
- background-color: white;
- overflow: hidden;
- z-index: 99999;
-}
-
-.ac_results ul {
- width: 100%;
- list-style-position: outside;
- list-style: none;
- padding: 0;
- margin: 0;
-}
-
-.ac_results li {
- margin: 0px;
- padding: 2px 5px;
- cursor: default;
- display: block;
- /*
- if width will be 100% horizontal scrollbar will apear
- when scroll mode will be used
- */
- width: 100%;
- font: menu;
- font-size: 12px;
- /*
- it is very important, if line-height not setted or setted
- in relative units scroll will be broken in firefox
- */
- line-height: 16px;
- overflow: hidden;
-}
-
-.ac_loading {
- background: white url('indicator.gif') right center no-repeat;
-}
-
-.ac_odd {
- background-color: #eee;
-}
-
-.ac_over {
- background-color: #0A246A;
- color: white;
-}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateSqlViewForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateSqlViewForm.vm 2010-09-21 06:16:05 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateSqlViewForm.vm 2011-01-06 17:00:27 +0000
@@ -1,22 +1,10 @@
<script>
-//-----------------------------------------------------------------------
-//init jQuery validation for updateSqlViewForm
-//-----------------------------------------------------------------------
+jQuery(document).ready(function() {
- jQuery(document).ready(function() {
-
- validation( 'updateSqlViewForm', function() {
- validateAddUpdateSqlView( 'update' );
- });
-
- hideById("mainDesignQueryDiv");
- initHtml(i18n_resourcetables, i18n_sorttypes);
- initField("resource-table-combo1", "sort-property-combo1");
- applyAutocompleteSupporting(jQuery.merge(criteria_clone, keywords), "sqlquery", $("#sqlquery").width() );
- applyAutocompleteSupporting(criteria_operators, "criteria_and_property1", 225 );
- applyAutocompleteSupporting(criteria_operators, "criteria_or_property1", 225 );
+ validation( 'updateSqlViewForm', function() {
+ validateAddUpdateSqlView( 'update' );
});
-
+});
</script>
<input type="hidden" id="curLocaleCode" value="$locale.getLanguage()_$locale.getCountry()"/>
@@ -47,97 +35,10 @@
<tr>
<td></td>
<td><input type="submit" value="$i18n.getString( 'update' )" style="width:10em"/>
- <input type="button" value="$i18n.getString( 'cancel' )" id="cancel" name="cancel" onclick="window.location.href='showSqlViewListForm.action'" style="width:10em"/>
- <input type="button" value="$i18n.getString( 'show_advance' )" id="advance_button" name="advance_button" onclick="showOrHideDesignQueryDiv()" style="width:10em"/></td>
+ <input type="button" value="$i18n.getString( 'cancel' )" id="cancel" name="cancel" onclick="window.location.href='showSqlViewListForm.action'" style="width:10em"/>
</tr>
</table>
</form>
-<br/><br/>
-
-<div id="mainDesignQueryDiv">
- <table id="mainTable">
- <tr id="mainRow">
- <td id="appendedColumn1">
- <table>
- <tr>
- <td></td>
- <td align="center"><label style="color:white" class="ui-widget-header ui-corner-all">
- $encoder.htmlEncode( $i18n.getString( "header_field" )) 1</label>
- <img src="../images/transparent.gif" align="right"/></td>
- </tr>
- <tr><td><label for="sql_statement">$encoder.htmlEncode($i18n.getString( "resource_table" )): </label></td>
- <td><select id="resource-table-combo1" style="width:180px" onchange="loadResourceProperties(this.value, 1)">
- </select></td>
- </tr>
- <tr><td><label for="sql_statement">$encoder.htmlEncode($i18n.getString( "field" )): </label></td>
- <td><select id="resource-property-combo1" style="width:180px" onchange="checkSelectedField(this.value, 1)">
- </select></td>
- </tr>
- <tr>
- <td><label for="sql_statement">$encoder.htmlEncode($i18n.getString( "alias" )): </label></td>
- <td><input id="alias-property1" style="width:175px" disabled /></td>
- </tr>
- <tr>
- <td><label for="sql_statement">$encoder.htmlEncode($i18n.getString( "show" )): </label></td>
- <td align="center"><input type="checkbox" name="show-checkbox"/></td>
- </tr>
- <tr>
- <td><label for="sql_statement">$encoder.htmlEncode($i18n.getString( "sort" )): </label></td>
- <td><select id="sort-property-combo1" style="width:180px" disabled >
- </select></td>
- </tr>
- <tr>
- <td><label for="sql_statement">$encoder.htmlEncode($i18n.getString( "criteria_and" )): </label></td>
- <td><input id="criteria_and_property1" style="width:175px" disabled /></td>
- </tr>
- <tr>
- <td><label for="sql_statement">$encoder.htmlEncode($i18n.getString( "criteria_or" )): </label></td>
- <td><input id="criteria_or_property1" style="width:175px" disabled /></td>
- </tr>
- <tr>
- <td><label for="sql_statement">$encoder.htmlEncode($i18n.getString( "group_by" )): </label></td>
- <td align="center"><input type="checkbox" id="groupby-property-checkbox1" disabled />
- <a href="javascript:appendField(1)" title="$encoder.htmlEncode($i18n.getString( 'append' ))">
- <img src="../images/add_small.png" alt="$encoder.htmlEncode($i18n.getString( 'append' ))" align="right"/></a>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table><br/>
- <input type="button" id="designQueryButton" value="$i18n.getString( 'generate_query' )" style="width:10em" onclick="getJoinTable()"/>
- <input type="button" value="$encoder.htmlEncode($i18n.getString( 'add_new_field' ))" onclick="generateQueryColumn('mainRow')"/>
- <input type="button" value="$encoder.htmlEncode($i18n.getString( 'reset' ))" onclick="removeAllQueryColumn()"/>
- <br/>
-</div>
<span id="message"></span>
-
-<script type="text/javascript">
-
- /**
- Global variables
- @param comboBoxNo comboBoxNo is the default number of comboBoxes
- */
- columnIndex = 1;
- curAppendedColumnId = "";
- advanceStatus = false;
-
- var i18n_header_field = "$encoder.jsEscape($i18n.getString( 'header_field' ) , "'")";
- var i18n_resourcetables = "$encoder.jsEscape($i18n.getString( 'select_resourcetables' ) , "'")";
- var i18n_properties = "$encoder.jsEscape($i18n.getString( 'select_properties' ) , "'")";
- var i18n_properties_welformed = "$encoder.jsEscape($i18n.getString( 'properties_welformed' ) , "'")";
- var i18n_syntax_error_parameter_required = "$encoder.jsEscape($i18n.getString( 'syntax_error_parameter_required' ) , "'")";
- var i18n_sorttypes = "$encoder.jsEscape($i18n.getString( 'select_sorttypes' ) , "'")";
- var i18n_ascending = "$encoder.jsEscape($i18n.getString( 'ascending' ) , "'")";
- var i18n_descending = "$encoder.jsEscape($i18n.getString( 'descending' ) , "'")";
- var i18n_cannot_remove_any_more = "$encoder.jsEscape($i18n.getString( 'cannot_remove_any_more' ) , "'")";
- var i18n_show_advance = "$encoder.jsEscape($i18n.getString( 'show_advance' ) , "'")";
- var i18n_hide_advance = "$encoder.jsEscape($i18n.getString( 'hide_advance' ) , "'")";
- var i18n_close = "$encoder.jsEscape($i18n.getString( 'close' ) , "'")";
- var i18n_append = "$encoder.jsEscape($i18n.getString( 'append' ) , "'")";
- var i18n_resourcetable_at_position = "$encoder.jsEscape($i18n.getString( 'resourcetable_at_position' ) , "'")";
- var i18n_unselected_yet = "$encoder.jsEscape($i18n.getString( 'unselected_yet' ) , "'")";
-
-</script>
\ No newline at end of file