3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
11 package eu
.etaxonomy
.taxeditor
.io
;
13 import org
.apache
.log4j
.Logger
;
14 import org
.eclipse
.jface
.viewers
.IStructuredSelection
;
15 import org
.eclipse
.ui
.IWorkbench
;
17 import eu
.etaxonomy
.cdm
.database
.ICdmDataSource
;
18 import eu
.etaxonomy
.cdm
.io
.berlinModel
.out
.BerlinModelExportConfigurator
;
19 import eu
.etaxonomy
.cdm
.io
.common
.Source
;
20 import eu
.etaxonomy
.taxeditor
.datasource
.CdmDataSourceRepository
;
21 import eu
.etaxonomy
.taxeditor
.datasource
.wizard
.CdmDataSourceSQLServerWizardPage
;
22 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
29 public class BerlinModelExportWizard
extends AbstractExportWizard
{
30 private static final Logger logger
= Logger
31 .getLogger(BerlinModelExportWizard
.class);
33 private CdmDataSourceSQLServerWizardPage page
;
37 * @see org.eclipse.jface.wizard.Wizard#addPages()
40 public void addPages() {
43 page
= new CdmDataSourceSQLServerWizardPage(null);
49 * @see org.eclipse.jface.wizard.Wizard#performFinish()
52 public boolean performFinish() {
54 ICdmDataSource dataSource
= page
.getDataSource();
56 // FIXME use new constructor Source(ICdmDataSource)
57 Source source
= new Source(Source
.SQL_SERVER_2005
,
58 dataSource
.getServer(),
59 dataSource
.getDatabase(),
60 dataSource
.getPort());
61 source
.setUserAndPwd(dataSource
.getUsername(), dataSource
.getPassword());
63 BerlinModelExportConfigurator configurator
= BerlinModelExportConfigurator
.NewInstance(source
, CdmDataSourceRepository
.getDefault().getCurrentDataSource());
64 configurator
.setCdmAppController(CdmStore
.getApplicationController());
66 return export(configurator
);
70 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
72 public void init(IWorkbench workbench
, IStructuredSelection selection
) {
73 this.setWindowTitle("Berlin Model Export");