def __init__(self, main):
        WizardPage.__init__(self, main, "Overview", no_buttons=True)

        self.main = main

        self.main.add_content_page(self, "Overview", "Overview", "migration")
        grt.modules.Workbench.initializeOtherRDBMS()
Exemple #2
0
    def __init__(self, main):
        WizardPage.__init__(self, main, 'Schemata Selection')

        self._ui_created = False
        self.main.add_wizard_page(self,  'SourceTarget', 'Schemata Selection')

        optionspanel = mforms.newPanel(mforms.TitledBoxPanel)
        optionspanel.set_title('Schema Name Mapping Method')
        optionsbox = mforms.newBox(False)
        optionsbox.set_padding(8)
        optionsbox.set_spacing(8)
        
        optionsbox.add(mforms.newLabel('Choose how the reverse engineered schemata and objects should be mapped.\n'), False)

        options = [ 'Keep schemata as they are: Catalog.Schema.Table -> Schema.Table',
                    'Only one schema: Catalog.Schema.Table -> Catalog.Table',
                    'Only one schema, keep current schema names as a prefix: Catalog.Schema.Table -> Catalog.Schema_Table',
                  ]
        rid = mforms.RadioButton.new_id()
        self.options = []
        for opt in options:
            radio_button = mforms.newRadioButton(rid)
            radio_button.set_text(opt)
            optionsbox.add(radio_button, False)
            self.options.append(radio_button)
        self.options[1].set_active(True)

        optionspanel.add(optionsbox)
        self._optionspanel = optionspanel
        #self._advanced_shown = False
        #self._optionspanel.show(False)
        self.content.add_end(optionspanel, False)
    def __init__(self, main):
        WizardPage.__init__(self, main, "Manual Editing", wide=True)

        self.main.add_wizard_page(self, "ObjectMigration", "Manual Editing")
        self._object_dict = {}
        self._source_objects_with_errors = set()
        self.error_count, self.warning_count = 0, 0
    def __init__(self, main):
        WizardPage.__init__(self, main, "Manual Editing", wide=True)

        self.main.add_wizard_page(self, "ObjectMigration", "Manual Editing")
        self._object_dict = {}
        self._source_objects_with_errors = set()
        self.error_count, self.warning_count = 0, 0
 def __init__(self, owner):
     WizardPage.__init__(self, owner, "Import Options", wide=True)
     self.layer_name = None
     self.column_list = []
     self.support_spatial_index = Version.fromgrt(
         owner.editor.serverVersion).is_supported_mysql_version_at_least(
             5, 7, 5)
    def __init__(self, owner):
        WizardPage.__init__(self, owner, "Select File to Import", wide=True)

        self.schema_label = mforms.newLabel("Target schema: ")

        self.back_button.set_enabled(False)
        self.ogrinfo_missing = True
        self.ogr2ogr_missing = True
    def __init__(self, owner):
        WizardPage.__init__(self, owner, "Select File to Import", wide=True)

        self.schema_label = mforms.newLabel("Target schema: ")

        self.back_button.set_enabled(False)
        self.ogrinfo_missing = True
        self.ogr2ogr_missing = True
    def __init__(self, main):
        WizardPage.__init__(self, main, "Source Objects")

        self.main.add_wizard_page(self, "ObjectMigration", "Source Objects")
        self._scrollpanel = None
        
        label = mforms.newLabel("You may select the objects to be migrated in the lists below.\nAll tables will be migrated by default.")
        self.content.add(label, False, True)
    def __init__(self, main):
        WizardPage.__init__(self, main, 'Schema Mappings')

        self.main.add_wizard_page(self, 'OBJECT MIGRATION', 'Schema Mappings')

        self.schemata = None
        self.rid = mforms.RadioButton.new_id()
        self.options = []
    def __init__(self, main):
        WizardPage.__init__(self, main, 'Schema Mappings')

        self.main.add_wizard_page(self, 'OBJECT MIGRATION', 'Schema Mappings')

        self.schemata = None
        self.rid = mforms.RadioButton.new_id()
        self.options = []
    def __init__(self, main):
        WizardPage.__init__(self, main, "Migration Report")

        self.main.add_wizard_page(self, "Report", "Migration Report")

        self._report = mforms.newTextBox(mforms.VerticalScrollBar)
        self.content.add(self._report, True, True)
        
        self.next_button.set_text("Finish")
Exemple #12
0
    def __init__(self, main):
        WizardPage.__init__(self, main, "Migration Report")

        self.main.add_wizard_page(self, "REPORT", "Migration Report")

        self._report = mforms.newTextBox(mforms.VerticalScrollBar)
        self.content.add(self._report, True, True)

        self.next_button.set_text("Finish")
    def __init__(self, main):
        WizardPage.__init__(self, main, "Source Objects")

        self.main.add_wizard_page(self, "ObjectMigration", "Source Objects")
        self._scrollpanel = None

        label = mforms.newLabel(
            "You may select the objects to be migrated in the lists below.\nAll tables will be migrated by default."
        )
        self.content.add(label, False, True)
    def __init__(self, main):
        WizardPage.__init__(self, main, "Target Creation Options")

        self.main.add_wizard_page(self, "ObjectMigration", "Target Creation Options")

        label = mforms.newLabel("Select options for the creation of the migrated schema in the target\nMySQL server and click [Next >] to execute.")
        self.content.add(label, False, True)

        panel = mforms.newPanel(mforms.TitledBoxPanel)
        panel.set_title("Schema Creation")
        self.content.add(panel, False, True)

        box = mforms.newBox(False)
        panel.add(box)
        box.set_padding(12)

        self._create_db = mforms.newCheckBox()
        self._create_db.set_text("Create schema in target RDBMS")
        box.add(self._create_db, False, True)

        # spacer
        box.add(mforms.newLabel(""), False, True)

        self._create_script = mforms.newCheckBox()
        self._create_script.set_text("Create a SQL script file")
        self._create_script.add_clicked_callback(self._toggle_sql_script)
        box.add(self._create_script, False, True)
        self._file_hbox = mforms.newBox(True)
        self._file_hbox.set_spacing(4)
        self._file_hbox.add(mforms.newLabel("Script File:"), False, True)
        self._create_script_file = mforms.newTextEntry()
        self._create_script_file.set_value(os.path.join(os.path.expanduser('~'), 'migration_script.sql'))
        self._file_hbox.add(self._create_script_file, True, True)
        button = mforms.newButton()
        button.set_text("Browse...")
        button.add_clicked_callback(self._browse_files)
        self._file_hbox.add(button, False, True)
        box.add(self._file_hbox, False, True)

        panel = mforms.newPanel(mforms.TitledBoxPanel)
        panel.set_title("Options")
        self.content.add(panel, False, True)

        box = mforms.newBox(False)
        panel.add(box)
        box.set_padding(12)
        box.set_spacing(8)

        self._keep_schema = mforms.newCheckBox()
        self._keep_schema.set_text("Keep schemas if they already exist. Objects that already exist will not be recreated or updated.")
        box.add(self._keep_schema, False, True)

        self._create_db.set_active(True)
        self._toggle_sql_script()
        self._check_file_duplicate = True
    def __init__(self, main):
        WizardPage.__init__(self, main, "Target Creation Options")

        self.main.add_wizard_page(self, "OBJECT MIGRATION", "Target Creation Options")

        label = mforms.newLabel("Select options for the creation of the migrated schema in the target\nMySQL server and click [Next >] to execute.")
        self.content.add(label, False, True)

        panel = mforms.newPanel(mforms.TitledBoxPanel)
        panel.set_title("Schema Creation")
        self.content.add(panel, False, True)

        box = mforms.newBox(False)
        panel.add(box)
        box.set_padding(12)

        self._create_db = mforms.newCheckBox()
        self._create_db.set_text("Create schema in target RDBMS")
        box.add(self._create_db, False, True)

        # spacer
        box.add(mforms.newLabel(""), False, True)

        self._create_script = mforms.newCheckBox()
        self._create_script.set_text("Create a SQL script file")
        self._create_script.add_clicked_callback(self._toggle_sql_script)
        box.add(self._create_script, False, True)
        self._file_hbox = mforms.newBox(True)
        self._file_hbox.set_spacing(4)
        self._file_hbox.add(mforms.newLabel("Script File:"), False, True)
        self._create_script_file = mforms.newTextEntry()
        self._create_script_file.set_value(os.path.join(os.path.expanduser('~'), 'migration_script.sql'))
        self._file_hbox.add(self._create_script_file, True, True)
        button = mforms.newButton()
        button.set_text("Browse...")
        button.add_clicked_callback(self._browse_files)
        self._file_hbox.add(button, False, True)
        box.add(self._file_hbox, False, True)

        panel = mforms.newPanel(mforms.TitledBoxPanel)
        panel.set_title("Options")
        self.content.add(panel, False, True)

        box = mforms.newBox(False)
        panel.add(box)
        box.set_padding(12)
        box.set_spacing(8)

        self._keep_schema = mforms.newCheckBox()
        self._keep_schema.set_text("Keep schemata if they already exist. Objects that already exist will not be recreated or updated.")
        box.add(self._keep_schema, False, True)

        self._create_db.set_active(True)
        self._toggle_sql_script()
        self._check_file_duplicate = True
 def __init__(self, owner):
     WizardPage.__init__(self, owner, "Select output file location")
     if self.main.formats:
         self.active_module = self.main.formats[0] # We set first module as the active one
     else:
         self.active_module = None
     self.unsupported_output_format = False
     self.confirm_file_overwrite = False
     self.radio_opts = []
     self.optbox = None
     self.destination_file_checked = False
    def __init__(self, owner, sql_text):
        WizardPage.__init__(self, owner, 'Review Generated Migration(s)')

        self.save_button = mforms.newButton()
        self.save_button.enable_internal_padding(True)
        self.save_button.set_text('Save Migration(s) to Folder...')
        self.save_button.set_tooltip('Select the folder to save your migration(s) to.')
        self.save_button.add_clicked_callback(self.save_clicked)

        self.sql_text = mforms.newCodeEditor()
        self.sql_text.set_language(mforms.LanguageMySQL)
        self.sql_text.set_text(sql_text)
Exemple #18
0
    def __init__(self, owner, sql_text):
        WizardPage.__init__(self, owner, 'Review Generated Migration(s)')

        self.save_button = mforms.newButton()
        self.save_button.enable_internal_padding(True)
        self.save_button.set_text('Save Migration(s) to Folder...')
        self.save_button.set_tooltip('Select the folder to save your migration(s) to.')
        self.save_button.add_clicked_callback(self.save_clicked)

        self.sql_text = mforms.newCodeEditor()
        self.sql_text.set_language(mforms.LanguageMySQL)
        self.sql_text.set_text(sql_text)
Exemple #19
0
 def __init__(self, owner):
     WizardPage.__init__(self, owner, "Configure Import Settings", wide=True)
     
     self.last_analyze_status = False
     self.input_file_type = 'csv'
     self.active_module = self.main.formats[0] # csv
     self.encoding_list = {'cp1250 (windows-1250)':'cp1250', 
                           'latin2 (iso8859-2)':'iso8859_2', 
                           'latin1 (iso8859-1)':'latin_1', 
                           'utf-8':'utf-8', 
                           'utf-16':'utf-16'}
     self.dest_cols = []
     self.column_mapping = []
     self.ds_show_count = 0
     self.df_show_count = 0
     self.opts_mapping = {}
Exemple #20
0
 def __init__(self, owner):
     WizardPage.__init__(self, owner, "Configure Import Settings", wide=True)
     
     self.last_analyze_status = False
     self.input_file_type = 'csv'
     self.active_module = self.main.formats[0] # csv
     self.encoding_list = {'cp1250 (windows-1250)':'cp1250', 
                           'latin2 (iso8859-2)':'iso8859_2', 
                           'latin1 (iso8859-1)':'latin_1', 
                           'utf-8':'utf-8', 
                           'utf-16':'utf-16'}
     self.dest_cols = []
     self.column_mapping = []
     self.ds_show_count = 0
     self.df_show_count = 0
     self.opts_mapping = {}
     self.is_server_5_7 = Version.fromgrt(self.main.editor.serverVersion).is_supported_mysql_version_at_least(Version.fromstr("5.7.5"))
Exemple #21
0
    def __init__(self, main):
        WizardPage.__init__(self, main, "Migration Options")

        self.main.add_wizard_page(self, "ObjectMigration", "Migration Options")

        label = mforms.newLabel("Select options for the migration of the source schema/schemas to MySQL.")
        self.content.add(label, False, True)

        panel = mforms.newPanel(mforms.TitledBoxPanel)
        panel.set_title("DBMS Specific Options")
        self.content.add(panel, False, True)

        self._db_options_box = mforms.newBox(False)
        panel.add(self._db_options_box)
        self._db_options_box.set_padding(12)
        self._db_options_box.set_spacing(8)
        self._db_options = []
    def __init__(self, main):
        WizardPage.__init__(self, main, "Migration Options")

        self.main.add_wizard_page(self, "ObjectMigration", "Migration Options")

        label = mforms.newLabel("Select options for the migration of the source schema/schemata to MySQL.")
        self.content.add(label, False, True)

        panel = mforms.newPanel(mforms.TitledBoxPanel)
        panel.set_title("DBMS Specific Options")
        self.content.add(panel, False, True)

        self._db_options_box = mforms.newBox(False)
        panel.add(self._db_options_box)
        self._db_options_box.set_padding(12)
        self._db_options_box.set_spacing(8)
        self._db_options = []
    def __init__(self, owner, sql_text):
        WizardPage.__init__(self, owner, 'Review Generated Script')

        self.save_button = mforms.newButton()
        self.save_button.enable_internal_padding(True)
        self.save_button.set_text('Save to File...')
        self.save_button.set_tooltip('Save the text to a new file.')
        self.save_button.add_clicked_callback(self.save_clicked)

        self.copy_button = mforms.newButton()
        self.copy_button.enable_internal_padding(True)
        self.copy_button.set_text('Copy to Clipboard')
        self.copy_button.set_tooltip('Copy the text to the clipboard.')
        self.copy_button.add_clicked_callback(self.copy_clicked)

        self.sql_text = mforms.newCodeEditor()
        self.sql_text.set_language(mforms.LanguageMySQL)
        self.sql_text.set_text(sql_text)
    def __init__(self, owner, sql_text):
        WizardPage.__init__(self, owner, 'Review Generated Script')

        self.save_button = mforms.newButton()
        self.save_button.enable_internal_padding(True)
        self.save_button.set_text('Save to File...')
        self.save_button.set_tooltip('Save the text to a new file.')
        self.save_button.add_clicked_callback(self.save_clicked)

        self.copy_button = mforms.newButton()
        self.copy_button.enable_internal_padding(True)
        self.copy_button.set_text('Copy to Clipboard')
        self.copy_button.set_tooltip('Copy the text to the clipboard.')
        self.copy_button.add_clicked_callback(self.copy_clicked)

        self.sql_text = mforms.newCodeEditor()
        self.sql_text.set_language(mforms.LanguageMySQL)
        self.sql_text.set_text(sql_text)
    def __init__(self, owner):
        WizardPage.__init__(self, owner, "Generate certificates and self-signed keys")

        self.ca_cert = os.path.join(self.main.results_path, "ca-cert.pem").replace('\\', '/')
        self.server_cert = os.path.join(self.main.results_path, "server-cert.pem").replace('\\', '/')
        self.server_key = os.path.join(self.main.results_path, "server-key.pem").replace('\\', '/')
        self.client_cert = os.path.join(self.main.results_path, "client-cert.pem").replace('\\', '/')
        self.client_key = os.path.join(self.main.results_path, "client-key.pem").replace('\\', '/')

        self.table = mforms.newTable()
        self.table.set_padding(12)
        self.table.set_column_count(3)
        self.table.set_row_count(7)

        self.table.set_row_spacing(8)
        self.table.set_column_spacing(4)

        row, self.country_code = self.add_label_row(0, "Country:", "2 letter country code (eg, US)")
        row, self.state_name = self.add_label_row(row, "State or Province:", "Full state or province name")
        row, self.locality_name = self.add_label_row(row, "Locality:", "eg, city")
        row, self.org_name = self.add_label_row(row, "Organization:", "eg, company")
        row, self.org_unit = self.add_label_row(row, "Org. Unit:", "eg, section, department")
        row, self.email_address = self.add_label_row(row, "Email Address:", "")
        row, self.common_name = self.add_label_row(row, "Common:", "eg, put the FQDN of the server\nto allow server address validation")

        message = "Now you must specify the parameters to use in the certificates and self-signed key generation.\n"
        message += "This may include some data refering to youself and/or the company you work for. All fields are optional."
        
        self.parameters_box = mforms.newBox(False)
        self.parameters_box.set_padding(20)
        self.parameters_box.set_spacing(20)

        self.parameters_label = mforms.newLabel(message)
        
        self.parameters_panel = mforms.newPanel(mforms.TitledBoxPanel)
        self.parameters_panel.set_title("Optional Parameters")
        self.parameters_panel.add(self.table)
        
        self.parameters_box.add(self.parameters_label, False, False)
        self.parameters_box.add(self.parameters_panel, False, False)

        self.default_label = mforms.newLabel("The wizard is ready to generate the files for you. Click 'Next >' to generate \nthe certificates and self-signed key files...")
Exemple #26
0
    def __init__(self, owner):
        WizardPage.__init__(self, owner, "Generate certificates and self-signed keys")

        self.ca_cert = os.path.join(self.main.results_path, "ca-cert.pem")
        self.server_cert = os.path.join(self.main.results_path, "server-cert.pem")
        self.server_key = os.path.join(self.main.results_path, "server-key.pem")
        self.client_cert = os.path.join(self.main.results_path, "client-cert.pem")
        self.client_key = os.path.join(self.main.results_path, "client-key.pem")

        self.table = mforms.newTable()
        self.table.set_padding(12)
        self.table.set_column_count(3)
        self.table.set_row_count(7)

        self.table.set_row_spacing(8)
        self.table.set_column_spacing(4)

        row, self.country_code = self.add_label_row(0, "Country:", "2 letter country code (eg, US)")
        row, self.state_name = self.add_label_row(row, "State or Province:", "Full state or province name")
        row, self.locality_name = self.add_label_row(row, "Locality:", "eg, city")
        row, self.org_name = self.add_label_row(row, "Organization:", "eg, company")
        row, self.org_unit = self.add_label_row(row, "Org. Unit:", "eg, section, department")
        row, self.email_address = self.add_label_row(row, "Email Address:", "")
        row, self.common_name = self.add_label_row(row, "Common:", "eg, put the FQDN of the server\nto allow server address validation")

        message = "Now you must specify the parameters to use in the certificates and self-signed key generation.\n"
        message += "This may include some data refering youself and/or the company you work for. All fields are optional."
        
        self.parameters_box = mforms.newBox(False)
        self.parameters_box.set_padding(20)
        self.parameters_box.set_spacing(20)

        self.parameters_label = mforms.newLabel(message)
        
        self.parameters_panel = mforms.newPanel(mforms.TitledBoxPanel)
        self.parameters_panel.set_title("Optional Parameters")
        self.parameters_panel.add(self.table)
        
        self.parameters_box.add(self.parameters_label, False, False)
        self.parameters_box.add(self.parameters_panel, False, False)

        self.default_label = mforms.newLabel("The wizard is ready to generate the files for you. Click 'Next >' to generate \nthe certificates and self-signed key files...")
    def __init__(self, owner):
        WizardPage.__init__(self, owner, "Options")
        
        self.generate_files = newCheckBox()
        self.generate_files.set_text("Generate new certificates and self-signed keys");
        self.generate_files.set_active(not self.check_all_files_availability())
        self.generate_files.set_enabled(self.check_all_files_availability())

        self.update_connection = newCheckBox()
        self.update_connection.set_text("Update the connection");
        self.update_connection.set_active(True)

        self.use_default_parameters = newCheckBox()
        self.use_default_parameters.set_text("Use default parameters");
        self.use_default_parameters.set_active(False)
        
        self.clear_button = newButton()
        self.clear_button.set_text("Clear")
        self.clear_button.add_clicked_callback(self.clear_button_clicked)
        self.clear_button.set_enabled(os.path.isdir(self.main.results_path))
Exemple #28
0
    def __init__(self, owner):
        WizardPage.__init__(self, owner, "Options")
        
        self.generate_files = newCheckBox()
        self.generate_files.set_text("Generate new certificates and self-signed keys");
        self.generate_files.set_active(False if self.check_all_files_availability() == True else True)
        self.generate_files.set_enabled(self.check_all_files_availability())

        self.update_connection = newCheckBox()
        self.update_connection.set_text("Update the connection");
        self.update_connection.set_active(True)

        self.use_default_parameters = newCheckBox()
        self.use_default_parameters.set_text("Use default parameters");
        self.use_default_parameters.set_active(False)
        
        self.clear_button = newButton()
        self.clear_button.set_text("Clear")
        self.clear_button.add_clicked_callback(self.clear_button_clicked)
        self.clear_button.set_enabled(os.path.isdir(self.main.results_path))
 def __init__(self, owner):
     WizardPage.__init__(self, owner, "Import Results")
 def __init__(self, owner):
     WizardPage.__init__(self, owner, "Import Options", wide=True)
     self.layer_name = None
     self.column_list = []
    def __init__(self, main):
        WizardPage.__init__(self, main, "Data Transfer Setup")

        self.main.add_wizard_page(self, "DataMigration", "Data Transfer Setup")

        label = mforms.newLabel(
            "Select options for the copy of the migrated schema tables in the target\nMySQL server and click [Next >] to execute."
        )
        self.content.add(label, False, True)

        panel = mforms.newPanel(mforms.TitledBoxPanel)
        panel.set_title("Data Copy")
        self.content.add(panel, False, True)

        box = mforms.newBox(False)
        panel.add(box)
        box.set_padding(12)

        self._copy_db = mforms.newCheckBox()
        self._copy_db.set_text("Online copy of table data to target RDBMS")
        box.add(self._copy_db, False, True)

        # XXX TODO
        #box.add(mforms.newLabel(""), False, True)
        #self._add_script_checkbox_option(box, "dump_to_file", "Create a dump file with the data", "Dump File:", "Save As")

        box.add(mforms.newLabel(""), False, True)

        if sys.platform == "win32":
            self._add_script_checkbox_option(
                box, "copy_script",
                "Create a batch file to copy the data at another time",
                "Batch File:", "Save As")
        else:
            self._add_script_checkbox_option(
                box, "copy_script",
                "Create a shell script to copy the data from outside Workbench",
                "Shell Script File:", "Save As")

        panel = mforms.newPanel(mforms.TitledBoxPanel)
        panel.set_title("Options")
        self.content.add(panel, False, True)

        self.options_box = mforms.newBox(False)
        self.options_box.set_padding(12)
        self.options_box.set_spacing(8)
        panel.add(self.options_box)

        self._truncate_db = mforms.newCheckBox()
        self._truncate_db.set_text(
            "Truncate target tables (ie. delete contents) before copying data")
        self.options_box.add(self._truncate_db, False, True)

        hbox = mforms.newBox(True)
        hbox.set_spacing(8)
        hbox.add(mforms.newLabel("Worker tasks"), False, True)
        self._worker_count = mforms.newTextEntry()
        self._worker_count.set_value("2")
        self._worker_count.set_size(50, -1)
        hbox.add(self._worker_count, False, True)
        l = mforms.newLabel(
            "Number of tasks to use for data transfer. Each task will open a\n"
            +
            "connection to both source and target RDBMSs to copy table rows.\nDefault value 2."
        )
        l.set_style(mforms.SmallHelpTextStyle)
        hbox.add(l, True, True)
        self.options_box.add(hbox, False, True)

        self._debug_copy = mforms.newCheckBox()
        self._debug_copy.set_text("Enable debug output for table copy")
        self.options_box.add(self._debug_copy, False, True)

        ###

        self._advanced_panel = mforms.newPanel(mforms.TitledBoxPanel)
        self._advanced_panel.set_title("Tables to Copy")
        self.content.add(self._advanced_panel, True, True)

        box = mforms.newBox(False)
        box.set_padding(12)
        box.set_spacing(8)

        l = mforms.newLabel(
            """You can limit the number of rows to be copied for certain tables. Tables that are referenced by
foreign keys from other tables cannot be limited, unless data copy from the referencing tables is also disabled.
All tables are copied by default.""")
        l.set_style(mforms.SmallHelpTextStyle)
        box.add(l, False, True)

        self._tree = mforms.newTreeNodeView(mforms.TreeDefault)
        self._tree.add_column(mforms.IconStringColumnType, "Table", 200, False)
        self._tree.add_column(mforms.StringColumnType, "Limit Copy", 100, True)
        self._tree.add_column(mforms.StringColumnType, "Referencing Tables",
                              500, False)
        self._tree.end_columns()
        box.add(self._tree, True, True)
        self._advanced_panel.add(box)
        self._tree.set_cell_edited_callback(self._cell_edited)
        self._advbox_shown = False
        self._advanced_panel.show(False)
 def __init__(self, owner):
     WizardPage.__init__(self, owner, "Import Options", wide=True)
     self.layer_name = None
     self.column_list = []
     self.support_spatial_index = Version.fromgrt(owner.editor.serverVersion).is_supported_mysql_version_at_least(5, 7, 5)
Exemple #33
0
    def __init__(self, main):
        WizardPage.__init__(self, main, 'Overview', no_buttons=True)

        self.main = main
 def __init__(self, owner):
     WizardPage.__init__(self, owner, "Select data for export")
     self.simple_export = None
     self.advanced_export = None
     self._showing_simple = True
     self.table_list = {}
 def __init__(self, owner):
     WizardPage.__init__(self, owner, "Results")
     self.update_connection = True
    def __init__(self, main):
        WizardPage.__init__(self, main, 'Overview', no_buttons=True)

        self.main = main
Exemple #37
0
 def __init__(self, owner):
     WizardPage.__init__(self, owner, "Select Destination", wide=True)
     self.back_button.set_enabled(False)
     self.table_list = {}
 def __init__(self, owner):
     WizardPage.__init__(self, owner, "Import Options", wide=True)
     self.layer_name = None
     self.column_list = []
 def __init__(self, owner):
     WizardPage.__init__(self, owner, "Import Results")
    def __init__(self, main):
        WizardPage.__init__(self, main, "Create Target Results", wide=True)

        self.main.add_wizard_page(self, "ObjectMigration", "Create Target Results")

        text = """Scripts to create the target schema were executed. No data has been migrated yet. Review the creation report below 
for errors or warnings. If there are any errors, you can manually fix the scripts and click [Recreate Objects] to retry 
the schema creation or return to the Manual Editing page to correct them there and retry the target creation."""
        self.content.add(mforms.newLabel(text), False, True)

        hbox = mforms.newBox(True)
        hbox.set_spacing(12)
        hbox.set_homogeneous(True)
        self._tree = mforms.newTreeNodeView(mforms.TreeFlatList)
        self._tree.add_column(mforms.IconStringColumnType, "Object", 200, False)
        self._tree.add_column(mforms.IconStringColumnType, "Result", 600, False)
        self._tree.end_columns()
        self._tree.add_changed_callback(self._selection_changed)
        hbox.add(self._tree, True, True)
        #self.content.add(self._tree, True, True)

        self._advbox = mforms.newPanel(mforms.TitledBoxPanel)
        self._advbox.set_title("SQL CREATE Script for Selected Object")
        box = mforms.newBox(False)
        self._code = mforms.newCodeEditor()
        self._code.set_language(mforms.LanguageMySQL)
        self._code.add_changed_callback(self._code_changed)
        box.add(self._code, True, True)
        vbox = mforms.newBox(True)
        vbox.set_padding(12)
        vbox.set_spacing(8)
        self._comment_check = mforms.newCheckBox()
        self._comment_check.set_text("Comment out")
        self._comment_check.add_clicked_callback(self._comment_clicked)
        vbox.add(self._comment_check, False, True)

        self._revert_btn = mforms.newButton()
        self._revert_btn.set_text("Discard")
        vbox.add_end(self._revert_btn, False, True)
        self._revert_btn.add_clicked_callback(self._discard_clicked)

        self._apply_btn = mforms.newButton()
        self._apply_btn.set_text("Apply")
        vbox.add_end(self._apply_btn, False, True)
        self._apply_btn.add_clicked_callback(self._apply_clicked)
        box.add(vbox, False, True)

        self._advbox.add(box)
        #self._advbox.set_size(-1, 200)
        #self._advbox_shown = True
        #self.go_advanced() # toggle to hide
        
        self.advanced_button.set_text("Recreate Objects")
        
        #self.content.add(self._advbox, False, True)
        hbox.add(self._advbox, True, True)
        self.content.add(hbox, True, True)

        self._msgbox = mforms.newPanel(mforms.TitledBoxPanel)
        self._msgbox.set_title("Output Messages")
        box = mforms.newBox(False)
        box.set_padding(8)
        self._msgs = mforms.newTextBox(mforms.VerticalScrollBar)
        box.add(self._msgs, True, True)
        self._msgbox.add(box)
        self.content.add(self._msgbox, False, True)
        self._msgbox.set_size(-1, 200)

        self._error_tables = []
    def __init__(self, main):
        WizardPage.__init__(self, main, "Data Transfer Setup")

        self.main.add_wizard_page(self, "DataMigration", "Data Transfer Setup")

        label = mforms.newLabel(
            "Select options for the copy of the migrated schema tables in the target MySQL server and click [Next >] to execute."
        )
        self.content.add(label, False, True)

        panel = mforms.newPanel(mforms.TitledBoxPanel)
        panel.set_title("Data Copy")
        self.content.add(panel, False, True)

        box = mforms.newBox(False)
        panel.add(box)
        box.set_padding(16)
        box.set_spacing(16)

        rid = mforms.RadioButton.new_id()

        self._copy_db = mforms.newRadioButton(rid)
        self._copy_db.set_text("Online copy of table data to target RDBMS")
        self._copy_db.add_clicked_callback(self._script_radio_option_callback)
        box.add(self._copy_db, False, True)

        # XXX TODO
        #box.add(mforms.newLabel(""), False, True)
        #self._add_script_checkbox_option(box, "dump_to_file", "Create a dump file with the data", "Dump File:", "Save As")

        if sys.platform == "win32":
            self._add_script_radiobutton_option(
                box, "copy_script",
                "Create a batch file to copy the data at another time",
                "Batch File:", "Save As",
                "You should edit this file to add the source and target server passwords before running it.",
                rid)
        else:
            self._add_script_radiobutton_option(
                box, "copy_script",
                "Create a shell script to copy the data from outside Workbench",
                "Shell Script File:", "Save As",
                "You should edit this file to add the source and target server passwords before running it.",
                rid)

        self._add_script_radiobutton_option(
            box, "bulk_copy_script",
            "Create a shell script to use native server dump and load abilities for fast migration",
            "Bulk Data Copy Script:", "Save As",
            "Edit the generated file and change passwords at the top of the generated script.\nRun it on the source server to create a zip package containing a data dump as well as a load script.\nCopy this to the target server, extract it, and run the import script. See the script output for further details.",
            rid)

        panel = mforms.newPanel(mforms.TitledBoxPanel)
        panel.set_title("Options")
        self.content.add(panel, False, True)

        self.options_box = mforms.newBox(False)
        self.options_box.set_padding(12)
        self.options_box.set_spacing(8)
        panel.add(self.options_box)

        self._truncate_db = mforms.newCheckBox()
        self._truncate_db.set_text(
            "Truncate target tables (i.e. delete contents) before copying data"
        )
        self.options_box.add(self._truncate_db, False, True)

        hbox = mforms.newBox(True)
        hbox.set_spacing(16)
        hbox.add(mforms.newLabel("Worker tasks"), False, True)
        self._worker_count = mforms.newTextEntry()
        self._worker_count.set_value("2")
        self._worker_count.set_size(30, -1)
        hbox.add(self._worker_count, False, True)
        l = mforms.newImageBox()
        l.set_image(mforms.App.get().get_resource_path("mini_notice.png"))
        l.set_tooltip(
            "Number of tasks to use for data transfer. Each task will open a "
            +
            "connection to both source and target RDBMSes to copy table rows.\nDefault value 2."
        )
        hbox.add(l, False, True)
        self.options_box.add(hbox, False, True)

        self._debug_copy = mforms.newCheckBox()
        self._debug_copy.set_text("Enable debug output for table copy")
        self.options_box.add(self._debug_copy, False, True)

        self._driver_sends_utf8 = mforms.newCheckBox()
        self._driver_sends_utf8.set_text(
            "Driver sends data already encoded as UTF-8.")
        self.options_box.add(self._driver_sends_utf8, False, True)

        ###

        self._advanced_panel = mforms.newPanel(mforms.TitledBoxPanel)
        self._advanced_panel.set_title("Tables to Copy")
        self.content.add(self._advanced_panel, True, True)

        box = mforms.newBox(False)
        box.set_padding(12)
        box.set_spacing(8)

        l = mforms.newLabel(
            """You can limit the number of rows to be copied for certain tables. Tables that are referenced by
foreign keys from other tables cannot be limited, unless data copy from the referencing tables is also disabled.
All tables are copied by default.""")
        l.set_style(mforms.SmallHelpTextStyle)
        box.add(l, False, True)

        self._tree = mforms.newTreeNodeView(mforms.TreeDefault)
        self._tree.add_column(mforms.IconStringColumnType, "Table", 200, False)
        self._tree.add_column(mforms.StringColumnType, "Limit Copy", 100, True)
        self._tree.add_column(mforms.StringColumnType, "Referencing Tables",
                              500, False)
        self._tree.end_columns()
        box.add(self._tree, True, True)
        self._advanced_panel.add(box)
        self._tree.set_cell_edited_callback(self._cell_edited)
        self._advbox_shown = False
        self._advanced_panel.show(False)
Exemple #42
0
 def __init__(self, owner, sql_text):
     WizardPage.__init__(self, owner, 'DBIx export done.')
    def __init__(self, main):
        WizardPage.__init__(self, main, "Overview", no_buttons=True)

        self.main = main

        self.main.add_content_page(self, "Overview", "Overview", "migration")
Exemple #44
0
 def __init__(self, owner):
     WizardPage.__init__(self, owner, "Results")
     self.update_connection = True
Exemple #45
0
    def __init__(self, main):
        WizardPage.__init__(self, main, "Overview", no_buttons=True)

        self.main = main

        self.main.add_content_page(self, "Overview", "Overview", "migration")
 def __init__(self, owner):
     WizardPage.__init__(self, owner, "Welcome to MySQL Workbench SSL Wizard")
Exemple #47
0
    def __init__(self, main):
        WizardPage.__init__(self, main, "Create Target Results", wide=True)

        self.main.add_wizard_page(self, "ObjectMigration",
                                  "Create Target Results")

        text = """Scripts to create the target schema were executed. No data has been migrated yet. Review the creation report below 
for errors or warnings. If there are any errors, you can manually fix the scripts and click [Recreate Objects] to retry 
the schema creation or return to the Manual Editing page to correct them there and retry the target creation."""
        description = mforms.newLabel(text)
        description.set_name("Page Description")
        self.content.add(description, False, True)

        hbox = mforms.newBox(True)
        hbox.set_spacing(12)
        hbox.set_homogeneous(True)
        self._tree = mforms.newTreeView(mforms.TreeFlatList)
        self._tree.set_name("Script Results")
        self._tree.add_column(mforms.IconStringColumnType, "Object", 200,
                              False)
        self._tree.add_column(mforms.IconStringColumnType, "Result", 600,
                              False)
        self._tree.end_columns()
        self._tree.add_changed_callback(self._selection_changed)
        hbox.add(self._tree, True, True)
        #self.content.add(self._tree, True, True)

        self._advbox = mforms.newPanel(mforms.TitledBoxPanel)
        self._advbox.set_title("SQL CREATE Script for Selected Object")
        self._advbox.set_name("SQL IDE")
        box = mforms.newBox(False)
        self._code = mforms.newCodeEditor()
        self._code.set_language(mforms.LanguageMySQL)
        self._code.add_changed_callback(self._code_changed)
        box.add(self._code, True, True)
        vbox = mforms.newBox(True)
        vbox.set_padding(12)
        vbox.set_spacing(8)
        self._comment_check = mforms.newCheckBox()
        self._comment_check.set_text("Comment out")
        self._comment_check.set_name("Comment Out")
        self._comment_check.add_clicked_callback(self._comment_clicked)
        vbox.add(self._comment_check, False, True)

        self._revert_btn = mforms.newButton()
        self._revert_btn.set_text("Discard")
        vbox.add_end(self._revert_btn, False, True)
        self._revert_btn.add_clicked_callback(self._discard_clicked)

        self._apply_btn = mforms.newButton()
        self._apply_btn.set_text("Apply")
        vbox.add_end(self._apply_btn, False, True)
        self._apply_btn.add_clicked_callback(self._apply_clicked)
        box.add(vbox, False, True)

        self._advbox.add(box)
        #self._advbox.set_size(-1, 200)
        #self._advbox_shown = True
        #self.go_advanced() # toggle to hide

        self.advanced_button.set_text("Recreate Objects")

        #self.content.add(self._advbox, False, True)
        hbox.add(self._advbox, True, True)
        self.content.add(hbox, True, True)

        self._msgbox = mforms.newPanel(mforms.TitledBoxPanel)
        self._msgbox.set_title("Output Messages")
        self._msgbox.set_name("Output Messages")
        box = mforms.newBox(False)
        box.set_padding(8)
        self._msgs = mforms.newTextBox(mforms.VerticalScrollBar)
        box.add(self._msgs, True, True)
        self._msgbox.add(box)
        self.content.add(self._msgbox, False, True)
        self._msgbox.set_size(-1, 200)

        self._error_tables = []
    def __init__(self, main):
        WizardPage.__init__(self, main, "Data Transfer Setup")

        self.main.add_wizard_page(self, "DataMigration", "Data Transfer Setup")

        label = mforms.newLabel(
            "Select options for the copy of the migrated schema tables in the target MySQL server and click [Next >] to execute."
        )
        self.content.add(label, False, True)

        panel = mforms.newPanel(mforms.TitledBoxPanel)
        panel.set_title("Data Copy")
        self.content.add(panel, False, True)

        box = mforms.newBox(False)
        panel.add(box)
        box.set_padding(16)
        box.set_spacing(16)

        rid = mforms.RadioButton.new_id()

        self._copy_db = mforms.newRadioButton(rid)
        self._copy_db.set_text("Online copy of table data to target RDBMS")
        self._copy_db.add_clicked_callback(self._script_radio_option_callback)
        box.add(self._copy_db, False, True)

        # XXX TODO
        # box.add(mforms.newLabel(""), False, True)
        # self._add_script_checkbox_option(box, "dump_to_file", "Create a dump file with the data", "Dump File:", "Save As")

        if sys.platform == "win32":
            self._add_script_radiobutton_option(
                box,
                "copy_script",
                "Create a batch file to copy the data at another time",
                "Batch File:",
                "Save As",
                "You should edit this file to add the source and target server passwords before running it.",
                rid,
            )
        else:
            self._add_script_radiobutton_option(
                box,
                "copy_script",
                "Create a shell script to copy the data from outside Workbench",
                "Shell Script File:",
                "Save As",
                "You should edit this file to add the source and target server passwords before running it.",
                rid,
            )

        self._add_script_radiobutton_option(
            box,
            "bulk_copy_script",
            "Create a shell script to use native server dump and load abilities for fast migration",
            "Bulk Data Copy Script:",
            "Save As",
            "Edit the generated file and change passwords at the top of the generated script.\nRun it on the source server to create a zip package containing a data dump as well as a load script.\nCopy this to the target server, extract it, and run the import script. See the script output for further details.",
            rid,
        )

        panel = mforms.newPanel(mforms.TitledBoxPanel)
        panel.set_title("Options")
        self.content.add(panel, False, True)

        self.options_box = mforms.newBox(False)
        self.options_box.set_padding(12)
        self.options_box.set_spacing(8)
        panel.add(self.options_box)

        self._truncate_db = mforms.newCheckBox()
        self._truncate_db.set_text("Truncate target tables (i.e. delete contents) before copying data")
        self.options_box.add(self._truncate_db, False, True)

        hbox = mforms.newBox(True)
        hbox.set_spacing(16)
        hbox.add(mforms.newLabel("Worker tasks"), False, True)
        self._worker_count = mforms.newTextEntry()
        self._worker_count.set_value("2")
        self._worker_count.set_size(30, -1)
        hbox.add(self._worker_count, False, True)
        l = mforms.newImageBox()
        l.set_image(mforms.App.get().get_resource_path("mini_notice.png"))
        l.set_tooltip(
            "Number of tasks to use for data transfer. Each task will open a "
            + "connection to both source and target RDBMSes to copy table rows.\nDefault value 2."
        )
        hbox.add(l, False, True)
        self.options_box.add(hbox, False, True)

        self._debug_copy = mforms.newCheckBox()
        self._debug_copy.set_text("Enable debug output for table copy")
        self.options_box.add(self._debug_copy, False, True)

        ###

        self._advanced_panel = mforms.newPanel(mforms.TitledBoxPanel)
        self._advanced_panel.set_title("Tables to Copy")
        self.content.add(self._advanced_panel, True, True)

        box = mforms.newBox(False)
        box.set_padding(12)
        box.set_spacing(8)

        l = mforms.newLabel(
            """You can limit the number of rows to be copied for certain tables. Tables that are referenced by
foreign keys from other tables cannot be limited, unless data copy from the referencing tables is also disabled.
All tables are copied by default."""
        )
        l.set_style(mforms.SmallHelpTextStyle)
        box.add(l, False, True)

        self._tree = mforms.newTreeNodeView(mforms.TreeDefault)
        self._tree.add_column(mforms.IconStringColumnType, "Table", 200, False)
        self._tree.add_column(mforms.StringColumnType, "Limit Copy", 100, True)
        self._tree.add_column(mforms.StringColumnType, "Referencing Tables", 500, False)
        self._tree.end_columns()
        box.add(self._tree, True, True)
        self._advanced_panel.add(box)
        self._tree.set_cell_edited_callback(self._cell_edited)
        self._advbox_shown = False
        self._advanced_panel.show(False)
 def __init__(self, owner):
     WizardPage.__init__(self, owner, "Export Results")
     self.next_button.set_text('Finish')
    def __init__(self, main):
        WizardPage.__init__(self, main, "Data Transfer Setup")

        self.main.add_wizard_page(self, "DataMigration", "Data Transfer Setup")

        label = mforms.newLabel("Select options for the copy of the migrated schema tables in the target\nMySQL server and click [Next >] to execute.")
        self.content.add(label, False, True)

        panel = mforms.newPanel(mforms.TitledBoxPanel)
        panel.set_title("Data Copy")
        self.content.add(panel, False, True)

        box = mforms.newBox(False)
        panel.add(box)
        box.set_padding(12)

        self._copy_db = mforms.newCheckBox()
        self._copy_db.set_text("Online copy of table data to target RDBMS")
        box.add(self._copy_db, False, True)

        # XXX TODO
        #box.add(mforms.newLabel(""), False, True)
        #self._add_script_checkbox_option(box, "dump_to_file", "Create a dump file with the data", "Dump File:", "Save As")

        box.add(mforms.newLabel(""), False, True)

        if sys.platform == "win32":
            self._add_script_checkbox_option(box, "copy_script", "Create a batch file to copy the data at another time", "Batch File:", "Save As")
        else:
            self._add_script_checkbox_option(box, "copy_script", "Create a shell script to copy the data from outside Workbench", "Shell Script File:", "Save As")


        panel = mforms.newPanel(mforms.TitledBoxPanel)
        panel.set_title("Options")
        self.content.add(panel, False, True)

        self.options_box = mforms.newBox(False)
        self.options_box.set_padding(12)
        self.options_box.set_spacing(8)
        panel.add(self.options_box)

        self._truncate_db = mforms.newCheckBox()
        self._truncate_db.set_text("Truncate target tables (ie. delete contents) before copying data")
        self.options_box.add(self._truncate_db, False, True)

        hbox = mforms.newBox(True)
        hbox.set_spacing(8)
        hbox.add(mforms.newLabel("Worker tasks"), False, True)
        self._worker_count = mforms.newTextEntry()
        self._worker_count.set_value("2")
        self._worker_count.set_size(50, -1)
        hbox.add(self._worker_count, False, True)
        l = mforms.newLabel("Number of tasks to use for data transfer. Each task will open a\n"+
          "connection to both source and target RDBMSs to copy table rows.\nDefault value 2.")
        l.set_style(mforms.SmallHelpTextStyle)
        hbox.add(l, True, True)
        self.options_box.add(hbox, False, True)

        self._debug_copy = mforms.newCheckBox()
        self._debug_copy.set_text("Enable debug output for table copy")
        self.options_box.add(self._debug_copy, False, True)


        ###

        self._advanced_panel = mforms.newPanel(mforms.TitledBoxPanel)
        self._advanced_panel.set_title("Tables to Copy")
        self.content.add(self._advanced_panel, True, True)

        box = mforms.newBox(False)
        box.set_padding(12)
        box.set_spacing(8)

        l = mforms.newLabel("""You can limit the number of rows to be copied for certain tables. Tables that are referenced by
foreign keys from other tables cannot be limited, unless data copy from the referencing tables is also disabled.
All tables are copied by default.""")
        l.set_style(mforms.SmallHelpTextStyle)
        box.add(l, False, True)

        self._tree = mforms.newTreeNodeView(mforms.TreeDefault)
        self._tree.add_column(mforms.IconStringColumnType, "Table", 200, False)
        self._tree.add_column(mforms.StringColumnType, "Limit Copy", 100, True)
        self._tree.add_column(mforms.StringColumnType, "Referencing Tables", 500, False)
        self._tree.end_columns()
        box.add(self._tree, True, True)
        self._advanced_panel.add(box)
        self._tree.set_cell_edited_callback(self._cell_edited)
        self._advbox_shown = False
        self._advanced_panel.show(False)
Exemple #51
0
    def __init__(self, owner):
        WizardPage.__init__(self, owner, "Select File to Import", wide=True)

        self.back_button.set_enabled(False)