Skip to content
This repository
Browse code

fixed mysql installation

  • Loading branch information...
commit 63f6ad659c17424947056800eafa5263a0f5feb7 1 parent 1142d0a
Andreas Weber authored
BIN  lib/mysql-connector-java-5.0.8-bin.jar
Binary file not shown
BIN  lib/mysql-connector-java-5.1.14-bin.jar
Binary file not shown
BIN  lib/mysql-connector-java-5.1.23-bin.jar
Binary file not shown
11 nbproject/project.properties
... ... @@ -1,5 +1,6 @@
1 1 annotation.processing.enabled=true
2 2 annotation.processing.enabled.in.editor=false
  3 +annotation.processing.processors.list=
3 4 annotation.processing.run.all.processors=true
4 5 ant.customtasks.libs=JWSAntTasks
5 6 application.desc=Yet another business software
@@ -39,7 +40,6 @@ file.reference.derbyclient.jar=lib/derbyclient.jar
39 40 file.reference.derbynet.jar=lib/derbynet.jar
40 41 file.reference.DTAus.jar=lib/DTAus.jar
41 42 file.reference.frame4j.jar=lib/frame4j.jar
42   -file.reference.google-api-translate-java-0.92.jar=lib/google-api-translate-java-0.92.jar
43 43 file.reference.groovy-all-1.8.4.jar=lib/groovy-all-1.8.4.jar
44 44 file.reference.httpcore-4.0.1.jar=lib/httpcore-4.0.1.jar
45 45 file.reference.httpcore-nio-4.0.1.jar=lib/httpcore-nio-4.0.1.jar
@@ -56,8 +56,9 @@ file.reference.jut.jar=lib/ooo/jut.jar
56 56 file.reference.l2fprod-common-all.jar=lib/l2fprod-common-all.jar
57 57 file.reference.mail.jar=lib/mail.jar
58 58 file.reference.microba-0.4.4.2.jar=lib/microba-0.4.4.2.jar
  59 +file.reference.microsoft-translator-java-api-0.6.1-jar-with-dependencies.jar=lib/microsoft-translator-java-api-0.6.1-jar-with-dependencies.jar
59 60 file.reference.MPCalendar.jar=lib/MPCalendar.jar
60   -file.reference.mysql-connector-java-5.1.14-bin.jar=lib/mysql-connector-java-5.1.14-bin.jar
  61 +file.reference.mysql-connector-java-5.1.23-bin.jar=lib/mysql-connector-java-5.1.23-bin.jar
61 62 file.reference.nativeunix.zip=lib/ooo/nativeunix.zip
62 63 file.reference.noa-libre.jar=lib/noa-libre.jar
63 64 file.reference.officebean.jar=lib/ooo/officebean.jar
@@ -100,16 +101,16 @@ javac.classpath=\
100 101 ${file.reference.microba-0.4.4.2.jar}:\
101 102 ${file.reference.ybsaf.jar}:\
102 103 ${file.reference.iText-2.1.7.jar}:\
103   - ${file.reference.mysql-connector-java-5.1.14-bin.jar}:\
104 104 ${file.reference.ws-commons-util-1.0.2.jar}:\
  105 + ${file.reference.mysql-connector-java-5.1.23-bin.jar}:\
105 106 ${file.reference.commons-logging-1.1.jar}:\
106 107 ${file.reference.httpcore-4.0.1.jar}:\
107 108 ${file.reference.httpcore-nio-4.0.1.jar}:\
108 109 ${file.reference.commons-codec-1.3.jar}:\
109 110 ${file.reference.vcard4j-1_1_3.jar}:\
110 111 ${file.reference.derbyclient.jar}:\
111   - ${file.reference.google-api-translate-java-0.92.jar}:\
112 112 ${file.reference.DTAus.jar}:\
  113 + ${file.reference.microsoft-translator-java-api-0.6.1-jar-with-dependencies.jar}:\
113 114 ${file.reference.bcprov-jdk16-145.jar}:\
114 115 ${file.reference.PDFRenderer.jar}:\
115 116 ${file.reference.derbynet.jar}:\
@@ -178,7 +179,7 @@ jnlp.mixed.code=default
178 179 jnlp.offline-allowed=true
179 180 jnlp.signed=true
180 181 jnlp.signing=generated
181   -jnlp.signing.alias=
  182 +jnlp.signing.alias=openyabs
182 183 jnlp.signing.keystore=
183 184 main.class=mpv5.Main
184 185 manifest.file=manifest.mf
30 src/mpv5/db/common/DatabaseConnection.java
@@ -111,7 +111,7 @@ public boolean connect(String predefinedDriver, String user, String password, St
111 111 DriverManager.registerDriver((Driver) Class.forName(getCtype().getDriver()).newInstance());
112 112 Log.Debug(this, "Driver: " + getCtype().getDriver());
113 113 } catch (Exception ex) {
114   - Log.Debug(this, ex.getMessage());
  114 + Log.Debug(this, ex);
115 115 }
116 116
117 117 return reconnect(create);
@@ -126,35 +126,35 @@ public boolean reconnect(boolean create) throws SQLException {
126 126 try {
127 127 Log.Debug(this, "RECONNECT::Datenbankverbindung: " + getCtype().getConnectionString(create));
128 128 conn = DriverManager.getConnection(getCtype().getConnectionString(create), user, password);
129   - conn.setAutoCommit(true);
  129 + boolean result = true;
130 130 if (conn != null //&& conn.isValid(10)//does not work with MySQL Connector/J 5.0
131   - ) {//mysql (and others) need explicit create database, derby does it by itself
  131 + ) {//mysql (and others) need explicit create database, derby does it by itself
  132 + conn.setAutoCommit(true);
132 133 if (create && ConnectionTypeHandler.getDriverType() != ConnectionTypeHandler.DERBY) {
133 134 stmt = conn.createStatement();
134   - conn.setCatalog(ConnectionTypeHandler.getDBNAME());
135 135 if (User.PROPERTIES_OVERRIDE.hasProperty("drop_database_on_create")) {
136 136 try {
137 137 sql = "DROP DATABASE "
138   - + ConnectionTypeHandler.getDBNAME()
139   - + ";";
  138 + + ConnectionTypeHandler.getDBNAME()
  139 + + ";";
140 140 stmt.execute(sql);
141 141 } catch (SQLException ex) {
142   - Log.Debug(this, "Database Error Cleaing of old DB failed!");
  142 + Log.Debug(this, "Database Error cleaning of old DB failed!");
143 143 }
144 144 }
145 145 try {
146 146 sql = "CREATE DATABASE "
147   - + ConnectionTypeHandler.getDBNAME()
148   - + " ;";
  147 + + ConnectionTypeHandler.getDBNAME()
  148 + + " ;";
149 149 stmt.execute(sql);
150 150 } catch (SQLException ex) {
151   - Popup.OK_dialog(Messages.CREATE_DATABASE_OWN.toString(), "Database Creation");
152   - return false;
  151 + Log.Debug(ex);
  152 + result = Popup.OK_dialog("Could not create database " + ConnectionTypeHandler.getDBNAME() + ", did you already create it?", "Database Creation");
153 153 }
154   -
155 154 }
  155 + conn.setCatalog(ConnectionTypeHandler.getDBNAME());
156 156 connector = this;
157   - return true;
  157 + return result;
158 158 } else {
159 159 throw new RuntimeException("Could not create connection: " + getCtype().getConnectionString(create));
160 160 }
@@ -209,7 +209,7 @@ public static void shutdown() {
209 209 if (ConnectionTypeHandler.getDriverType() == ConnectionTypeHandler.DERBY) {
210 210 try {
211 211 DriverManager.getConnection(
212   - DatabaseConnection.instanceOf().getCtype().getConnectionString(false) + "shutdown=true;", user, password);
  212 + DatabaseConnection.instanceOf().getCtype().getConnectionString(false) + "shutdown=true;", user, password);
213 213 } catch (Exception ex) {
214 214 Log.Debug(DatabaseConnection.class, ex.getLocalizedMessage());
215 215 }
@@ -262,7 +262,7 @@ public boolean runQueries(String[] queries) throws SQLException {
262 262 }
263 263 return true;
264 264 } catch (Exception sQLException) {
265   - Log.Debug(this, sQLException.getMessage());
  265 + Log.Debug(this, "-----------> "+sQLException.getMessage());
266 266 return false;
267 267 } finally {
268 268 if (prog != null) {
4 src/mpv5/resources/languages/Panels.properties
@@ -19,7 +19,6 @@ wizard_DBSettings_1.jPanel1.border.title=OpenOffice 3
19 19 wizard_DBSettings_1.jPanel2.border.title=Database
20 20 wizard_DBSettings_2.jPanel1.border.title=Finish
21 21 wizard_DBSettings_3.jLabel1.text=jLabel1
22   -wizard_DBSettings_1.jPanel3.border.title=Information
23 22 ContactsList.jPanel1.border.title=Contacts List
24 23 ContactsList.jCheckBox1.text=Customers
25 24 ContactsList.jLabel1.text=Show:
@@ -230,7 +229,6 @@ AddressPanel.jButton1.toolTipText=Remove
230 229 JournalPanel.jPanel1.border.title=Journal
231 230 ContactPanel.jButton2.text=History
232 231 wizard_DBSettings_1.labeledTextField3._Label=Database
233   -wizard_DBSettings_1.jCheckBox1.text=Use existing data (do upgrade)
234 232 ControlPanel_Accounts.classv._Label=Class
235 233 MPBabelFish.jMenuItem4.text=Open language file..
236 234 ControlPanel_Local.jPanel4.border.title=Database settings
@@ -1153,7 +1151,6 @@ wizard_DBSettings_simple_1.labeledTextField2._Label=Port
1153 1151 wizard_DBSettings_simple_1.border.title=Specify initial settings
1154 1152 wizard_DBSettings_simple_1.jPanel1.border.title=OpenOffice 3
1155 1153 wizard_DBSettings_simple_1.jTextArea1.text=This will install a local database into your home directory. \nIf you need to change the location or or want to use a dedicated database server please click on "Advanced".\n\nYou can configure the OpenOffice connection later within the YaBS control panel.
1156   -wizard_DBSettings_1.jTextArea1.text=This will install a local database into your home directory. \nIf you need to change the location or or want to use a dedicated database server please click on "Advanced".\n\nYou can configure the OpenOffice connection later within the YaBS control panel.
1157 1154 wizard_DBSettings_simple_1.jPanel3.border.title=Information
1158 1155 wizard_DBSettings_simple_1.jButton1.text=Advanced..
1159 1156 ContactsList.jButton1.text=Customer
@@ -2059,3 +2056,4 @@ ControlPanel_Userproperties.noblank.text=Do not blank unused fields
2059 2056 ControlPanel_Userproperties.remoteurl.text=Load remote office docs by url
2060 2057 ControlPanel_Userproperties.resolv.text=Resolve full products in xtable
2061 2058 ControlPanel_Userproperties.nocount.text=Hide count for text items
  2059 +wizard_DBSettings_1.existingData.text=Use existing data (do upgrade)
174 src/mpv5/ui/dialogs/subcomponents/wizard_DBSettings_1.form
... ... @@ -1,4 +1,4 @@
1   -<?xml version="1.1" encoding="UTF-8" ?>
  1 +<?xml version="1.0" encoding="UTF-8" ?>
2 2
3 3 <Form version="1.6" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4 4 <Properties>
@@ -25,7 +25,7 @@
25 25 <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
26 26 <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
27 27 <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
28   - <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,2,-101,0,0,2,-64"/>
  28 + <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-4,0,0,2,124"/>
29 29 </AuxValues>
30 30
31 31 <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
@@ -50,46 +50,49 @@
50 50 <Layout>
51 51 <DimensionLayout dim="0">
52 52 <Group type="103" groupAlignment="0" attributes="0">
53   - <Component id="jPanel5" alignment="1" max="32767" attributes="1"/>
54   - <Group type="103" alignment="0" groupAlignment="0" max="-2" attributes="0">
55   - <Group type="102" attributes="0">
56   - <Component id="jLabel1" min="-2" pref="183" max="-2" attributes="0"/>
57   - <EmptySpace min="4" pref="4" max="4" attributes="0"/>
58   - <Component id="jComboBox1" min="-2" pref="352" max="-2" attributes="0"/>
59   - <EmptySpace min="10" pref="10" max="10" attributes="0"/>
60   - <Component id="jButton1" min="-2" max="-2" attributes="0"/>
61   - </Group>
62   - <Group type="102" attributes="0">
63   - <Component id="jLabel2" min="-2" pref="183" max="-2" attributes="0"/>
64   - <EmptySpace min="4" pref="4" max="4" attributes="0"/>
65   - <Component id="jCheckBox2" min="-2" pref="415" max="-2" attributes="0"/>
66   - </Group>
67   - <Component id="labeledTextChooser1" alignment="1" pref="602" max="32767" attributes="1"/>
68   - <Component id="jCheckBox1" alignment="0" min="-2" pref="286" max="-2" attributes="0"/>
69   - <Component id="labeledTextField3" alignment="0" min="-2" max="-2" attributes="0"/>
70   - <Group type="102" alignment="0" attributes="0">
71   - <Component id="prefix" min="-2" max="-2" attributes="0"/>
72   - <EmptySpace type="separate" max="-2" attributes="0"/>
73   - <Component id="jButton3" min="-2" max="-2" attributes="0"/>
74   - <EmptySpace type="separate" max="-2" attributes="0"/>
75   - <Component id="jLabel4" min="-2" max="-2" attributes="0"/>
  53 + <Group type="102" attributes="0">
  54 + <Group type="103" groupAlignment="0" max="-2" attributes="0">
  55 + <Group type="102" attributes="0">
  56 + <Component id="jLabel1" min="-2" pref="183" max="-2" attributes="0"/>
  57 + <EmptySpace min="4" pref="4" max="4" attributes="0"/>
  58 + <Component id="jComboBox1" min="-2" pref="352" max="-2" attributes="0"/>
  59 + <EmptySpace min="10" pref="10" max="10" attributes="0"/>
  60 + <Component id="jButton1" min="-2" max="-2" attributes="0"/>
  61 + </Group>
  62 + <Group type="102" attributes="0">
  63 + <Component id="jLabel2" min="-2" pref="183" max="-2" attributes="0"/>
  64 + <EmptySpace min="4" pref="4" max="4" attributes="0"/>
  65 + <Component id="jCheckBox2" min="-2" pref="415" max="-2" attributes="0"/>
  66 + </Group>
  67 + <Component id="labeledTextChooser1" alignment="1" max="32767" attributes="1"/>
  68 + <Component id="existingData" alignment="0" min="-2" pref="286" max="-2" attributes="0"/>
  69 + <Component id="labeledTextField3" alignment="0" min="-2" max="-2" attributes="0"/>
  70 + <Group type="102" alignment="0" attributes="0">
  71 + <Component id="prefix" min="-2" max="-2" attributes="0"/>
  72 + <EmptySpace type="separate" max="-2" attributes="0"/>
  73 + <Component id="jButton3" min="-2" max="-2" attributes="0"/>
  74 + <EmptySpace type="separate" max="-2" attributes="0"/>
  75 + <Component id="jLabel4" min="-2" max="-2" attributes="0"/>
  76 + </Group>
  77 + <Component id="jPanel4" alignment="1" max="32767" attributes="1"/>
76 78 </Group>
77   - <Component id="jPanel4" alignment="1" pref="602" max="32767" attributes="1"/>
  79 + <EmptySpace max="32767" attributes="0"/>
78 80 </Group>
  81 + <Component id="jPanel5" max="32767" attributes="1"/>
79 82 </Group>
80 83 </DimensionLayout>
81 84 <DimensionLayout dim="1">
82 85 <Group type="103" groupAlignment="0" attributes="0">
83 86 <Group type="102" attributes="0">
84   - <Group type="103" groupAlignment="0" attributes="0">
  87 + <Group type="103" groupAlignment="0" max="-2" attributes="0">
85 88 <Group type="102" attributes="0">
86 89 <EmptySpace min="4" pref="4" max="4" attributes="0"/>
87 90 <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
88 91 </Group>
89   - <Component id="jComboBox1" min="-2" max="-2" attributes="0"/>
90   - <Component id="jButton1" min="-2" max="-2" attributes="0"/>
  92 + <Component id="jComboBox1" max="32767" attributes="0"/>
  93 + <Component id="jButton1" alignment="0" pref="0" max="32767" attributes="0"/>
91 94 </Group>
92   - <EmptySpace min="2" pref="2" max="2" attributes="0"/>
  95 + <EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
93 96 <Group type="103" groupAlignment="0" attributes="0">
94 97 <Group type="102" attributes="0">
95 98 <EmptySpace min="6" pref="6" max="6" attributes="0"/>
@@ -100,7 +103,7 @@
100 103 <EmptySpace min="7" pref="7" max="7" attributes="0"/>
101 104 <Component id="labeledTextChooser1" min="-2" max="-2" attributes="0"/>
102 105 <EmptySpace max="-2" attributes="0"/>
103   - <Component id="jCheckBox1" min="-2" max="-2" attributes="0"/>
  106 + <Component id="existingData" min="-2" max="-2" attributes="0"/>
104 107 <EmptySpace type="unrelated" max="-2" attributes="0"/>
105 108 <Group type="103" groupAlignment="1" attributes="0">
106 109 <Group type="102" attributes="0">
@@ -117,7 +120,7 @@
117 120 <Component id="jPanel4" min="-2" pref="61" max="-2" attributes="0"/>
118 121 <EmptySpace max="32767" attributes="0"/>
119 122 <Component id="jPanel5" min="-2" max="-2" attributes="0"/>
120   - <EmptySpace max="-2" attributes="0"/>
  123 + <EmptySpace min="0" pref="0" max="-2" attributes="0"/>
121 124 </Group>
122 125 </Group>
123 126 </DimensionLayout>
@@ -154,12 +157,12 @@
154 157 <Property name="name" type="java.lang.String" value="labeledTextField3" noResource="true"/>
155 158 </Properties>
156 159 </Component>
157   - <Component class="javax.swing.JCheckBox" name="jCheckBox1">
  160 + <Component class="javax.swing.JCheckBox" name="existingData">
158 161 <Properties>
159 162 <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
160   - <ResourceString bundle="mpv5/resources/languages/Panels.properties" key="wizard_DBSettings_1.jCheckBox1.text" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
  163 + <ResourceString bundle="mpv5/resources/languages/Panels.properties" key="wizard_DBSettings_1.existingData.text" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
161 164 </Property>
162   - <Property name="name" type="java.lang.String" value="jCheckBox1" noResource="true"/>
  165 + <Property name="name" type="java.lang.String" value="existingData" noResource="true"/>
163 166 </Properties>
164 167 </Component>
165 168 <Component class="javax.swing.JLabel" name="jLabel2">
@@ -299,38 +302,33 @@
299 302 <Layout>
300 303 <DimensionLayout dim="0">
301 304 <Group type="103" groupAlignment="0" attributes="0">
  305 + <Component id="backupDBName" alignment="0" max="32767" attributes="1"/>
  306 + <Component id="DumpName" alignment="0" max="32767" attributes="1"/>
302 307 <Group type="102" alignment="0" attributes="0">
303   - <Component id="restore" min="-2" max="-2" attributes="0"/>
  308 + <Component id="jLabel5" max="32767" attributes="0"/>
304 309 <EmptySpace max="-2" attributes="0"/>
305   - </Group>
306   - <Group type="102" alignment="0" attributes="0">
307   - <Component id="jLabel5" min="-2" pref="109" max="-2" attributes="0"/>
308   - <EmptySpace max="-2" attributes="0"/>
309   - </Group>
310   - <Group type="102" alignment="1" attributes="0">
311   - <Component id="DumpURL" pref="645" max="32767" attributes="1"/>
  310 + <Component id="DumpURL" min="-2" pref="434" max="-2" attributes="1"/>
312 311 <EmptySpace max="-2" attributes="0"/>
313 312 <Component id="DumpURLBtn" min="-2" pref="17" max="-2" attributes="0"/>
314 313 </Group>
315   - <Component id="backupDBName" alignment="0" pref="668" max="32767" attributes="1"/>
316   - <Component id="DumpName" alignment="0" pref="668" max="32767" attributes="1"/>
  314 + <Component id="restore" alignment="0" max="32767" attributes="0"/>
317 315 </Group>
318 316 </DimensionLayout>
319 317 <DimensionLayout dim="1">
320 318 <Group type="103" groupAlignment="0" attributes="0">
321 319 <Group type="102" alignment="0" attributes="0">
322 320 <Component id="restore" min="-2" max="-2" attributes="0"/>
323   - <EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
324   - <Component id="jLabel5" min="-2" max="-2" attributes="0"/>
325 321 <EmptySpace max="-2" attributes="0"/>
326   - <Group type="103" groupAlignment="3" attributes="0">
327   - <Component id="DumpURL" alignment="3" min="-2" max="-2" attributes="0"/>
328   - <Component id="DumpURLBtn" alignment="3" min="-2" max="-2" attributes="0"/>
  322 + <Group type="103" groupAlignment="2" attributes="0">
  323 + <Component id="DumpURL" alignment="2" min="-2" max="-2" attributes="0"/>
  324 + <Component id="DumpURLBtn" alignment="2" min="-2" max="-2" attributes="0"/>
  325 + <Component id="jLabel5" alignment="2" min="-2" max="-2" attributes="0"/>
329 326 </Group>
330 327 <EmptySpace max="-2" attributes="0"/>
331 328 <Component id="backupDBName" min="-2" max="-2" attributes="0"/>
332   - <EmptySpace pref="9" max="32767" attributes="0"/>
  329 + <EmptySpace max="32767" attributes="0"/>
333 330 <Component id="DumpName" min="-2" max="-2" attributes="0"/>
  331 + <EmptySpace min="0" pref="0" max="-2" attributes="0"/>
334 332 </Group>
335 333 </Group>
336 334 </DimensionLayout>
@@ -421,11 +419,11 @@
421 419 <Group type="102" attributes="0">
422 420 <EmptySpace min="-2" max="-2" attributes="0"/>
423 421 <Group type="103" groupAlignment="0" attributes="0">
424   - <Component id="labeledTextChooser2" pref="660" max="32767" attributes="0"/>
  422 + <Component id="labeledTextChooser2" pref="592" max="32767" attributes="0"/>
425 423 <Group type="102" alignment="0" attributes="0">
426 424 <Component id="jCheckBox3" min="-2" pref="130" max="-2" attributes="1"/>
427 425 <EmptySpace min="-2" max="-2" attributes="0"/>
428   - <Component id="labeledTextField1" pref="361" max="32767" attributes="1"/>
  426 + <Component id="labeledTextField1" pref="293" max="32767" attributes="1"/>
429 427 <EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
430 428 <Component id="labeledTextField2" min="-2" pref="157" max="-2" attributes="2"/>
431 429 </Group>
@@ -503,75 +501,5 @@
503 501 </Component>
504 502 </SubComponents>
505 503 </Container>
506   - <Container class="javax.swing.JPanel" name="jPanel3">
507   - <Properties>
508   - <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
509   - <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
510   - <TitledBorder title="Information">
511   - <ResourceString PropertyName="titleX" bundle="mpv5/resources/languages/Panels.properties" key="wizard_DBSettings_1.jPanel3.border.title" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
512   - </TitledBorder>
513   - </Border>
514   - </Property>
515   - <Property name="name" type="java.lang.String" value="jPanel3" noResource="true"/>
516   - </Properties>
517   - <Constraints>
518   - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
519   - <BorderConstraints direction="South"/>
520   - </Constraint>
521   - </Constraints>
522   -
523   - <Layout>
524   - <DimensionLayout dim="0">
525   - <Group type="103" groupAlignment="0" attributes="0">
526   - <Component id="jScrollPane1" alignment="0" pref="680" max="32767" attributes="0"/>
527   - </Group>
528   - </DimensionLayout>
529   - <DimensionLayout dim="1">
530   - <Group type="103" groupAlignment="0" attributes="0">
531   - <Component id="jScrollPane1" min="-2" max="-2" attributes="0"/>
532   - </Group>
533   - </DimensionLayout>
534   - </Layout>
535   - <SubComponents>
536   - <Container class="javax.swing.JScrollPane" name="jScrollPane1">
537   - <Properties>
538   - <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
539   - <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
540   - <EmptyBorder/>
541   - </Border>
542   - </Property>
543   - <Property name="horizontalScrollBarPolicy" type="int" value="31"/>
544   - <Property name="verticalScrollBarPolicy" type="int" value="21"/>
545   - <Property name="name" type="java.lang.String" value="jScrollPane1" noResource="true"/>
546   - </Properties>
547   - <AuxValues>
548   - <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
549   - </AuxValues>
550   -
551   - <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
552   - <SubComponents>
553   - <Component class="javax.swing.JTextArea" name="jTextArea1">
554   - <Properties>
555   - <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
556   - <Color blue="d8" green="e9" red="ec" type="rgb"/>
557   - </Property>
558   - <Property name="columns" type="int" value="20"/>
559   - <Property name="editable" type="boolean" value="false"/>
560   - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
561   - <Font name="Tahoma" size="12" style="0"/>
562   - </Property>
563   - <Property name="lineWrap" type="boolean" value="true"/>
564   - <Property name="rows" type="int" value="5"/>
565   - <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
566   - <ResourceString bundle="mpv5/resources/languages/Panels.properties" key="wizard_DBSettings_1.jTextArea1.text" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
567   - </Property>
568   - <Property name="wrapStyleWord" type="boolean" value="true"/>
569   - <Property name="name" type="java.lang.String" value="jTextArea1" noResource="true"/>
570   - </Properties>
571   - </Component>
572   - </SubComponents>
573   - </Container>
574   - </SubComponents>
575   - </Container>
576 504 </SubComponents>
577 505 </Form>
1,171 src/mpv5/ui/dialogs/subcomponents/wizard_DBSettings_1.java
@@ -27,643 +27,608 @@
27 27
28 28 /**
29 29 *
30   - *
  30 + *
31 31 */
32 32 public class wizard_DBSettings_1 extends javax.swing.JPanel implements Wizardable {
33 33
34   - private static final long serialVersionUID = 1L;
35   - private WizardMaster master;
36   - private Integer forConnId = null;
37   -
38   - public wizard_DBSettings_1(Wizard w, Integer forConnId) {
39   - this.master = w;
40   - initComponents();
41   - labeledTextChooser2.setMode(JFileChooser.DIRECTORIES_ONLY);
42   - jComboBox1.setModel(new DefaultComboBoxModel(ConnectionTypeHandler.DRIVERS));
43   - this.forConnId = forConnId;
44   - load();
45   - }
46   -
47   - private boolean DBVerification() {
48   - DatabaseConnection conn;
49   - this.master.setCursor(new Cursor(Cursor.WAIT_CURSOR));
50   -
51   - if (labeledTextChooser1.get_Text(false) != null && labeledTextChooser1.get_Text(false).length() > 0) {
52   - master.getStore().changeProperty("driver", jComboBox1.getSelectedItem().toString());
53   - master.getStore().changeProperty("url", labeledTextChooser1.get_Text(false));
54   - master.getStore().changeProperty("user", labeledTextField4.get_Text());
55   - master.getStore().changeProperty("password", labeledTextField5.get_Text());
56   - master.getStore().changeProperty("dbname", labeledTextField3.get_Text());
57   - master.getStore().changeProperty("dbprefix", prefix.get_Text());
58   - master.setMessage(Messages.CONNECTION_PROBE + master.getStore().getProperty("driver"));
59   - conn = new DatabaseConnection();
60   - try {
61   - LocalSettings.setProperty(LocalSettings.DBPATH, master.getStore().getProperty("url"));
62   - LocalSettings.setProperty(LocalSettings.DBDRIVER, master.getStore().getProperty("driver"));
63   - LocalSettings.setProperty(LocalSettings.DBUSER, master.getStore().getProperty("user"));
64   - LocalSettings.setProperty(LocalSettings.DBPASSWORD, master.getStore().getProperty("password"));
65   - LocalSettings.setProperty(LocalSettings.DBNAME, master.getStore().getProperty("dbname"));
66   - LocalSettings.setProperty(LocalSettings.DBPREFIX, master.getStore().getProperty("dbprefix"));
67   - if (!jCheckBox3.isSelected() && labeledTextChooser2.hasText()) {
68   - LocalSettings.setProperty(LocalSettings.OFFICE_HOME, labeledTextChooser2.get_Text(true));
69   - LocalSettings.setProperty(LocalSettings.OFFICE_USE, "true");
70   - LocalSettings.setProperty(LocalSettings.OFFICE_REMOTE, "false");
71   - } else if (labeledTextField1.getText().length() > 0 && labeledTextField2.getText().length() > 0) {
72   - LocalSettings.setProperty(LocalSettings.OFFICE_HOST, labeledTextField1.getText());
73   - LocalSettings.setProperty(LocalSettings.OFFICE_PORT, labeledTextField2.getText());
74   - LocalSettings.setProperty(LocalSettings.OFFICE_USE, "true");
75   - LocalSettings.setProperty(LocalSettings.OFFICE_REMOTE, "true");
76   - } else {
77   - LocalSettings.setProperty(LocalSettings.OFFICE_USE, "false");
78   - }
79   - if (jCheckBox2.isSelected()) {
80   - LocalSettings.setProperty(LocalSettings.DBTYPE, "network");
81   - } else {
82   - LocalSettings.setProperty(LocalSettings.DBTYPE, "single");
83   - }
84   -
85   - if (restore.isSelected()) {
86   - master.setMessage(Messages.RESTORING_DATABASE.toString());
87   - conn.setProgressbar(master.getProgressbar());
88   - Log.Debug(this, "Running DB restore ...");
89   - MigrationWB.instanceOf().doRestore(DumpURL.getText(), DumpName.getText(), backupDBName.getText(), conn, master);
90   - LocalSettings.save(forConnId);
91   - LocalSettings.apply();
92   - } else if (conn.connect(master.getStore().getProperty("driver"),
93   - master.getStore().getProperty("user"),
94   - master.getStore().getProperty("password"),
95   - master.getStore().getProperty("url"),
96   - master.getStore().getProperty("dbname"),
97   - master.getStore().getProperty("dbprefix"),
98   - !jCheckBox1.isSelected())) {
99   - master.setMessage(Messages.CONNECTION_VERIFIED.toString());
100   - LocalSettings.save(forConnId);
101   - LocalSettings.apply();
102   -
103   - if (!jCheckBox1.isSelected() && !restore.isSelected()) {
104   - master.setMessage(Messages.CREATING_DATABASE.toString());
105   - conn.setProgressbar(master.getProgressbar());
106   - Log.Debug(this, "Running DB install queries...");
107   - if (conn.runQueries(new DatabaseInstallation().getStructure())
108   - && conn.runQueries(new DatabaseInstallation().getInitialData())) {
109   - try {
110   - File f = new File(this.getClass().getResource("languages").toURI());
111   - Log.Debug(this, "Importing languages from: " + f.getCanonicalPath());
112   - File[] langfiles = f.listFiles();
113   - for (int i = 0; i < langfiles.length; i++) {
114   - File file = langfiles[i];
115   - LanguageManager.importLanguage(file.getName(), file);
116   - }
117   - } catch (Exception uRISyntaxException) {
118   - Log.Debug(this, uRISyntaxException.getMessage());
119   - }
120   -
121   - try {
122   - File f = new File(this.getClass().getResource("/mpv5/resources/extra/").toURI());
123   - Log.Debug(this, "Importing coutries from: " + f.getCanonicalPath());
124   - File[] langfiles = f.listFiles();
125   - for (int i = 0; i < langfiles.length; i++) {
126   - File file = langfiles[i];
127   - LanguageManager.importCountries(file);
128   - }
129   - } catch (Exception uRISyntaxException) {
130   - Log.Debug(this, uRISyntaxException.getMessage());
131   - }
132   - master.setMessage(Messages.CONNECTION_VERIFIED.toString());
133   - } else {
134   - master.setMessage(Messages.CREATING_DATABASE_FAILED.toString());
135   - return false;
136   - }
137   - }
138   - master.isEnd(true);
139   - } else {
140   - master.setMessage(Messages.CONNECTION_FAILED.toString());
141   - }
142   -
143   - } catch (Exception ex) {
144   - master.setMessage(Messages.CONNECTION_FAILED.toString());
145   - this.master.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
146   - Log.Debug(ex);
147   - if (Popup.Y_N_dialog(this, Messages.ERROR_OCCURED + "\n" + Messages.SEE_LOG + "?", Messages.CONNECTION_FAILED)) {
148   - try {
149   - Desktop.getDesktop().open(YConsole.getLogfile());
150   - } catch (IOException ex1) {
151   - Popup.error(ex1);
152   - }
153   - }
154   - return false;
155   - }
156   - this.master.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
157   - return true;
158   - } else {
159   - this.master.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
160   - return false;
161   - }
162   - }
163   -
164   - private boolean DirectoryCreate() {
165   - ////////////// The cache dir //////////////////////
166   - LocalSettings.setProperty(LocalSettings.CACHE_DIR, Main.MPPATH + File.separator + "Cache");
167   - LocalSettings.save(forConnId);
168   - File file1 = new File(LocalSettings.getProperty(LocalSettings.CACHE_DIR));
169   - file1.mkdirs();
170   - ///////////////////////////////////////////////////////////
171   -
172   - return file1.exists();
173   - }
174   -
175   - // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
176   - private void initComponents() {
177   -
178   - jPanel2 = new javax.swing.JPanel();
179   - jLabel1 = new javax.swing.JLabel();
180   - jComboBox1 = new javax.swing.JComboBox();
181   - labeledTextField3 = new mpv5.ui.beans.LabeledTextField();
182   - jCheckBox1 = new javax.swing.JCheckBox();
183   - jLabel2 = new javax.swing.JLabel();
184   - jCheckBox2 = new javax.swing.JCheckBox();
185   - jPanel4 = new javax.swing.JPanel();
186   - labeledTextField4 = new mpv5.ui.beans.LabeledTextField();
187   - labeledTextField5 = new mpv5.ui.beans.LabeledTextField();
188   - jButton2 = new javax.swing.JButton();
189   - prefix = new mpv5.ui.beans.LabeledTextField();
190   - jButton3 = new javax.swing.JButton();
191   - jLabel4 = new javax.swing.JLabel();
192   - jButton1 = new javax.swing.JButton();
193   - labeledTextChooser1 = new mpv5.ui.beans.LabeledTextChooser();
194   - jPanel5 = new javax.swing.JPanel();
195   - restore = new javax.swing.JCheckBox();
196   - DumpURL = new javax.swing.JTextField();
197   - jLabel5 = new javax.swing.JLabel();
198   - backupDBName = new mpv5.ui.beans.LabeledTextField();
199   - DumpURLBtn = new javax.swing.JButton();
200   - DumpName = new mpv5.ui.beans.LabeledTextField();
201   - jPanel1 = new javax.swing.JPanel();
202   - labeledTextChooser2 = new mpv5.ui.beans.LabeledTextChooser();
203   - jCheckBox3 = new javax.swing.JCheckBox();
204   - labeledTextField1 = new mpv5.ui.beans.LabeledTextField();
205   - labeledTextField2 = new mpv5.ui.beans.LabeledTextField();
206   - jLabel3 = new javax.swing.JLabel();
207   - jPanel3 = new javax.swing.JPanel();
208   - jScrollPane1 = new javax.swing.JScrollPane();
209   - jTextArea1 = new javax.swing.JTextArea();
210   -
211   - setBackground(new java.awt.Color(255, 255, 255));
212   - java.util.ResourceBundle bundle = mpv5.i18n.LanguageManager.getBundle(); // NOI18N // NOI18N
213   - setBorder(javax.swing.BorderFactory.createTitledBorder(bundle.getString("wizard_DBSettings_1.border.title"))); // NOI18N
214   - setName("Form"); // NOI18N
215   - setLayout(new java.awt.BorderLayout());
216   -
217   - jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle.getString("wizard_DBSettings_1.jPanel2.border.title"))); // NOI18N
218   - jPanel2.setName("jPanel2"); // NOI18N
219   -
220   - jLabel1.setText(bundle.getString("wizard_DBSettings_1.jLabel1.text")); // NOI18N
221   - jLabel1.setName("jLabel1"); // NOI18N
222   -
223   - jComboBox1.setEditable(true);
224   - jComboBox1.setFont(new java.awt.Font("Dialog", 0, 11));
225   - jComboBox1.setName("jComboBox1"); // NOI18N
226   - jComboBox1.addActionListener(new java.awt.event.ActionListener() {
227   - public void actionPerformed(java.awt.event.ActionEvent evt) {
228   - jComboBox1ActionPerformed(evt);
229   - }
230   - });
231   -
232   - labeledTextField3.set_Label(bundle.getString("wizard_DBSettings_1.labeledTextField3._Label")); // NOI18N
233   - labeledTextField3.setName("labeledTextField3"); // NOI18N
234   -
235   - jCheckBox1.setText(bundle.getString("wizard_DBSettings_1.jCheckBox1.text")); // NOI18N
236   - jCheckBox1.setName("jCheckBox1"); // NOI18N
237   -
238   - jLabel2.setText(bundle.getString("wizard_DBSettings_1.jLabel2.text")); // NOI18N
239   - jLabel2.setName("jLabel2"); // NOI18N
240   -
241   - jCheckBox2.setFont(new java.awt.Font("Dialog", 0, 12));
242   - jCheckBox2.setText(bundle.getString("wizard_DBSettings_1.jCheckBox2.text")); // NOI18N
243   - jCheckBox2.setName("jCheckBox2"); // NOI18N
244   -
245   - jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle.getString("wizard_DBSettings_1.jPanel4.border.title"))); // NOI18N
246   - jPanel4.setName("jPanel4"); // NOI18N
247   -
248   - labeledTextField4.set_Label(bundle.getString("wizard_DBSettings_1.labeledTextField4._Label")); // NOI18N
249   - labeledTextField4.setEnabled(false);
250   - labeledTextField4.setName("labeledTextField4"); // NOI18N
251   - jPanel4.add(labeledTextField4);
252   -
253   - labeledTextField5.set_Label(bundle.getString("wizard_DBSettings_1.labeledTextField5._Label")); // NOI18N
254   - labeledTextField5.setEnabled(false);
255   - labeledTextField5.setName("labeledTextField5"); // NOI18N
256   - jPanel4.add(labeledTextField5);
257   -
258   - jButton2.setFont(new java.awt.Font("Dialog", 0, 12));
259   - jButton2.setText(bundle.getString("wizard_DBSettings_1.jButton2.text")); // NOI18N
260   - jButton2.setName("jButton2"); // NOI18N
261   - jButton2.addActionListener(new java.awt.event.ActionListener() {
262   - public void actionPerformed(java.awt.event.ActionEvent evt) {
263   - jButton2ActionPerformed(evt);
264   - }
265   - });
266   - jPanel4.add(jButton2);
267   -
268   - prefix.set_Label(bundle.getString("wizard_DBSettings_1.prefix._Label")); // NOI18N
269   - prefix.setEnabled(false);
270   - prefix.setName("prefix"); // NOI18N
271   -
272   - jButton3.setFont(new java.awt.Font("Dialog", 0, 12));
273   - jButton3.setText(bundle.getString("wizard_DBSettings_1.jButton3.text")); // NOI18N
274   - jButton3.setName("jButton3"); // NOI18N
275   - jButton3.addActionListener(new java.awt.event.ActionListener() {
276   - public void actionPerformed(java.awt.event.ActionEvent evt) {
277   - jButton3ActionPerformed(evt);
  34 + private static final long serialVersionUID = 1L;
  35 + private WizardMaster master;
  36 + private Integer forConnId = null;
  37 +
  38 + public wizard_DBSettings_1(Wizard w, Integer forConnId) {
  39 + this.master = w;
  40 + initComponents();
  41 + labeledTextChooser2.setMode(JFileChooser.DIRECTORIES_ONLY);
  42 + jComboBox1.setModel(new DefaultComboBoxModel(ConnectionTypeHandler.DRIVERS));
  43 + this.forConnId = forConnId;
  44 + load();
  45 + }
  46 +
  47 + private boolean DBVerification() {
  48 + DatabaseConnection conn;
  49 + this.master.setCursor(new Cursor(Cursor.WAIT_CURSOR));
  50 +
  51 + if (labeledTextChooser1.get_Text(false) != null && labeledTextChooser1.get_Text(false).length() > 0) {
  52 + master.getStore().changeProperty("driver", jComboBox1.getSelectedItem().toString());
  53 + master.getStore().changeProperty("url", labeledTextChooser1.get_Text(false));
  54 + master.getStore().changeProperty("user", labeledTextField4.get_Text());
  55 + master.getStore().changeProperty("password", labeledTextField5.get_Text());
  56 + master.getStore().changeProperty("dbname", labeledTextField3.get_Text());
  57 + master.getStore().changeProperty("dbprefix", prefix.get_Text());
  58 + master.setMessage(Messages.CONNECTION_PROBE + master.getStore().getProperty("driver"));
  59 + conn = new DatabaseConnection();
  60 + try {
  61 + LocalSettings.setProperty(LocalSettings.DBPATH, master.getStore().getProperty("url"));
  62 + LocalSettings.setProperty(LocalSettings.DBDRIVER, master.getStore().getProperty("driver"));
  63 + LocalSettings.setProperty(LocalSettings.DBUSER, master.getStore().getProperty("user"));
  64 + LocalSettings.setProperty(LocalSettings.DBPASSWORD, master.getStore().getProperty("password"));
  65 + LocalSettings.setProperty(LocalSettings.DBNAME, master.getStore().getProperty("dbname"));
  66 + LocalSettings.setProperty(LocalSettings.DBPREFIX, master.getStore().getProperty("dbprefix"));
  67 + if (!jCheckBox3.isSelected() && labeledTextChooser2.hasText()) {
  68 + LocalSettings.setProperty(LocalSettings.OFFICE_HOME, labeledTextChooser2.get_Text(true));
  69 + LocalSettings.setProperty(LocalSettings.OFFICE_USE, "true");
  70 + LocalSettings.setProperty(LocalSettings.OFFICE_REMOTE, "false");
  71 + } else if (labeledTextField1.getText().length() > 0 && labeledTextField2.getText().length() > 0) {
  72 + LocalSettings.setProperty(LocalSettings.OFFICE_HOST, labeledTextField1.getText());
  73 + LocalSettings.setProperty(LocalSettings.OFFICE_PORT, labeledTextField2.getText());
  74 + LocalSettings.setProperty(LocalSettings.OFFICE_USE, "true");
  75 + LocalSettings.setProperty(LocalSettings.OFFICE_REMOTE, "true");
  76 + } else {
  77 + LocalSettings.setProperty(LocalSettings.OFFICE_USE, "false");
278 78 }
279   - });
280   -
281   - jLabel4.setFont(new java.awt.Font("Dialog", 0, 12));
282   - jLabel4.setText(bundle.getString("wizard_DBSettings_1.jLabel4.text")); // NOI18N
283   - jLabel4.setName("jLabel4"); // NOI18N
284   -
285   - jButton1.setText(bundle.getString("wizard_DBSettings_1.jButton1.text")); // NOI18N
286   - jButton1.setName("jButton1"); // NOI18N
287   - jButton1.addActionListener(new java.awt.event.ActionListener() {
288   - public void actionPerformed(java.awt.event.ActionEvent evt) {
289   - jButton1ActionPerformed(evt);
  79 + if (jCheckBox2.isSelected()) {
  80 + LocalSettings.setProperty(LocalSettings.DBTYPE, "network");
  81 + } else {
  82 + LocalSettings.setProperty(LocalSettings.DBTYPE, "single");
290 83 }
291   - });
292   -
293   - labeledTextChooser1.set_Label(bundle.getString("wizard_DBSettings_1.labeledTextChooser1._Label")); // NOI18N
294   - labeledTextChooser1.setFocusCycleRoot(true);
295   - labeledTextChooser1.setFocusTraversalPolicyProvider(true);
296   - labeledTextChooser1.setName("labeledTextChooser1"); // NOI18N
297 84
298   - jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle.getString("wizard_DBSettings_1.jPanel5.border.title"))); // NOI18N
299   - jPanel5.setName("jPanel5"); // NOI18N
300   -
301   - restore.setText(bundle.getString("wizard_DBSettings_1.restore.text")); // NOI18N
302   - restore.setName("restore"); // NOI18N
303   - restore.addActionListener(new java.awt.event.ActionListener() {
304   - public void actionPerformed(java.awt.event.ActionEvent evt) {
305   - restoreActionPerformed(evt);
  85 + if (restore.isSelected()) {
  86 + master.setMessage(Messages.RESTORING_DATABASE.toString());
  87 + conn.setProgressbar(master.getProgressbar());
  88 + Log.Debug(this, "Running DB restore ...");
  89 + MigrationWB.instanceOf().doRestore(DumpURL.getText(), DumpName.getText(), backupDBName.getText(), conn, master);
  90 + LocalSettings.save(forConnId);
  91 + LocalSettings.apply();
  92 + } else if (conn.connect(master.getStore().getProperty("driver"),
  93 + master.getStore().getProperty("user"),
  94 + master.getStore().getProperty("password"),
  95 + master.getStore().getProperty("url"),
  96 + master.getStore().getProperty("dbname"),
  97 + master.getStore().getProperty("dbprefix"),
  98 + !existingData.isSelected())) {
  99 + Log.Debug(this, master.getStore().getProperty("url") + ": OK");
  100 + master.setMessage(Messages.CONNECTION_VERIFIED.toString());
  101 + LocalSettings.save(forConnId);
  102 + LocalSettings.apply();
  103 +
  104 + if (!existingData.isSelected()) {
  105 + master.setMessage(Messages.CREATING_DATABASE.toString());
  106 + conn.setProgressbar(master.getProgressbar());
  107 + Log.Debug(this, "Running DB install queries...");
  108 + if (conn.runQueries(new DatabaseInstallation().getStructure())
  109 + & conn.runQueries(new DatabaseInstallation().getInitialData())) {
  110 + try {
  111 + File f = new File(this.getClass().getResource("languages").toURI());
  112 + Log.Debug(this, "Importing languages from: " + f.getCanonicalPath());
  113 + File[] langfiles = f.listFiles();
  114 + for (int i = 0; i < langfiles.length; i++) {
  115 + File file = langfiles[i];
  116 + LanguageManager.importLanguage(file.getName(), file);
  117 + }
  118 + } catch (Exception uRISyntaxException) {
  119 + Log.Debug(this, uRISyntaxException.getMessage());
  120 + }
  121 +
  122 + try {
  123 + File f = new File(this.getClass().getResource("/mpv5/resources/extra/").toURI());
  124 + Log.Debug(this, "Importing coutries from: " + f.getCanonicalPath());
  125 + File[] langfiles = f.listFiles();
  126 + for (int i = 0; i < langfiles.length; i++) {
  127 + File file = langfiles[i];
  128 + LanguageManager.importCountries(file);
  129 + }
  130 + } catch (Exception uRISyntaxException) {
  131 + Log.Debug(this, uRISyntaxException.getMessage());
  132 + }
  133 + master.setMessage(Messages.CONNECTION_VERIFIED.toString());
  134 + } else {
  135 + LocalSettings.removeInstance(forConnId);
  136 + LocalSettings.save();
  137 + throw new Exception(Messages.CREATING_DATABASE_FAILED.toString());
  138 + }
  139 + }
  140 + master.isEnd(true);
  141 + } else {
  142 + LocalSettings.removeInstance(forConnId);
  143 + LocalSettings.save();
  144 + throw new Exception(Messages.CONNECTION_FAILED.toString());
306 145 }
307   - });
308   -
309   - DumpURL.setEditable(false);
310   - DumpURL.setText(bundle.getString("wizard_DBSettings_1.DumpURL.text")); // NOI18N
311   - DumpURL.setName("DumpURL"); // NOI18N
312 146
313   - jLabel5.setText(bundle.getString("wizard_DBSettings_1.jLabel5.text")); // NOI18N
314   - jLabel5.setName("jLabel5"); // NOI18N
315   -
316   - backupDBName.set_Label(bundle.getString("wizard_DBSettings_1.backupDBName._Label")); // NOI18N
317   - backupDBName.setEnabled(false);
318   - backupDBName.setName("backupDBName"); // NOI18N
319   -
320   - DumpURLBtn.setText(bundle.getString("wizard_DBSettings_1.DumpURLBtn.text")); // NOI18N
321   - DumpURLBtn.setEnabled(false);
322   - DumpURLBtn.setName("DumpURLBtn"); // NOI18N
323   - DumpURLBtn.addActionListener(new java.awt.event.ActionListener() {
324   - public void actionPerformed(java.awt.event.ActionEvent evt) {
325   - DumpURLBtnActionPerformed(evt);
  147 + } catch (Exception ex) {
  148 + master.setMessage(Messages.CONNECTION_FAILED.toString());
  149 + this.master.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
  150 + Log.Debug(ex);
  151 + if (Popup.Y_N_dialog(this, Messages.ERROR_OCCURED + "\n" + Messages.SEE_LOG + "?", Messages.CONNECTION_FAILED)) {
  152 + try {
  153 + Desktop.getDesktop().open(YConsole.getLogfile());
  154 + } catch (IOException ex1) {
  155 + Popup.error(ex1);
  156 + }
326 157 }
327   - });
328   -
329   - DumpName.set_Label(bundle.getString("wizard_DBSettings_1.DumpName._Label")); // NOI18N
330   - DumpName.setEnabled(false);
331   - DumpName.setName("DumpName"); // NOI18N
332   -
333   - javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
334   - jPanel5.setLayout(jPanel5Layout);
335   - jPanel5Layout.setHorizontalGroup(
336   - jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
337   - .addGroup(jPanel5Layout.createSequentialGroup()
338   - .addComponent(restore)
339   - .addContainerGap())
340   - .addGroup(jPanel5Layout.createSequentialGroup()
341   - .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
342   - .addContainerGap())
343   - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
344   - .addComponent(DumpURL, javax.swing.GroupLayout.DEFAULT_SIZE, 645, Short.MAX_VALUE)
345   - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
346   - .addComponent(DumpURLBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE))
347   - .addComponent(backupDBName, javax.swing.GroupLayout.DEFAULT_SIZE, 668, Short.MAX_VALUE)
348   - .addComponent(DumpName, javax.swing.GroupLayout.DEFAULT_SIZE, 668, Short.MAX_VALUE)
349   - );
350   - jPanel5Layout.setVerticalGroup(
351   - jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
352   - .addGroup(jPanel5Layout.createSequentialGroup()
353   - .addComponent(restore)
354   - .addGap(4, 4, 4)
355   - .addComponent(jLabel5)
356   - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
357   - .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
358   - .addComponent(DumpURL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
359   - .addComponent(DumpURLBtn))
360   - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
361   - .addComponent(backupDBName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
362   - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 9, Short.MAX_VALUE)
363   - .addComponent(DumpName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
364   - );
365   -
366   - javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
367   - jPanel2.setLayout(jPanel2Layout);
368   - jPanel2Layout.setHorizontalGroup(
369   - jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
370   - .addComponent(jPanel5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  158 + return false;
  159 + }
  160 + this.master.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
  161 + return true;
  162 + } else {
  163 + this.master.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
  164 + return false;
  165 + }
  166 + }
  167 +
  168 + private boolean DirectoryCreate() {
  169 + ////////////// The cache dir //////////////////////
  170 + LocalSettings.setProperty(LocalSettings.CACHE_DIR, Main.MPPATH + File.separator + "Cache");
  171 + LocalSettings.save(forConnId);
  172 + File file1 = new File(LocalSettings.getProperty(LocalSettings.CACHE_DIR));
  173 + file1.mkdirs();
  174 + ///////////////////////////////////////////////////////////
  175 +
  176 + return file1.exists();
  177 + }
  178 +
  179 + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  180 + private void initComponents() {
  181 +
  182 + jPanel2 = new javax.swing.JPanel();
  183 + jLabel1 = new javax.swing.JLabel();
  184 + jComboBox1 = new javax.swing.JComboBox();
  185 + labeledTextField3 = new mpv5.ui.beans.LabeledTextField();
  186 + existingData = new javax.swing.JCheckBox();
  187 + jLabel2 = new javax.swing.JLabel();
  188 + jCheckBox2 = new javax.swing.JCheckBox();
  189 + jPanel4 = new javax.swing.JPanel();
  190 + labeledTextField4 = new mpv5.ui.beans.LabeledTextField();
  191 + labeledTextField5 = new mpv5.ui.beans.LabeledTextField();
  192 + jButton2 = new javax.swing.JButton();
  193 + prefix = new mpv5.ui.beans.LabeledTextField();
  194 + jButton3 = new javax.swing.JButton();
  195 + jLabel4 = new javax.swing.JLabel();
  196 + jButton1 = new javax.swing.JButton();
  197 + labeledTextChooser1 = new mpv5.ui.beans.LabeledTextChooser();
  198 + jPanel5 = new javax.swing.JPanel();
  199 + restore = new javax.swing.JCheckBox();
  200 + DumpURL = new javax.swing.JTextField();
  201 + jLabel5 = new javax.swing.JLabel();
  202 + backupDBName = new mpv5.ui.beans.LabeledTextField();
  203 + DumpURLBtn = new javax.swing.JButton();
  204 + DumpName = new mpv5.ui.beans.LabeledTextField();
  205 + jPanel1 = new javax.swing.JPanel();
  206 + labeledTextChooser2 = new mpv5.ui.beans.LabeledTextChooser();
  207 + jCheckBox3 = new javax.swing.JCheckBox();
  208 + labeledTextField1 = new mpv5.ui.beans.LabeledTextField();
  209 + labeledTextField2 = new mpv5.ui.beans.LabeledTextField();
  210 + jLabel3 = new javax.swing.JLabel();
  211 +
  212 + setBackground(new java.awt.Color(255, 255, 255));
  213 + java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("mpv5/resources/languages/Panels"); // NOI18N
  214 + setBorder(javax.swing.BorderFactory.createTitledBorder(bundle.getString("wizard_DBSettings_1.border.title"))); // NOI18N
  215 + setName("Form"); // NOI18N
  216 + setLayout(new java.awt.BorderLayout());
  217 +
  218 + jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle.getString("wizard_DBSettings_1.jPanel2.border.title"))); // NOI18N
  219 + jPanel2.setName("jPanel2"); // NOI18N
  220 +
  221 + jLabel1.setText(bundle.getString("wizard_DBSettings_1.jLabel1.text")); // NOI18N
  222 + jLabel1.setName("jLabel1"); // NOI18N
  223 +
  224 + jComboBox1.setEditable(true);
  225 + jComboBox1.setFont(new java.awt.Font("Dialog", 0, 11)); // NOI18N
  226 + jComboBox1.setName("jComboBox1"); // NOI18N
  227 + jComboBox1.addActionListener(new java.awt.event.ActionListener() {
  228 + public void actionPerformed(java.awt.event.ActionEvent evt) {
  229 + jComboBox1ActionPerformed(evt);
  230 + }
  231 + });
  232 +
  233 + labeledTextField3.set_Label(bundle.getString("wizard_DBSettings_1.labeledTextField3._Label")); // NOI18N
  234 + labeledTextField3.setName("labeledTextField3"); // NOI18N
  235 +
  236 + existingData.setText(bundle.getString("wizard_DBSettings_1.existingData.text")); // NOI18N
  237 + existingData.setName("existingData"); // NOI18N
  238 +
  239 + jLabel2.setText(bundle.getString("wizard_DBSettings_1.jLabel2.text")); // NOI18N
  240 + jLabel2.setName("jLabel2"); // NOI18N
  241 +
  242 + jCheckBox2.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
  243 + jCheckBox2.setText(bundle.getString("wizard_DBSettings_1.jCheckBox2.text")); // NOI18N
  244 + jCheckBox2.setName("jCheckBox2"); // NOI18N
  245 +
  246 + jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle.getString("wizard_DBSettings_1.jPanel4.border.title"))); // NOI18N
  247 + jPanel4.setName("jPanel4"); // NOI18N
  248 +
  249 + labeledTextField4.set_Label(bundle.getString("wizard_DBSettings_1.labeledTextField4._Label")); // NOI18N
  250 + labeledTextField4.setEnabled(false);
  251 + labeledTextField4.setName("labeledTextField4"); // NOI18N
  252 + jPanel4.add(labeledTextField4);
  253 +
  254 + labeledTextField5.set_Label(bundle.getString("wizard_DBSettings_1.labeledTextField5._Label")); // NOI18N
  255 + labeledTextField5.setEnabled(false);
  256 + labeledTextField5.setName("labeledTextField5"); // NOI18N
  257 + jPanel4.add(labeledTextField5);
  258 +
  259 + jButton2.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
  260 + jButton2.setText(bundle.getString("wizard_DBSettings_1.jButton2.text")); // NOI18N
  261 + jButton2.setName("jButton2"); // NOI18N
  262 + jButton2.addActionListener(new java.awt.event.ActionListener() {
  263 + public void actionPerformed(java.awt.event.ActionEvent evt) {
  264 + jButton2ActionPerformed(evt);
  265 + }
  266 + });
  267 + jPanel4.add(jButton2);
  268 +
  269 + prefix.set_Label(bundle.getString("wizard_DBSettings_1.prefix._Label")); // NOI18N
  270 + prefix.setEnabled(false);
  271 + prefix.setName("prefix"); // NOI18N
  272 +
  273 + jButton3.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
  274 + jButton3.setText(bundle.getString("wizard_DBSettings_1.jButton3.text")); // NOI18N
  275 + jButton3.setName("jButton3"); // NOI18N
  276 + jButton3.addActionListener(new java.awt.event.ActionListener() {
  277 + public void actionPerformed(java.awt.event.ActionEvent evt) {
  278 + jButton3ActionPerformed(evt);
  279 + }
  280 + });
  281 +
  282 + jLabel4.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
  283 + jLabel4.setText(bundle.getString("wizard_DBSettings_1.jLabel4.text")); // NOI18N
  284 + jLabel4.setName("jLabel4"); // NOI18N
  285 +
  286 + jButton1.setText(bundle.getString("wizard_DBSettings_1.jButton1.text")); // NOI18N
  287 + jButton1.setName("jButton1"); // NOI18N
  288 + jButton1.addActionListener(new java.awt.event.ActionListener() {
  289 + public void actionPerformed(java.awt.event.ActionEvent evt) {
  290 + jButton1ActionPerformed(evt);
  291 + }
  292 + });
  293 +
  294 + labeledTextChooser1.set_Label(bundle.getString("wizard_DBSettings_1.labeledTextChooser1._Label")); // NOI18N
  295 + labeledTextChooser1.setFocusCycleRoot(true);
  296 + labeledTextChooser1.setFocusTraversalPolicyProvider(true);
  297 + labeledTextChooser1.setName("labeledTextChooser1"); // NOI18N
  298 +
  299 + jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle.getString("wizard_DBSettings_1.jPanel5.border.title"))); // NOI18N
  300 + jPanel5.setName("jPanel5"); // NOI18N
  301 +
  302 + restore.setText(bundle.getString("wizard_DBSettings_1.restore.text")); // NOI18N
  303 + restore.setName("restore"); // NOI18N