Bug 188862 - Chart (and extended items) requires the ability to define script contents
Summary: Chart (and extended items) requires the ability to define script contents
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.2.0   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 2.2.0 RC2   Edit
Assignee: xingjie he CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 132031 148405
  Show dependency tree
 
Reported: 2007-05-24 06:08 EDT by David Michonneau CLA
Modified: 2007-06-01 00:00 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Michonneau CLA 2007-05-24 06:08:52 EDT
Currently, there is only one script per extended item. This should be 
generalized to support multiple scripts for onRender, onPrepare, etc...

The chart model contains its script contents, and it needs to be able to return 
it to the model through getProperty("onRender"). Currently this is ineffective, 
since  onRender is considered as a ROM property.

The proposal is to extend the extension schema to allow extended items to 
override some predefined properties such as "onRender":

Example:

<overrideProperty
               useOwnModel="true"
               propertyName="onRender">
 </overrideProperty>

In that case, the model will call the extension getProperty("onRender") when 
trying to read that property, instead of the ROM property.

The chart will *not* need to redefine the onRender property with a <property> 
tag in plugin.xml

This is blocking the javascript editor enhancements (bug132031, bug148405)
Comment 1 Rick Lu CLA 2007-05-24 22:36:58 EDT
Defined the new schema of overrideProperty for this case. If this flag is true, just call IReportItem.getProperty(). Otherwise, still follows the Model getProperty() algorithm.
Comment 2 xingjie he CLA 2007-05-28 05:00:33 EDT
finish Add useOwnModel property. please check it.
Comment 3 David Michonneau CLA 2007-05-31 11:09:27 EDT
The getProperty works but setProperty fails due to this code (it doesn't go 
inside the if statement)

		// The values differ. Make the change.

		if ( element instanceof ExtendedItem )
		{
			ExtendedItem extendedItem = ( (ExtendedItem) element );

			if ( extendedItem.isExtensionModelProperty( prop.getName( ) ) )
			{
				IReportItem extElement = extendedItem.getExtendedElement( );

				assert extElement != null;

				extElement.checkProperty( prop.getName( ), value );
				extElement.setProperty( prop.getName( ), value );

				return;
			}
		}
Comment 4 xingjie he CLA 2007-06-01 00:00:37 EDT
done it. thx