Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
git sync
  • Loading branch information
Bharadwaj14 committed Jun 8, 2018
2 parents 7d874f2 + 758df0f commit 8e9ce5f
Show file tree
Hide file tree
Showing 24 changed files with 1,747 additions and 1,596 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.util.Map;

import org.eclipse.birt.core.exception.BirtException;
import org.eclipse.birt.data.engine.api.DataEngineContext.DataEngineFlowMode;
import org.eclipse.birt.data.engine.api.IResultIterator;
import org.eclipse.birt.report.engine.api.EngineConfig;
import org.eclipse.birt.report.engine.api.IDatasetPreviewTask;
Expand Down Expand Up @@ -56,6 +57,25 @@ public void open( Map appContext, EngineConfig config ) throws BirtException
ReportParameterUtil.completeParamDefalutValues( task, dataSetHandle.getModuleHandle( ) );
}

public void open( Map appContext, EngineConfig config,
DataEngineFlowMode flowMode ) throws BirtException
{
engine = createReportEngine( config );
if ( mode == PreviewType.RESULTSET )
{
task = engine.createDatasetPreviewTask( );
task.setDataEngineFlowMode( flowMode );
}
else
{
task = new OutParameterPreviewTask( (ReportEngine) engine );
}
task.setMaxRow( maxRow );
task.setDataSet( dataSetHandle );
task.setAppContext( appContext );
ReportParameterUtil.completeParamDefalutValues( task, dataSetHandle.getModuleHandle( ) );
}

public DataSetPreviewer( DataSetHandle dataSetHandle, int maxRow, PreviewType mode )
{
this.dataSetHandle = dataSetHandle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.util.List;

import org.eclipse.birt.core.exception.BirtException;
import org.eclipse.birt.data.engine.api.DataEngineContext.DataEngineFlowMode;
import org.eclipse.birt.report.data.adapter.api.DataRequestSession;
import org.eclipse.birt.report.data.adapter.api.timeFunction.BaseTimeFunction;
import org.eclipse.birt.report.data.adapter.api.timeFunction.IArgumentInfo;
Expand Down Expand Up @@ -60,6 +61,15 @@ public List getSelectValueList( Expression expression,
dataSetHandle,
useDataSetFilter );
}

public List getSelectValueList( Expression expression,
DataSetHandle dataSetHandle, DataEngineFlowMode flowMode )
throws BirtException
{
return DistinctValueSelector.getSelectValueList( expression,
dataSetHandle,
flowMode );
}

public List getSelectValueFromBinding( Expression expression,
DataSetHandle dataSetHandle, Iterator binding,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.eclipse.birt.core.data.ExpressionUtil;
import org.eclipse.birt.core.exception.BirtException;
import org.eclipse.birt.data.engine.api.IResultIterator;
import org.eclipse.birt.data.engine.api.DataEngineContext.DataEngineFlowMode;
import org.eclipse.birt.data.engine.api.querydefn.ScriptExpression;
import org.eclipse.birt.data.engine.core.DataException;
import org.eclipse.birt.report.data.adapter.api.DataRequestSession;
Expand Down Expand Up @@ -86,12 +87,26 @@ public static List getSelectValueList( Expression expression,
return getSelectValueList1( expression,
dataSetHandle.getRoot( ),
dataSetHandle,
useDataSetFilter );
useDataSetFilter,
DataEngineFlowMode.NORMAL );
}

public static List getSelectValueList( Expression expression,
DataSetHandle dataSetHandle, DataEngineFlowMode flowMode )
throws BirtException
{

return getSelectValueList1( expression,
dataSetHandle.getRoot( ),
dataSetHandle,
false,
flowMode );
}

private static List getSelectValueList1( Expression expression, ModuleHandle moduleHandle,
DataSetHandle dataSetHandle, boolean useDataSetFilter ) throws BirtException
private static List getSelectValueList1( Expression expression,
ModuleHandle moduleHandle, DataSetHandle dataSetHandle,
boolean useDataSetFilter, DataEngineFlowMode flowMode )
throws BirtException
{
ScriptExpression expr = null;
DataSetHandle targetHandle = dataSetHandle;
Expand Down Expand Up @@ -150,7 +165,7 @@ private static List getSelectValueList1( Expression expression, ModuleHandle mod
appContext.put( resouceIDs,identifiers);

AppContextPopulator.populateApplicationContext( targetHandle, appContext );
previewer.open( appContext, getEngineConfig( targetHandle.getModuleHandle( ) ) );
previewer.open( appContext, getEngineConfig( targetHandle.getModuleHandle( ) ), flowMode );
IResultIterator itr = previewer.preview( ) ;

Set visitedValues = new HashSet( );
Expand Down Expand Up @@ -187,9 +202,12 @@ private static List getSelectValueList1( Expression expression, ModuleHandle mod
public static List getSelectValueList( Expression expression, ModuleHandle moduleHandle,
DataSetHandle dataSetHandle, boolean useDataSetFilter ) throws BirtException
{
return getSelectValueList1( expression, moduleHandle, dataSetHandle, useDataSetFilter );
}

return getSelectValueList1( expression,
moduleHandle,
dataSetHandle,
useDataSetFilter,
DataEngineFlowMode.NORMAL );
}


private static EngineConfig getEngineConfig( ModuleHandle handle )
Expand Down Expand Up @@ -355,5 +373,4 @@ public static List getSelectValueFromBinding( Expression expression,
groupIterator, useDataSetFilter );
}


}
1 change: 0 additions & 1 deletion UI/org.eclipse.birt.report.designer.ui.rcp/BIRT.product
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
<plugin id="org.apache.batik.dom" version="1.7.0.qualifier"/>
<plugin id="org.apache.batik.dom.svg" version="1.7.0.qualifier"/>
<plugin id="org.apache.batik.ext.awt" version="1.7.0.qualifier"/>
<plugin id="org.apache.batik.ext.awt.extension" version="1.7.0" fragment="true"/>
<plugin id="org.apache.batik.parser" version="1.7.0.qualifier"/>
<plugin id="org.apache.batik.svggen" version="1.7.0.qualifier"/>
<plugin id="org.apache.batik.transcoder" version="1.7.0.qualifier"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.util.List;

import org.eclipse.birt.core.exception.BirtException;
import org.eclipse.birt.data.engine.api.DataEngineContext.DataEngineFlowMode;
import org.eclipse.birt.report.designer.internal.ui.data.DataService;
import org.eclipse.birt.report.model.api.DataSetHandle;
import org.eclipse.birt.report.model.api.Expression;
Expand Down Expand Up @@ -85,6 +86,15 @@ public static List getSelectValueList( Expression expression,
dataSetHandle,
useDataSetFilter );
}

public static List getSelectValueList( Expression expression,
DataSetHandle dataSetHandle, DataEngineFlowMode flowMode )
throws BirtException
{
return DataService.getInstance( ).getSelectValueList( expression,
dataSetHandle,
flowMode );
}

public static List getSelectValueList( Expression expression,
ModuleHandle moduleHandle, DataSetHandle dataSetHandle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.List;

import org.eclipse.birt.core.exception.BirtException;
import org.eclipse.birt.data.engine.api.DataEngineContext.DataEngineFlowMode;
import org.eclipse.birt.report.data.adapter.api.DataRequestSession;
import org.eclipse.birt.report.data.adapter.api.timeFunction.IArgumentInfo;
import org.eclipse.birt.report.data.adapter.api.timeFunction.ITimeFunction;
Expand Down Expand Up @@ -119,6 +120,19 @@ public List getSelectValueList( Expression expression,
return Collections.EMPTY_LIST;
}

public List getSelectValueList( Expression expression,
DataSetHandle dataSetHandle, DataEngineFlowMode flowMode )
throws BirtException
{
if ( provider != null )
{
return provider.getSelectValueList( expression,
dataSetHandle,
flowMode );
}
return Collections.EMPTY_LIST;
}

public List getSelectValueList( Expression expression,
ModuleHandle moduleHandle, DataSetHandle dataSetHandle, boolean useDataSetFilter )
throws BirtException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.util.List;

import org.eclipse.birt.core.exception.BirtException;
import org.eclipse.birt.data.engine.api.DataEngineContext.DataEngineFlowMode;
import org.eclipse.birt.report.data.adapter.api.DataRequestSession;
import org.eclipse.birt.report.data.adapter.api.timeFunction.IArgumentInfo;
import org.eclipse.birt.report.data.adapter.api.timeFunction.ITimeFunction;
Expand Down Expand Up @@ -50,6 +51,9 @@ List getSelectValueList( Expression expression,
boolean useDataSetFilter )
throws BirtException;

List getSelectValueList( Expression expression, DataSetHandle dataSetHandle,
DataEngineFlowMode flowMode ) throws BirtException;

List getSelectValueFromBinding( Expression expression,
ModuleHandle moduleHandle, DataSetHandle dataSetHandle,
Iterator binding,
Expand All @@ -76,4 +80,6 @@ void registerSession( DataSourceHandle handle, DataRequestSession session )
void unRegisterSession( DataRequestSession session ) throws BirtException;

List<IArgumentLayout> getArgumentLayout(ITimeFunction function,List<IArgumentInfo> infos);


}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.eclipse.birt.core.format.NumberFormatter;
import org.eclipse.birt.core.format.StringFormatter;
import org.eclipse.birt.core.script.JavascriptEvalUtil;
import org.eclipse.birt.data.engine.api.DataEngineContext.DataEngineFlowMode;
import org.eclipse.birt.report.designer.core.model.SessionHandleAdapter;
import org.eclipse.birt.report.designer.data.ui.dataset.DataSetUIUtil;
import org.eclipse.birt.report.designer.data.ui.util.SelectValueFetcher;
Expand Down Expand Up @@ -1453,8 +1454,11 @@ private List getColumnValueList( )
{
String queryExpr = selectedParameter.getValueExpr( );

valueList.addAll( SelectValueFetcher.getSelectValueList( queryExpr,
dataSet ) );
//Flow mode PARAM_EVALUATION_FLOW is propagated to data engine execution to exclude filters defined on data set.
valueList.addAll( SelectValueFetcher.getSelectValueList(
new Expression( queryExpr, ExpressionType.JAVASCRIPT ),
dataSet,
DataEngineFlowMode.PARAM_EVALUATION_FLOW ) );

}
catch ( Exception e )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.eclipse.birt.core.format.DateFormatter;
import org.eclipse.birt.core.format.NumberFormatter;
import org.eclipse.birt.core.format.StringFormatter;
import org.eclipse.birt.data.engine.api.DataEngineContext.DataEngineFlowMode;
import org.eclipse.birt.report.data.adapter.api.AdapterException;
import org.eclipse.birt.report.data.adapter.api.DataAdapterUtil;
import org.eclipse.birt.report.designer.data.ui.util.SelectValueFetcher;
Expand Down Expand Up @@ -71,12 +72,10 @@
import org.eclipse.birt.report.model.api.FormatValueHandle;
import org.eclipse.birt.report.model.api.PropertyHandle;
import org.eclipse.birt.report.model.api.ReportDesignHandle;
import org.eclipse.birt.report.model.api.ReportItemHandle;
import org.eclipse.birt.report.model.api.ResultSetColumnHandle;
import org.eclipse.birt.report.model.api.ScalarParameterHandle;
import org.eclipse.birt.report.model.api.SelectionChoiceHandle;
import org.eclipse.birt.report.model.api.StructureFactory;
import org.eclipse.birt.report.model.api.VariableElementHandle;
import org.eclipse.birt.report.model.api.activity.SemanticException;
import org.eclipse.birt.report.model.api.elements.DesignChoiceConstants;
import org.eclipse.birt.report.model.api.elements.ReportDesignConstants;
Expand Down Expand Up @@ -366,7 +365,7 @@ public class ParameterDialog extends BaseTitleAreaDialog
private IDialogHelper controlTypeHelper;

private IDialogHelper startPointTypeHelper;

private IStructuredContentProvider contentProvider = new IStructuredContentProvider( ) {

public void dispose( )
Expand Down Expand Up @@ -1490,9 +1489,11 @@ private List getColumnValueList( )
}
ArrayList valueList = new ArrayList( );

valueList.addAll( SelectValueFetcher.getSelectValueList( ExpressionButtonUtil.getExpression( columnChooser ),
//Flow mode PARAM_EVALUATION_FLOW is propagated to data engine execution to exclude filters defined on data set.
valueList.addAll( SelectValueFetcher.getSelectValueList(
ExpressionButtonUtil.getExpression( columnChooser ),
getDataSetHandle( ),
true ) );
DataEngineFlowMode.PARAM_EVALUATION_FLOW ) );
java.util.Collections.sort( valueList );
return valueList;
}
Expand Down
5 changes: 4 additions & 1 deletion build/birt-packages/birt-runtime-osgi/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
<copy todir="${ENGINE_DIR}/lib">
<fileset dir="${BIRTAPI_DIR}/target/lib"/>
</copy>
<copy file="./config.ini" todir="${ENGINE_DIR}/platform/configuration"/>
<copy todir="${ENGINE_DIR}/platform/configuration">
<fileset dir="${PRODUCT_DIR}/configuration"/>
</copy>
<copy file="./config.ini" todir="${ENGINE_DIR}/platform/configuration" overwrite="true"/>
<copy file="${ROOT_DIR}/viewer/org.eclipse.birt.report.viewer/birt/test.rptdesign" tofile="${ENGINE_DIR}/samples/hello_world.rptdesign"/>
<copy file="${ROOT_DIR}/build/org.eclipse.birt.releng.birtbuilder/extras/genReport.sh" todir="${ENGINE_DIR}"/>
<copy file="${ROOT_DIR}/build/org.eclipse.birt.releng.birtbuilder/extras/genReport.bat" todir="${ENGINE_DIR}"/>
Expand Down
14 changes: 7 additions & 7 deletions build/birt-packages/birt-runtime-osgi/config.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Product Runtime Configuration File
eclipse.product=org.eclipse.birt.report.engine.ReportEngineSDK
osgi.bundles=org.eclipse.equinox.common@2:start, org.eclipse.update.configurator@3:start, org.eclipse.birt.core@start
osgi.framework.extensions=org.eclipse.birt.api
osgi.bundles.defaultStartLevel=4
eclipse.parsers.setTCCL=false

#Product Runtime Configuration File
eclipse.product=org.eclipse.birt.report.engine.ReportEngineSDK
osgi.bundles=org.eclipse.equinox.simpleconfigurator@start, org.eclipse.birt.core@start
osgi.framework.extensions=org.eclipse.birt.api
osgi.bundles.defaultStartLevel=4
eclipse.parsers.setTCCL=false

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ Bundle-SymbolicName: org.apache.batik.ext.awt.extension;singleton:=true
Bundle-Version: 1.7.0.qualifier
Fragment-Host: org.apache.batik.ext.awt;bundle-version="[1.7.0,1.8.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Require-Bundle: org.apache.batik.transcoder;bundle-version="[1.7.0,1.8.0)";resolution:=optional,
org.apache.batik.bridge;bundle-version="[1.7.0,1.8.0)";resolution:=optional
Require-Bundle: org.apache.batik.transcoder;bundle-version="[1.7.0,2.0.0)";resolution:=optional,
org.apache.batik.bridge;bundle-version="[1.7.0,2.0.0)";resolution:=optional
Bundle-Vendor: Eclipse BIRT Project
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ public class DataEngineContext
/**
* flow mode is required to check if the request received is from regular
* report execution,interactive viewing session or for data extraction
* or for report parameter evaluation
*/
public static enum DataEngineFlowMode{NORMAL,IV,DATA_EXTRACTION}
public static enum DataEngineFlowMode{NORMAL,IV,DATA_EXTRACTION,PARAM_EVALUATION_FLOW}
private DataEngineFlowMode flowMode = DataEngineFlowMode.NORMAL;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.eclipse.birt.data.aggregation.api.IBuildInAggregation;
import org.eclipse.birt.data.engine.api.DataEngine;
import org.eclipse.birt.data.engine.api.DataEngineContext;
import org.eclipse.birt.data.engine.api.DataEngineContext.DataEngineFlowMode;
import org.eclipse.birt.data.engine.api.IBaseDataSetDesign;
import org.eclipse.birt.data.engine.api.IBaseDataSourceDesign;
import org.eclipse.birt.data.engine.api.IBasePreparedQuery;
Expand Down Expand Up @@ -2152,7 +2153,10 @@ protected void defineDataSourceDataSet( IQueryDefinition queryDefn ) throws Birt
break;
}
}
DefineDataSourceSetUtil.defineDataSourceAndDataSet( handle, dataEngine, this.modelAdaptor, null );

QueryExecutionHelper.DataSetHandleProcessContext processContext = getDataSetProcessContext( handle );

DefineDataSourceSetUtil.defineDataSourceAndDataSet( handle, dataEngine, this.modelAdaptor, processContext );

DefineDataSourceSetUtil.prepareForTransientQuery( sessionContext,
dataEngine,
Expand All @@ -2163,6 +2167,35 @@ protected void defineDataSourceDataSet( IQueryDefinition queryDefn ) throws Birt
}
}

private QueryExecutionHelper.DataSetHandleProcessContext getDataSetProcessContext(
DataSetHandle handle ) throws BirtException
{

QueryExecutionHelper.DataSetHandleProcessContext processContext = null;
if ( sessionContext != null
&& sessionContext.getDataEngineContext( )
.getFlowMode( ) == DataEngineFlowMode.PARAM_EVALUATION_FLOW )
{
/**
* In PARAM_EVALUATION_FLOW filters defined on Data Set shall be
* ignored during query execution. To achieve above objective create
* a subclass of QueryExecutionHelper.DataSetHandleProcessContext
* that clears filters.
*/
processContext = new QueryExecutionHelper.DataSetHandleProcessContext(
handle, false, false, false ) {

public void process( IBaseDataSetDesign baseDataSetDesign,
DataSetHandle current )
{
processFilters( baseDataSetDesign, current );
}
};

}
return processContext;
}

/**
*
* @param query
Expand Down
2 changes: 1 addition & 1 deletion engine/org.eclipse.birt.report.engine/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Export-Package: org.eclipse.birt.report.engine.adapter,
org.eclipse.birt.report.engine.toc,
org.eclipse.birt.report.engine.toc.document,
org.eclipse.birt.report.engine.util
Require-Bundle: org.w3c.css.sac,
Require-Bundle: org.w3c.css.sac;bundle-version="1.3.1",
org.eclipse.birt.core;bundle-version="[2.1.0,5.0.0)";visibility:=reexport,
org.eclipse.birt.report.model;bundle-version="[2.1.0,5.0.0)";visibility:=reexport,
org.eclipse.birt.data;bundle-version="[2.1.0,5.0.0)",
Expand Down
Loading

0 comments on commit 8e9ce5f

Please sign in to comment.