Re: Losing SeriesDefinition in Generator.build() with EcoreUtil.copy
Karsten,
I just finished up my example radar chart type and did not run into this
issue. I am using the 2.5 build and the EcoreUtil.copy method is not
used in the Generator. It has been replaced with:
Chart cmRuntime = cmDesignTime.copyInstance( );
Send me an email to jasonweathersby at windstream.net and we can discuss.
Jason
Karsten Knese wrote:
> Hi at all.
>
> I'm student in this years Google Sommer of Code program. I'm
> contributing BIRT with adding new chart types like donut, venn and radar.
>
> As I tried creating new SeriesDefinition for the donut chart I found a
> conflict in build()-method of Generator.class.
>
> Chart cmRuntime = (Chart) EcoreUtil.copy( cmDesignTime );
>
> This line of code loses the new SeriesDefintion.
> What I did:
>
> * replace this line with Chart cmRuntime = cmDesignTime;
>
> I found a patch which is a kind of workaround and does the same as I
> did, I think:
>
>
> ### Eclipse Workspace Patch 1.0 #P org.eclipse.birt.chart.engine Index:
> src/org/eclipse/birt/chart/factory/Generator.java
> =================================================================== RCS
> file:
> /cvsroot/birt/source/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/factory/Generator.java,
>
> v retrieving revision 1.75.2.2 diff -u -r1.75.2.2 Generator.java ---
> src/org/eclipse/birt/chart/factory/Generator.java 12 Dec 2008 03:42:15
> -0000 1.75.2.2 +++ src/org/eclipse/birt/chart/factory/Generator.java 19
> Jun 2009 13:10:37 -0000 @@ -926,7 +926,8 @@ {
> // re-init chart script context. ChartScriptContext csc =
> new ChartScriptContext( ); - Chart cmRunTime = (Chart)
> EcoreUtil.copy( cmDesignTime ); + // Chart cmRunTime = (Chart)
> EcoreUtil.copy( cmDesignTime ); + Chart cmRunTime =
> cmDesignTime; csc.setChartInstance( cmRunTime );
> csc.setExternalContext( externalContext ); csc.setULocale(
> rtc.getULocale( ) );
>
>
> My question here is what's the solution? Is this a known bug, is this
> patch a permanent solution or just a temporary?
>
> Best regards,
> Karsten
>
>
>
>
|