Class: Voodoo::AppDesigner

Inherits:
PeopleTools show all
Defined in:
lib/voodoo/peopletools/appdesigner.rb

Instance Attribute Summary

Attributes inherited from PeopleTools

#command_line_options, #executable

Instance Method Summary collapse

Methods inherited from PeopleTools

#append, #call_executable

Constructor Details

#initializeAppDesigner

Returns a new instance of AppDesigner.



6
7
8
9
# File 'lib/voodoo/peopletools/appdesigner.rb', line 6

def initialize
  super
  @executable = File.join(@tools_bin, %w{pside.exe}).gsub!(File::SEPARATOR, File::ALT_SEPARATOR)
end

Instance Method Details

#build_project(project, migration, source) ⇒ Object



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/voodoo/peopletools/appdesigner.rb', line 90

def build_project(project, migration, source)
  begin
    LOG.info("Creating build SQL for #{project}")
    append(:db_type => source.db_type)
    append(:env_name => source.name)
    append(:env_username => source.app_username)
    append(:env_password => source.app_password)
    append(:build_project => project)
    update_build_settings(File.join(migration.log_folder, "PSBUILD.log"), File.join(migration.sql_folder, "PSBUILD.sql"))
    call_executable
    LOG.info("Project build SQL created successfully")
  rescue
    LOG.error("Project SQL build failed")
  end

end

#compare(project, migration, source, target) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/voodoo/peopletools/appdesigner.rb', line 11

def compare(project, migration, source, target)
  begin
    LOG.info("Creating compare reports for #{project} between #{source.name} and #{target.name}")
    append(:db_type => source.db_type)
    append(:env_name => source.name)
    append(:env_username => source.app_username)
    append(:env_password => source.app_password)
    append(:compare_project => project)
    append(:target_name => target.name)
    append(:target_username => target.app_username)
    append(:target_password => target.app_password)
    append(:log_file => File.join(migration.log_folder, "Compare_#{source.name}_to_#{target.name}.log"))
    append(:tgt => '1')
    append(:compare_folder => migration.compare_folder(source.name, target.name))
    append(:cmxml => '1')
    call_executable
    view_compare_report(migration.compare_folder(source.name, target.name))
  rescue
    LOG.error("Compare report creation failed")
  end
end

#copy_to_file(project, migration, source) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/voodoo/peopletools/appdesigner.rb', line 33

def copy_to_file(project, migration, source)
  begin
    LOG.info("Copying #{project} from #{source.name} to file")
    append(:db_type => source.db_type)
    append(:env_name => source.name)
    append(:env_username => source.app_username)
    append(:env_password => source.app_password)
    append(:archive_project => project)
    append(:output_folder => migration.export_folder(source.name))
    append(:log_file => File.join(migration.log_folder, "Copy_#{source.name}_to_file.log"))
    call_executable
    LOG.info("Project copied to file successfully")
  rescue
    LOG.error("Project file copy failed")
  end
end

#migrate_full_project(project, migration, source, target) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/voodoo/peopletools/appdesigner.rb', line 50

def migrate_full_project(project, migration, source, target)
  begin
    LOG.info("Copying #{project} from #{source.name} to #{target.name}")
    append(:db_type => source.db_type)
    append(:env_name => source.name)
    append(:env_username => source.app_username)
    append(:env_password => source.app_password)
    append(:copy_project => project)
    append(:target_name => target.name)
    append(:target_username => target.app_username)
    append(:target_password => target.app_password)
    append(:log_file => File.join(migration.log_folder, "Copy_project_#{project}_from_#{source.name}_to_#{target.name}.log"))
    call_executable
    LOG.info("Project migrated successfully")
  rescue
    LOG.error("Project migration failed")
  end
end

#migrate_project_definition(project, migration, source, target) ⇒ Object



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/voodoo/peopletools/appdesigner.rb', line 69

def migrate_project_definition(project, migration, source, target)
  begin
    LOG.info("Copying #{project} definition from #{source.name} to #{target.name}")
    append(:db_type => source.db_type)
    append(:env_name => source.name)
    append(:env_username => source.app_username)
    append(:env_password => source.app_password)
    append(:copy_project => project)
    append(:target_name => target.name)
    append(:target_username => target.app_username)
    append(:target_password => target.app_password)
    append(:log_file => File.join(migration.log_folder, "Copy_project_definition_#{project}_from_#{source.name}_to_#{target.name}.log"))
    append(:exp => '1')
    append(:obj => '16')
    call_executable
    LOG.info("Project migrated successfully")
  rescue
    LOG.error("Project definition migration failed")
  end
end