Bug 148747 Design become invalid when I extend a masterpage from Library
The attachment contains a report file and a library file. Reproduce: 1. Deploy the library("lib"), and open the report. 2. Drag Masterpage("page1") from "lib" to report. 3. Reopen the report, it become invalid.
model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/writer/ModuleWriter.java
* 
	 * @see org.eclipse.birt.report.model.elements.ElementVisitor#visitTemplateParameterDefinition(org.eclipse.birt.report.model.elements.TemplateParameterDefinition)
	 */
	public void visitTemplateParameterDefinition(
			TemplateParameterDefinition obj )
	{
		writer
				.startElement( DesignSchemaConstants.TEMPLATE_PARAMETER_DEFINITION_TAG );
		attribute( obj, DesignSchemaConstants.NAME_ATTRIB,
				DesignElement.NAME_PROP );
		writer.attribute( DesignSchemaConstants.ID_ATTRIB, new Long( obj
				.getID( ) ).toString( ) );
		property( obj, TemplateParameterDefinition.ALLOWED_TYPE_PROP );
		resourceKey( obj, TemplateParameterDefinition.DESCRIPTION_ID_PROP,
				TemplateParameterDefinition.DESCRIPTION_PROP );
		writeContents( obj, TemplateParameterDefinition.DEFAULT_SLOT,
				DesignSchemaConstants.DEFAULT_TAG );
		writer.endElement( );
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.birt.report.model.elements.ElementVisitor#visitTemplateReportItem(org.eclipse.birt.report.model.elements.TemplateReportItem)
	 */
	public void visitTemplateReportItem( TemplateReportItem obj )
	{
		
		boundColumnsMgr.dealTemplateReportItem( obj, getModule( ) );
		writer.startElement( DesignSchemaConstants.TEMPLATE_REPORT_ITEM_TAG );
		super.visitTemplateReportItem( obj );