/*
 *************************************************************************
 * Copyright (c) 2005, 2006 Actuate Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Actuate Corporation  - initial API and implementation
 *  
 *************************************************************************
 */

package org.eclipse.birt.report.data.oda.sampledb.ui.profile;

import java.util.Properties;

import org.eclipse.datatools.connectivity.oda.design.ui.wizards.DataSourceEditorPage;
import org.eclipse.swt.widgets.Composite;

public class SampleDbPropertyPage extends DataSourceEditorPage
{

	private SampleDbSelectionPageHelper m_pageHelper;

	public SampleDbPropertyPage( )
	{
		super( );
	}

	/* (non-Javadoc)
	 * @see org.eclipse.datatools.connectivity.oda.design.ui.profile.wizards.DataSourceEditorPage#collectCustomProperties(java.util.Properties)
	 */
	public Properties collectCustomProperties( Properties profileProps )
	{
		if ( m_pageHelper == null )
			return profileProps;

		return m_pageHelper.collectCustomProperties( profileProps );
	}

	/* (non-Javadoc)
	 * @see org.eclipse.datatools.connectivity.oda.design.ui.profile.wizards.DataSourceEditorPage#createAndInitCustomControl(org.eclipse.swt.widgets.Composite, java.util.Properties)
	 */
	protected void createAndInitCustomControl( Composite parent,
			Properties profileProps )
	{
		if ( m_pageHelper == null )
			m_pageHelper = new SampleDbSelectionPageHelper( this );

		m_pageHelper.createCustomControl( parent );
		m_pageHelper.initCustomControl( profileProps );
	}

}

@@ -622,16 +622,296 @@
 rties;%0A%0A
+import org.eclipse.birt.report.data.oda.jdbc.OdaJdbcDriver;%0Aimport org.eclipse.datatools.connectivity.oda.OdaException;%0Aimport org.eclipse.datatools.connectivity.oda.design.DataSourceDesign;%0Aimport org.eclipse.datatools.connectivity.oda.design.ui.designsession.DesignSessionUtil;%0A
 import o
@@ -1551,32 +1551,452 @@
 ileProps );%0A%09%7D%0A%0A
+%09@Override%0A%09protected DataSourceDesign collectDataSourceDesign( DataSourceDesign design )%0A%09%7B%0A%09%09design.setOdaExtensionId( OdaJdbcDriver.Constants.DATA_SOURCE_ID );%0A%09%09try%0A%09%09%7B%0A%09%09%09design.setPublicProperties( DesignSessionUtil.createDataSourcePublicProperties( OdaJdbcDriver.Constants.DATA_SOURCE_ID,%0A%09%09%09%09%09collectProperties( ) ) );%0A%09%09%7D%0A%09%09catch ( OdaException e )%0A%09%09%7B%0A%09%09%7D%0A%09%09return super.collectDataSourceDesign( design );%0A%09%7D%0A%0A
 %09/* (non-Javadoc

Fix bugzilla bug 230452. Cannot create Data Set from Classic Models Inc. Sample database data source