"Failed to render " + handle.getExtensionName( ) + ( elementName != null ? " " + elementName : "" ), ex ) );
MessageConstants.EXTENDED_ITEM_RENDERING_ERROR, new String[]{handle.getExtensionName( ), ( name != null ? " " + name : "" )}, ex ) );
	public void execute( ReportItemDesign item1, IReportEmitter emitter )	{		assert item1 instanceof ExtendedItemDesign;		ExtendedItemDesign item = (ExtendedItemDesign) item1;		IExtendedItemContent content = ContentFactory				.createExtendedItemContent( (ExtendedItemDesign) item , context.getContentObject( ));				// handle common properties, such as		//		//1) style (Not supported now as we only support image extension)		//2) highlight (Not supported now as we only support image extension)		//3) x,y		//4) actions		//		// other report item-supported features.		//create user-defined generation-time helper object		ExtendedItemHandle handle = (ExtendedItemHandle) item.getHandle( );		String tagName = handle.getExtensionName( );		IReportItemGeneration itemGeneration = ExtensionManager.getInstance( )				.createGenerationItem( tagName );		byte[] generationStatus = null;		if ( itemGeneration != null )		{			itemGeneration.setModelObject( handle );			itemGeneration.setReportQueries(((ExtendedItemDesign)item).getQueries());			IRowSet[] rowSets = null;			try			{				rowSets = executeQueries( item );				if ( rowSets != null )				{					try					{						itemGeneration.onRowSets( rowSets );					}					catch ( BirtException ex )					{						logger.log( Level.SEVERE, ex.getMessage( ), ex );						context.addException( new EngineException(								"Failed to render "										+ handle.getExtensionName( )										+ ( item.getName( ) != null ? " "												+ item.getName( ) : "" ), ex ) );//$NON-NLS-1$					}				}				if ( itemGeneration.needSerialization( ) )				{					try					{						ByteArrayOutputStream out = new ByteArrayOutputStream( );						itemGeneration.serialize( out );						generationStatus = out.toByteArray( );					}					catch ( BirtException ex )					{						logger.log( Level.SEVERE, ex.getMessage( ), ex );						context.addException( new EngineException(								"Failed to render "										+ handle.getExtensionName( )										+ ( item.getName( ) != null ? " "												+ item.getName( ) : "" ), ex ) );//$NON-NLS-1$					}					itemGeneration.finish( );				}			}			catch ( Throwable t )			{				logger.log( Level.SEVERE, "Error:", t );//$NON-NLS-1$				context.addException( new EngineException(						"Failed to render "								+ handle.getExtensionName( )								+ ( item.getName( ) != null ? " "										+ item.getName( ) : "" ), t ) );//$NON-NLS-1$			}			finally			{				closeQueries( rowSets );			}					}		//call the presentation peer to create the content object		IReportItemPresentation itemPresentation = ExtensionManager				.getInstance( ).createPresentationItem( tagName );		if ( itemPresentation != null )		{			itemPresentation.setModelObject( handle );			itemPresentation.setReportQueries(((ExtendedItemDesign)item).getQueries());			//itemPresentation.setResolution();			itemPresentation.setLocale(context.getLocale());			itemPresentation.setSupportedImageFormats( "GIF;PNG;JPG;BMP" );			itemPresentation.setOutputFormat( emitter.getOutputFormat( ) );			if ( generationStatus != null )			{				itemPresentation.deserialize( new ByteArrayInputStream(						generationStatus ) );			}			Object output = null;			IRowSet[] rowSets = null;			try			{				rowSets = executeQueries( item );				if ( rowSets != null )				{					try					{						output = itemPresentation.onRowSets( rowSets );					}					catch ( BirtException ex )					{						logger.log( Level.SEVERE, ex.getMessage( ), ex );						String elementName = handle.getName( );						context.addException( new EngineException(								"Failed to render "								+ handle.getExtensionName( )								+ ( elementName != null ? " " + elementName : "" ), ex ) );//$NON-NLS-1$											}				}				if ( output != null )				{					int type = itemPresentation.getOutputType( );					handleItemContent( item, emitter, content, type, output );				}				itemPresentation.finish( );			}			catch ( Throwable t )			{				logger.log( Level.SEVERE, "Error:", t );//$NON-NLS-1$				context.addException( new EngineException(						"Failed to render "								+ handle.getExtensionName( )								+ ( item.getName( ) != null ? " "										+ item.getName( ) : "" ), t ) );//$NON-NLS-1$			}			finally			{				closeQueries( rowSets );			}					}	}