summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpshi2011-12-16 01:31:57 (EST)
committer mwu2011-12-16 01:31:57 (EST)
commitcc771be2f30825c73a692c896dcb30f641bd0f17 (patch)
tree4e062fa667d2423f9d05b8b6f61e3be4bf51aac1
parent230cb79e1edeb23838a5680ed8f610bc7ca05d73 (diff)
downloadorg.eclipse.birt-cc771be2f30825c73a692c896dcb30f641bd0f17.zip
org.eclipse.birt-cc771be2f30825c73a692c896dcb30f641bd0f17.tar.gz
org.eclipse.birt-cc771be2f30825c73a692c896dcb30f641bd0f17.tar.bz2
fix ted 45554,Support for Hadoop Big Data using Hive JDBC
-rw-r--r--data/org.eclipse.birt.report.data.oda.hive/plugin.xml8
-rw-r--r--data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/profile/JDBCSelectionPageHelper.java35
-rw-r--r--data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/util/JDBCDriverInfoManager.java3
-rw-r--r--data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/util/JDBCDriverInformation.java19
-rw-r--r--data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/jdbc/OdaJdbcDriver.java2
5 files changed, 56 insertions, 11 deletions
diff --git a/data/org.eclipse.birt.report.data.oda.hive/plugin.xml b/data/org.eclipse.birt.report.data.oda.hive/plugin.xml
index 0f776c9..00082e9 100644
--- a/data/org.eclipse.birt.report.data.oda.hive/plugin.xml
+++ b/data/org.eclipse.birt.report.data.oda.hive/plugin.xml
@@ -117,13 +117,5 @@
class="org.eclipse.datatools.connectivity.oda.profile.OdaConnectionFactory"
profile="%oda.data.source.id"/>
</extension>
-
- <extension
- point="org.eclipse.birt.report.data.oda.jdbc.driverinfo">
- <jdbcDriver
- driverClass="org.eclipse.birt.report.data.oda.hive.HiveDriver"
- name="%jdbc.driver.name"
- urlTemplate="jdbc:hive://localhost:10000/default"/>
- </extension>
</plugin>
diff --git a/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/profile/JDBCSelectionPageHelper.java b/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/profile/JDBCSelectionPageHelper.java
index 749a46a..e1dfa40 100644
--- a/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/profile/JDBCSelectionPageHelper.java
+++ b/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/profile/JDBCSelectionPageHelper.java
@@ -26,6 +26,7 @@ import org.eclipse.birt.report.data.oda.jdbc.ui.util.Constants;
import org.eclipse.birt.report.data.oda.jdbc.ui.util.DriverLoader;
import org.eclipse.birt.report.data.oda.jdbc.ui.util.ExceptionHandler;
import org.eclipse.birt.report.data.oda.jdbc.ui.util.IHelpConstants;
+import org.eclipse.birt.report.data.oda.jdbc.ui.util.JDBCDriverInfoManager;
import org.eclipse.birt.report.data.oda.jdbc.ui.util.JDBCDriverInformation;
import org.eclipse.birt.report.data.oda.jdbc.ui.util.JdbcToolKit;
import org.eclipse.birt.report.data.oda.jdbc.ui.util.Utility;
@@ -137,7 +138,24 @@ public class JDBCSelectionPageHelper
gridData.horizontalAlignment = SWT.FILL;
driverChooserCombo.getControl( ).setLayoutData( gridData );
- List driverList = JdbcToolKit.getJdbcDriversFromODADir( JDBC_EXTENSION_ID );
+ List driverListTmp1 = JdbcToolKit.getJdbcDriversFromODADir( JDBC_EXTENSION_ID );
+ JDBCDriverInformation[] driverListTmp2 = JDBCDriverInfoManager.getDrivers( );
+ List driverList = new ArrayList( );
+ for ( Object driverInfo : driverListTmp1 )
+ {
+ if ( needCheckHide( driverListTmp2,
+ (JDBCDriverInformation) driverInfo ) )
+ {
+ if ( !( (JDBCDriverInformation) driverInfo ).getHide( ) )
+ {
+ driverList.add( driverInfo );
+ }
+ }
+ else
+ {
+ driverList.add( driverInfo );
+ }
+ }
driverChooserCombo.setContentProvider( new IStructuredContentProvider( ) {
public Object[] getElements( Object inputElement )
@@ -317,6 +335,21 @@ public class JDBCSelectionPageHelper
verifyJDBCProperties( );
}
+ private boolean needCheckHide( JDBCDriverInformation[] driverInfos,
+ JDBCDriverInformation info )
+ {
+ for ( JDBCDriverInformation driverInfo : driverInfos )
+ {
+ if ( driverInfo.getDriverClassName( )
+ .equals( info.getDriverClassName( ) ) )
+ {
+ info.setHide( driverInfo.getHide( ) );
+ return true;
+ }
+ }
+ return false;
+ }
+
/**
* give a certain class name , set the combo selection.
*
diff --git a/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/util/JDBCDriverInfoManager.java b/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/util/JDBCDriverInfoManager.java
index a8e4d4a..5bd83c4 100644
--- a/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/util/JDBCDriverInfoManager.java
+++ b/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/util/JDBCDriverInfoManager.java
@@ -47,7 +47,7 @@ public class JDBCDriverInfoManager
if ( configElements[e].getName( ).equals(
OdaJdbcDriver.Constants.DRIVER_INFO_ELEM_JDBCDRIVER ) )
{
- drivers.add( newJdbcDriverInfo( configElements[e] ));
+ drivers.add( newJdbcDriverInfo( configElements[e] ) );
}
}
}
@@ -68,6 +68,7 @@ public class JDBCDriverInfoManager
configElement.getAttribute( OdaJdbcDriver.Constants.DRIVER_INFO_ATTR_NAME ) );
driverInfo.setUrlFormat(
configElement.getAttribute( OdaJdbcDriver.Constants.DRIVER_INFO_ATTR_URLTEMPL ) );
+ driverInfo.setHide( configElement.getAttribute( "hide" ) );
return driverInfo;
}
diff --git a/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/util/JDBCDriverInformation.java b/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/util/JDBCDriverInformation.java
index 86aa28f..7ec5f51 100644
--- a/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/util/JDBCDriverInformation.java
+++ b/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/util/JDBCDriverInformation.java
@@ -35,6 +35,7 @@ public final class JDBCDriverInformation
private int minorVersion = 0;
private String urlFormat = null;
private String driverDisplayName = null;
+ private boolean hide = false;
/**
* Since factory methods are provided, it is recommended to make
@@ -157,6 +158,24 @@ public final class JDBCDriverInformation
this.driverDisplayName = displayName;
}
+ public boolean getHide( )
+ {
+ return hide;
+ }
+
+ public void setHide( String hide )
+ {
+ if ( hide != null )
+ {
+ this.hide = hide.equals( "true" ) ? true : false;
+ }
+ }
+
+ public void setHide( boolean flag )
+ {
+ this.hide = flag;
+ }
+
/*
* @see java.lang.Object#toString()
*/
diff --git a/data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/jdbc/OdaJdbcDriver.java b/data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/jdbc/OdaJdbcDriver.java
index b388a2f..3e4723a 100644
--- a/data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/jdbc/OdaJdbcDriver.java
+++ b/data/org.eclipse.birt.report.data.oda.jdbc/src/org/eclipse/birt/report/data/oda/jdbc/OdaJdbcDriver.java
@@ -54,7 +54,7 @@ public class OdaJdbcDriver implements IDriver
public static final String DRIVER_INFO_ATTR_URLTEMPL = "urlTemplate";
public static final String DRIVER_INFO_ATTR_CONNFACTORY = "connectionFactory";
public static final String DRIVER_INFO_ELEM_JDBCDRIVER = "jdbcDriver";
-
+ public static final String DRIVER_INFO_ATTR_HIDE = "hide";
}
/*