public void exportTables(String outPath) { ArrayList<String> tables = new ArrayList<String>(); for (int i : frame.jTableDBList.getSelectedRows()) { tables.add(frame.jTableDBList.getValueAt(i, 0).toString()); } new HandlerMainQuery().exportTable(tables, propConn, outPath); createSqlUninstaller(tables, outPath + File.separator + SharedDefines.getSqlUninstFileName()); MyXML outXml = new MyXML(outPath + MyCommonMethods.getFullFileName(xmlPath)); Element parent = outXml.writeElement("install", "", null, null, true); parent = outXml.writeElement("sql", "", null, parent, true); ArrayList<Attribute> attributes = new ArrayList<Attribute>(); attributes.add(new Attribute("charset", "utf8")); attributes.add(new Attribute("driver", "mysql")); outXml.writeElement("file", "install_mod.sql", attributes, parent, true); attributes = new ArrayList<Attribute>(); attributes.add(new Attribute("driver", "mysql")); outXml.writeElement("file", SharedDefines.getSqlInstFileName(), attributes, parent, true); parent = outXml.writeElement("uninstall", "", null, null, true); parent = outXml.writeElement("sql", "", null, parent, true); attributes = new ArrayList<Attribute>(); attributes.add(new Attribute("charset", "utf8")); attributes.add(new Attribute("driver", "mysql")); outXml.writeElement("file", "uninstall_mod.sql", attributes, parent, true); attributes = new ArrayList<Attribute>(); attributes.add(new Attribute("driver", "mysql")); outXml.writeElement("file", SharedDefines.getSqlUninstFileName(), attributes, parent, true); }
public void export(String xmlPath, String outPath, boolean isZip) { String adminPath = rootPath + sep + "administrator" + sep; String outFolder = outPath + sep + MyCommonMethods.getFileName(xmlPath, "."); // copy the xml also to create the path MyCommonMethods.deleteDir(outFolder + sep, null); MyCommonMethods.copyFileOrFolder( xmlPath, outFolder + sep + MyCommonMethods.getFullFileName(xmlPath), ""); if ((new File(outFolder)).exists()) { if (extClient != null) { if (extClient.equalsIgnoreCase("administrator")) { processXml(adminPath, outFolder + sep, true); } else { processXml(rootPath + sep, outFolder + sep, false); } } else { processXml(adminPath, outFolder + sep, true); processXml(rootPath + sep, outFolder + sep, false); } } // XXX to speed up exportTables(outFolder + sep); if (isZip) { MyCommonMethods.zipFolder(outFolder, outFolder + ".zip"); MyCommonMethods.deleteDir(outFolder, null); } }