Skip to content

Commit

Permalink
fixed UI issues when DtE tries to resolve resource path.
Browse files Browse the repository at this point in the history
Signed-off-by: Rick Lu <rlu@actuate.com>
  • Loading branch information
lllxin committed Dec 17, 2015
1 parent ace4889 commit b45b139
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,10 @@ private static String encode( String location )
{
try
{
// expects the absolute path. Remove place to avoid relative path.
return new File( location ).toURI( )
.toASCIIString( )
.replace( new File( "" ).toURI( ).toASCIIString( ), "" ); //$NON-NLS-1$//$NON-NLS-2$
.toASCIIString( );
//.replace( new File( "" ).toURI( ).toASCIIString( ), "" ); //$NON-NLS-1$//$NON-NLS-2$
}
catch ( Exception e )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@

package org.eclipse.birt.report.data.oda.jdbc.ui.editors;

import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

import org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager;
import org.eclipse.datatools.connectivity.oda.IConnection;
import org.eclipse.datatools.connectivity.oda.IDriver;
import org.eclipse.datatools.connectivity.oda.OdaException;
import org.eclipse.datatools.connectivity.oda.design.DataSourceDesign;
import org.eclipse.datatools.connectivity.oda.design.ResourceIdentifiers;
import org.eclipse.datatools.connectivity.oda.design.ui.designsession.DesignSessionUtil;


Expand All @@ -44,6 +47,16 @@ IConnection openConnection( ) throws OdaException
try
{
connection = jdbcDriver.getConnection( dataSourceDesign.getEffectiveOdaExtensionId( ) );

Map appContext = new HashMap( );
ResourceIdentifiers resourceIdentifiers = dataSourceDesign.getHostResourceIdentifiers();
if ( resourceIdentifiers != null )
{
appContext.put( org.eclipse.datatools.connectivity.oda.util.ResourceIdentifiers.ODA_APP_CONTEXT_KEY_CONSUMER_RESOURCE_IDS,
DesignSessionUtil.createRuntimeResourceIdentifiers( resourceIdentifiers ) );
}
connection.setAppContext(appContext);

Properties prop = DesignSessionUtil.getEffectiveDataSourceProperties( dataSourceDesign );
connection.open( prop );
}
Expand Down

0 comments on commit b45b139

Please sign in to comment.