bugs fixed for sample operations to manage database mysql.
logger gwt added in gwt.xml file git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/databases-manager-portlet@98520 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
850d3ecda9
commit
a1a86b007c
|
@ -12,16 +12,16 @@ public class FileModel extends BaseModelData implements Serializable {
|
|||
private static int ID = 0;
|
||||
// private int id;
|
||||
private boolean isExpanded = true;
|
||||
// private boolean isSchema = false;
|
||||
// private boolean isSchema = false;
|
||||
private boolean isLoaded = false;
|
||||
// private boolean isTable = false;
|
||||
private boolean isDatabase = false;
|
||||
|
||||
|
||||
private List<Result> DBInfo = null;
|
||||
private boolean isDBInfoDisplayed = false;
|
||||
private List<Result> TableDetails = null;
|
||||
private boolean isTableDetailsDisplayed = false;
|
||||
private String DatabaseType;
|
||||
|
||||
public FileModel() {
|
||||
setId();
|
||||
|
@ -110,11 +110,11 @@ public class FileModel extends BaseModelData implements Serializable {
|
|||
public List<Result> getDBInfo() {
|
||||
return DBInfo;
|
||||
}
|
||||
|
||||
|
||||
public void setTableDetails(List<Result> data) {
|
||||
TableDetails = data;
|
||||
}
|
||||
|
||||
|
||||
public List<Result> getTableDetails() {
|
||||
return TableDetails;
|
||||
}
|
||||
|
@ -126,15 +126,25 @@ public class FileModel extends BaseModelData implements Serializable {
|
|||
public boolean isDBInfoDisplayed() {
|
||||
return isDBInfoDisplayed;
|
||||
}
|
||||
|
||||
|
||||
public void setTableDetailsDisplayed(boolean value) {
|
||||
isTableDetailsDisplayed = value;
|
||||
}
|
||||
|
||||
|
||||
public boolean isTableDetailsDisplayed() {
|
||||
return isTableDetailsDisplayed;
|
||||
}
|
||||
|
||||
public void setDatabaseType(String value) {
|
||||
|
||||
DatabaseType = value;
|
||||
}
|
||||
|
||||
public String getDatabaseType() {
|
||||
|
||||
return this.DatabaseType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj != null && obj instanceof FileModel) {
|
||||
|
|
|
@ -567,7 +567,7 @@ public class GxtBorderLayoutPanel extends ContentPanel {
|
|||
// the selected item is a table
|
||||
FileModel selectedItem = data.get(0);
|
||||
|
||||
rootLogger.log(Level.INFO, "the selected table is: " + selectedItem);
|
||||
rootLogger.log(Level.INFO, "the selected table is: " + selectedItem.getName());
|
||||
|
||||
// recover data inputs
|
||||
|
||||
|
@ -578,7 +578,40 @@ public class GxtBorderLayoutPanel extends ContentPanel {
|
|||
FileModel database;
|
||||
FileModel resource;
|
||||
|
||||
if (treePanel.getTreeStore().getParent(selectedItem).isSchema()) {
|
||||
if (treePanel.getTreeStore().getParent(selectedItem).isDatabase()) {
|
||||
|
||||
// the table has not a schema
|
||||
|
||||
database = treePanel.getTreeStore().getParent(selectedItem);
|
||||
resource = treePanel.getTreeStore().getParent(database);
|
||||
|
||||
dataInput.put("ResourceName", resource.getName());
|
||||
dataInput.put("DatabaseName", database.getName());
|
||||
dataInput.put("SchemaName", "");
|
||||
dataInput.put("TableName", selectedItem.getName());
|
||||
|
||||
rootLogger.log(Level.INFO, "ResourceName: " + resource.getName());
|
||||
rootLogger.log(Level.INFO, "DatabaseName: " + database.getName());
|
||||
rootLogger.log(Level.INFO, "SchemaName: " + "");
|
||||
rootLogger.log(Level.INFO, "SchemaName: " + selectedItem.getName());
|
||||
|
||||
// schema = treePanel.getTreeStore().getParent(selectedItem);
|
||||
// database = treePanel.getTreeStore().getParent(schema);
|
||||
// resource = treePanel.getTreeStore().getParent(database);
|
||||
//
|
||||
// dataInput.put("ResourceName", resource.getName());
|
||||
// dataInput.put("DatabaseName", database.getName());
|
||||
// dataInput.put("SchemaName", schema.getName());
|
||||
// dataInput.put("TableName", selectedItem.getName());
|
||||
//
|
||||
// rootLogger.log(Level.INFO, "ResourceName: " + resource.getName());
|
||||
// rootLogger.log(Level.INFO, "DatabaseName: " + database.getName());
|
||||
// rootLogger.log(Level.INFO, "SchemaName: " + schema.getName());
|
||||
// rootLogger.log(Level.INFO, "SchemaName: " + selectedItem.getName());
|
||||
|
||||
} else {
|
||||
//the table has a schema
|
||||
|
||||
schema = treePanel.getTreeStore().getParent(selectedItem);
|
||||
database = treePanel.getTreeStore().getParent(schema);
|
||||
resource = treePanel.getTreeStore().getParent(database);
|
||||
|
@ -592,21 +625,20 @@ public class GxtBorderLayoutPanel extends ContentPanel {
|
|||
rootLogger.log(Level.INFO, "DatabaseName: " + database.getName());
|
||||
rootLogger.log(Level.INFO, "SchemaName: " + schema.getName());
|
||||
rootLogger.log(Level.INFO, "SchemaName: " + selectedItem.getName());
|
||||
|
||||
} else {
|
||||
|
||||
// the table has not a schema
|
||||
database = treePanel.getTreeStore().getParent(selectedItem);
|
||||
resource = treePanel.getTreeStore().getParent(database);
|
||||
|
||||
dataInput.put("ResourceName", resource.getName());
|
||||
dataInput.put("DatabaseName", database.getName());
|
||||
dataInput.put("SchemaName", "");
|
||||
dataInput.put("TableName", selectedItem.getName());
|
||||
|
||||
rootLogger.log(Level.INFO, "ResourceName: " + resource.getName());
|
||||
rootLogger.log(Level.INFO, "DatabaseName: " + database.getName());
|
||||
rootLogger.log(Level.INFO, "SchemaName: " + "");
|
||||
rootLogger.log(Level.INFO, "SchemaName: " + selectedItem.getName());
|
||||
// database = treePanel.getTreeStore().getParent(selectedItem);
|
||||
// resource = treePanel.getTreeStore().getParent(database);
|
||||
//
|
||||
// dataInput.put("ResourceName", resource.getName());
|
||||
// dataInput.put("DatabaseName", database.getName());
|
||||
// dataInput.put("SchemaName", "");
|
||||
// dataInput.put("TableName", selectedItem.getName());
|
||||
//
|
||||
// rootLogger.log(Level.INFO, "ResourceName: " + resource.getName());
|
||||
// rootLogger.log(Level.INFO, "DatabaseName: " + database.getName());
|
||||
// rootLogger.log(Level.INFO, "SchemaName: " + "");
|
||||
// rootLogger.log(Level.INFO, "SchemaName: " + selectedItem.getName());
|
||||
}
|
||||
|
||||
// call remote service
|
||||
|
@ -680,7 +712,40 @@ public class GxtBorderLayoutPanel extends ContentPanel {
|
|||
FileModel database;
|
||||
FileModel resource;
|
||||
|
||||
if (treePanel.getTreeStore().getParent(selectedItem).isSchema()) {
|
||||
if (treePanel.getTreeStore().getParent(selectedItem).isDatabase()) { //the table has not a schema
|
||||
|
||||
database = treePanel.getTreeStore().getParent(selectedItem);
|
||||
resource = treePanel.getTreeStore().getParent(database);
|
||||
|
||||
dataInput.put("ResourceName", resource.getName());
|
||||
dataInput.put("DatabaseName", database.getName());
|
||||
dataInput.put("SchemaName", "");
|
||||
dataInput.put("TableName", selectedItem.getName());
|
||||
|
||||
rootLogger.log(Level.INFO, "ResourceName: " + resource.getName());
|
||||
rootLogger.log(Level.INFO, "DatabaseName: " + database.getName());
|
||||
rootLogger.log(Level.INFO, "SchemaName: " + "");
|
||||
rootLogger.log(Level.INFO, "SchemaName: " + selectedItem.getName());
|
||||
|
||||
|
||||
// schema = treePanel.getTreeStore().getParent(selectedItem);
|
||||
// database = treePanel.getTreeStore().getParent(schema);
|
||||
// resource = treePanel.getTreeStore().getParent(database);
|
||||
//
|
||||
// dataInput.put("ResourceName", resource.getName());
|
||||
// dataInput.put("DatabaseName", database.getName());
|
||||
// dataInput.put("SchemaName", schema.getName());
|
||||
// dataInput.put("TableName", selectedItem.getName());
|
||||
//
|
||||
// rootLogger.log(Level.INFO, "ResourceName: " + resource.getName());
|
||||
// rootLogger.log(Level.INFO, "DatabaseName: " + database.getName());
|
||||
// rootLogger.log(Level.INFO, "SchemaName: " + schema.getName());
|
||||
// rootLogger.log(Level.INFO, "SchemaName: " + selectedItem.getName());
|
||||
|
||||
} else {
|
||||
// the table has a schema
|
||||
|
||||
|
||||
schema = treePanel.getTreeStore().getParent(selectedItem);
|
||||
database = treePanel.getTreeStore().getParent(schema);
|
||||
resource = treePanel.getTreeStore().getParent(database);
|
||||
|
@ -694,21 +759,19 @@ public class GxtBorderLayoutPanel extends ContentPanel {
|
|||
rootLogger.log(Level.INFO, "DatabaseName: " + database.getName());
|
||||
rootLogger.log(Level.INFO, "SchemaName: " + schema.getName());
|
||||
rootLogger.log(Level.INFO, "SchemaName: " + selectedItem.getName());
|
||||
|
||||
} else {
|
||||
// the table has not a schema
|
||||
database = treePanel.getTreeStore().getParent(selectedItem);
|
||||
resource = treePanel.getTreeStore().getParent(database);
|
||||
|
||||
dataInput.put("ResourceName", resource.getName());
|
||||
dataInput.put("DatabaseName", database.getName());
|
||||
dataInput.put("SchemaName", "");
|
||||
dataInput.put("TableName", selectedItem.getName());
|
||||
|
||||
rootLogger.log(Level.INFO, "ResourceName: " + resource.getName());
|
||||
rootLogger.log(Level.INFO, "DatabaseName: " + database.getName());
|
||||
rootLogger.log(Level.INFO, "SchemaName: " + "");
|
||||
rootLogger.log(Level.INFO, "SchemaName: " + selectedItem.getName());
|
||||
|
||||
// database = treePanel.getTreeStore().getParent(selectedItem);
|
||||
// resource = treePanel.getTreeStore().getParent(database);
|
||||
//
|
||||
// dataInput.put("ResourceName", resource.getName());
|
||||
// dataInput.put("DatabaseName", database.getName());
|
||||
// dataInput.put("SchemaName", "");
|
||||
// dataInput.put("TableName", selectedItem.getName());
|
||||
//
|
||||
// rootLogger.log(Level.INFO, "ResourceName: " + resource.getName());
|
||||
// rootLogger.log(Level.INFO, "DatabaseName: " + database.getName());
|
||||
// rootLogger.log(Level.INFO, "SchemaName: " + "");
|
||||
// rootLogger.log(Level.INFO, "SchemaName: " + selectedItem.getName());
|
||||
}
|
||||
|
||||
// call remote service
|
||||
|
@ -781,7 +844,39 @@ public class GxtBorderLayoutPanel extends ContentPanel {
|
|||
FileModel database;
|
||||
FileModel resource;
|
||||
|
||||
if (treePanel.getTreeStore().getParent(selectedItem).isSchema()) {
|
||||
if (treePanel.getTreeStore().getParent(selectedItem).isDatabase()) { //the has not a schema
|
||||
|
||||
database = treePanel.getTreeStore().getParent(selectedItem);
|
||||
resource = treePanel.getTreeStore().getParent(database);
|
||||
|
||||
dataInput.put("ResourceName", resource.getName());
|
||||
dataInput.put("DatabaseName", database.getName());
|
||||
dataInput.put("SchemaName", "");
|
||||
dataInput.put("TableName", selectedItem.getName());
|
||||
|
||||
rootLogger.log(Level.INFO, "ResourceName: " + resource.getName());
|
||||
rootLogger.log(Level.INFO, "DatabaseName: " + database.getName());
|
||||
rootLogger.log(Level.INFO, "SchemaName: " + "");
|
||||
rootLogger.log(Level.INFO, "SchemaName: " + selectedItem.getName());
|
||||
|
||||
// schema = treePanel.getTreeStore().getParent(selectedItem);
|
||||
// database = treePanel.getTreeStore().getParent(schema);
|
||||
// resource = treePanel.getTreeStore().getParent(database);
|
||||
//
|
||||
// dataInput.put("ResourceName", resource.getName());
|
||||
// dataInput.put("DatabaseName", database.getName());
|
||||
// dataInput.put("SchemaName", schema.getName());
|
||||
// dataInput.put("TableName", selectedItem.getName());
|
||||
//
|
||||
// rootLogger.log(Level.INFO, "ResourceName: " + resource.getName());
|
||||
// rootLogger.log(Level.INFO, "DatabaseName: " + database.getName());
|
||||
// rootLogger.log(Level.INFO, "SchemaName: " + schema.getName());
|
||||
// rootLogger.log(Level.INFO, "SchemaName: " + selectedItem.getName());
|
||||
|
||||
} else {
|
||||
|
||||
//the table has a schema
|
||||
|
||||
schema = treePanel.getTreeStore().getParent(selectedItem);
|
||||
database = treePanel.getTreeStore().getParent(schema);
|
||||
resource = treePanel.getTreeStore().getParent(database);
|
||||
|
@ -795,21 +890,21 @@ public class GxtBorderLayoutPanel extends ContentPanel {
|
|||
rootLogger.log(Level.INFO, "DatabaseName: " + database.getName());
|
||||
rootLogger.log(Level.INFO, "SchemaName: " + schema.getName());
|
||||
rootLogger.log(Level.INFO, "SchemaName: " + selectedItem.getName());
|
||||
|
||||
} else {
|
||||
// the table has not a schema
|
||||
database = treePanel.getTreeStore().getParent(selectedItem);
|
||||
resource = treePanel.getTreeStore().getParent(database);
|
||||
|
||||
dataInput.put("ResourceName", resource.getName());
|
||||
dataInput.put("DatabaseName", database.getName());
|
||||
dataInput.put("SchemaName", "");
|
||||
dataInput.put("TableName", selectedItem.getName());
|
||||
|
||||
rootLogger.log(Level.INFO, "ResourceName: " + resource.getName());
|
||||
rootLogger.log(Level.INFO, "DatabaseName: " + database.getName());
|
||||
rootLogger.log(Level.INFO, "SchemaName: " + "");
|
||||
rootLogger.log(Level.INFO, "SchemaName: " + selectedItem.getName());
|
||||
|
||||
|
||||
// // the table has not a schema
|
||||
// database = treePanel.getTreeStore().getParent(selectedItem);
|
||||
// resource = treePanel.getTreeStore().getParent(database);
|
||||
//
|
||||
// dataInput.put("ResourceName", resource.getName());
|
||||
// dataInput.put("DatabaseName", database.getName());
|
||||
// dataInput.put("SchemaName", "");
|
||||
// dataInput.put("TableName", selectedItem.getName());
|
||||
//
|
||||
// rootLogger.log(Level.INFO, "ResourceName: " + resource.getName());
|
||||
// rootLogger.log(Level.INFO, "DatabaseName: " + database.getName());
|
||||
// rootLogger.log(Level.INFO, "SchemaName: " + "");
|
||||
// rootLogger.log(Level.INFO, "SchemaName: " + selectedItem.getName());
|
||||
}
|
||||
|
||||
// call remote service
|
||||
|
@ -1160,6 +1255,9 @@ public class GxtBorderLayoutPanel extends ContentPanel {
|
|||
// to mask the entire content panel
|
||||
|
||||
this.mask("Loading", "x-mask-loading");
|
||||
|
||||
// to unmask the entire content panel
|
||||
final GxtBorderLayoutPanel obj = this;
|
||||
|
||||
// System.out.println("Start RPC - submitQuery");
|
||||
|
||||
|
@ -1185,7 +1283,40 @@ public class GxtBorderLayoutPanel extends ContentPanel {
|
|||
FileModel database;
|
||||
FileModel resource;
|
||||
|
||||
if (treePanel.getTreeStore().getParent(selectedTable).isSchema()) {
|
||||
if (treePanel.getTreeStore().getParent(selectedTable).isDatabase()) { //the table has not a schema
|
||||
|
||||
database = treePanel.getTreeStore().getParent(selectedTable);
|
||||
resource = treePanel.getTreeStore().getParent(database);
|
||||
|
||||
dataInput.put("ResourceName", resource.getName());
|
||||
dataInput.put("DatabaseName", database.getName());
|
||||
dataInput.put("SchemaName", "");
|
||||
dataInput.put("TableName", selectedTable.getName());
|
||||
|
||||
rootLogger.log(Level.INFO, "ResourceName: " + resource.getName());
|
||||
rootLogger.log(Level.INFO, "DatabaseName: " + database.getName());
|
||||
rootLogger.log(Level.INFO, "SchemaName: " + "");
|
||||
rootLogger
|
||||
.log(Level.INFO, "SchemaName: " + selectedTable.getName());
|
||||
|
||||
// schema = treePanel.getTreeStore().getParent(selectedTable);
|
||||
// database = treePanel.getTreeStore().getParent(schema);
|
||||
// resource = treePanel.getTreeStore().getParent(database);
|
||||
//
|
||||
// dataInput.put("ResourceName", resource.getName());
|
||||
// dataInput.put("DatabaseName", database.getName());
|
||||
// dataInput.put("SchemaName", schema.getName());
|
||||
// dataInput.put("TableName", selectedTable.getName());
|
||||
//
|
||||
// rootLogger.log(Level.INFO, "ResourceName: " + resource.getName());
|
||||
// rootLogger.log(Level.INFO, "DatabaseName: " + database.getName());
|
||||
// rootLogger.log(Level.INFO, "SchemaName: " + schema.getName());
|
||||
// rootLogger
|
||||
// .log(Level.INFO, "SchemaName: " + selectedTable.getName());
|
||||
|
||||
} else {
|
||||
// the table has a schema
|
||||
|
||||
schema = treePanel.getTreeStore().getParent(selectedTable);
|
||||
database = treePanel.getTreeStore().getParent(schema);
|
||||
resource = treePanel.getTreeStore().getParent(database);
|
||||
|
@ -1200,22 +1331,21 @@ public class GxtBorderLayoutPanel extends ContentPanel {
|
|||
rootLogger.log(Level.INFO, "SchemaName: " + schema.getName());
|
||||
rootLogger
|
||||
.log(Level.INFO, "SchemaName: " + selectedTable.getName());
|
||||
|
||||
} else {
|
||||
// the table has not a schema
|
||||
database = treePanel.getTreeStore().getParent(selectedTable);
|
||||
resource = treePanel.getTreeStore().getParent(database);
|
||||
|
||||
dataInput.put("ResourceName", resource.getName());
|
||||
dataInput.put("DatabaseName", database.getName());
|
||||
dataInput.put("SchemaName", "");
|
||||
dataInput.put("TableName", selectedTable.getName());
|
||||
|
||||
rootLogger.log(Level.INFO, "ResourceName: " + resource.getName());
|
||||
rootLogger.log(Level.INFO, "DatabaseName: " + database.getName());
|
||||
rootLogger.log(Level.INFO, "SchemaName: " + "");
|
||||
rootLogger
|
||||
.log(Level.INFO, "SchemaName: " + selectedTable.getName());
|
||||
|
||||
|
||||
// database = treePanel.getTreeStore().getParent(selectedTable);
|
||||
// resource = treePanel.getTreeStore().getParent(database);
|
||||
//
|
||||
// dataInput.put("ResourceName", resource.getName());
|
||||
// dataInput.put("DatabaseName", database.getName());
|
||||
// dataInput.put("SchemaName", "");
|
||||
// dataInput.put("TableName", selectedTable.getName());
|
||||
//
|
||||
// rootLogger.log(Level.INFO, "ResourceName: " + resource.getName());
|
||||
// rootLogger.log(Level.INFO, "DatabaseName: " + database.getName());
|
||||
// rootLogger.log(Level.INFO, "SchemaName: " + "");
|
||||
// rootLogger
|
||||
// .log(Level.INFO, "SchemaName: " + selectedTable.getName());
|
||||
}
|
||||
|
||||
if (selectedTable.isTableDetailsDisplayed()) {
|
||||
|
@ -1237,6 +1367,10 @@ public class GxtBorderLayoutPanel extends ContentPanel {
|
|||
|
||||
MessageBox.alert("Error ",
|
||||
"<br/>Message:" + caught.getMessage(), null);
|
||||
|
||||
if (obj.isMasked()) {
|
||||
obj.unmask();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -11,22 +11,14 @@ import org.gcube.portlets.user.databasesmanager.client.GWTdbManagerServiceAsync;
|
|||
import org.gcube.portlets.user.databasesmanager.client.datamodel.FileModel;
|
||||
import org.gcube.portlets.user.databasesmanager.client.datamodel.Result;
|
||||
import org.gcube.portlets.user.databasesmanager.client.events.SelectedItemEvent;
|
||||
|
||||
//import org.gcube.portlets.user.dbmanager.client.GWTdbManagerServiceAsync;
|
||||
//import org.gcube.portlets.user.dbmanager.client.datamodel.FileModel;
|
||||
//import org.gcube.portlets.user.dbmanager.client.datamodel.Result;
|
||||
//import org.gcube.portlets.user.dbmanager.client.events.SelectedItemEvent;
|
||||
|
||||
import org.gcube.portlets.user.databasesmanager.client.utils.ConstantsPortlet;
|
||||
import com.extjs.gxt.ui.client.Style.SelectionMode;
|
||||
import com.extjs.gxt.ui.client.event.ComponentEvent;
|
||||
import com.extjs.gxt.ui.client.event.EventType;
|
||||
import com.extjs.gxt.ui.client.event.Listener;
|
||||
import com.extjs.gxt.ui.client.event.MessageBoxEvent;
|
||||
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
|
||||
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
|
||||
import com.extjs.gxt.ui.client.event.TreePanelEvent;
|
||||
import com.extjs.gxt.ui.client.store.TreeStore;
|
||||
import com.extjs.gxt.ui.client.widget.Dialog;
|
||||
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
||||
import com.extjs.gxt.ui.client.widget.MessageBox;
|
||||
import com.extjs.gxt.ui.client.widget.layout.FlowData;
|
||||
|
@ -34,14 +26,17 @@ import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
|
|||
import com.extjs.gxt.ui.client.widget.treepanel.TreePanel;
|
||||
import com.google.gwt.event.shared.HandlerManager;
|
||||
import com.google.gwt.user.client.Event;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
|
||||
//class that implements the tree object
|
||||
|
||||
public class GxtTreePanel extends LayoutContainer {
|
||||
|
||||
//to manage the tree
|
||||
private TreeStore<FileModel> store;
|
||||
private TreePanel<FileModel> treePanel;
|
||||
|
||||
//to manage events
|
||||
private HandlerManager eventBus = null;
|
||||
|
||||
private String value = "";
|
||||
|
@ -49,6 +44,7 @@ public class GxtTreePanel extends LayoutContainer {
|
|||
private boolean SelectedItemIsSchema = false;
|
||||
private GWTdbManagerServiceAsync RPCservice = null;
|
||||
|
||||
//to keep track of innformation associated to a database
|
||||
private LinkedHashMap<String, FileModel> dataDBInfo = null;
|
||||
|
||||
private String ResourceNameSelected;
|
||||
|
@ -204,9 +200,9 @@ public class GxtTreePanel extends LayoutContainer {
|
|||
// check to make the RPC call once
|
||||
if ((numChildrenFolder == 0)
|
||||
&& (data.get(0).isLoaded() != true)) {
|
||||
|
||||
|
||||
treePanel.mask("Loading", "x-mask-loading");
|
||||
// selectedItem.setIsSchema(false);
|
||||
// selectedItem.setIsSchema(false);
|
||||
|
||||
switch (treeDepthSelectedItem) {
|
||||
// case 1:
|
||||
|
@ -215,24 +211,31 @@ public class GxtTreePanel extends LayoutContainer {
|
|||
// break;
|
||||
|
||||
case 2:
|
||||
// selectedItem.setIsSchema(false);
|
||||
// selectedItem.setIsSchema(false);
|
||||
loadDBInfo(data.get(0));
|
||||
break;
|
||||
|
||||
case 3:
|
||||
// selectedItem.setIsSchema(false);
|
||||
loadSchema(data.get(0));
|
||||
if (selectedItem.getDatabaseType().equals(
|
||||
ConstantsPortlet.POSTGRES)) {
|
||||
// selectedItem.setIsSchema(false);
|
||||
loadSchema(data.get(0));
|
||||
} else {
|
||||
// System.out.println("database mysql: " + data.get(0).getName() + data.get(0).getDatabaseType());
|
||||
|
||||
loadTables(data.get(0));
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
// selectedItem.setIsSchema(false);
|
||||
// selectedItem.setIsSchema(false);
|
||||
loadTables(data.get(0));
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
else{
|
||||
|
||||
else {
|
||||
setInfoOnSelectedItem(data.get(0));
|
||||
}
|
||||
|
||||
|
@ -407,6 +410,8 @@ public class GxtTreePanel extends LayoutContainer {
|
|||
int j = 0;
|
||||
for (i = 0; i < numIterations; i++) {
|
||||
|
||||
String DatabaseType = null;
|
||||
|
||||
// System.out.println("index i: " + i);
|
||||
|
||||
String DBName = null;
|
||||
|
@ -445,8 +450,24 @@ public class GxtTreePanel extends LayoutContainer {
|
|||
Result row = new Result("Driver Name",
|
||||
result.get(array[j].toString())
|
||||
.getName());
|
||||
|
||||
String driver = result.get(
|
||||
array[j].toString()).getName();
|
||||
DBInfo.add(row);
|
||||
|
||||
if (driver.toUpperCase().contains(
|
||||
ConstantsPortlet.POSTGRES)) {
|
||||
|
||||
DatabaseType = ConstantsPortlet.POSTGRES;
|
||||
|
||||
}
|
||||
|
||||
if (driver.toUpperCase().contains(
|
||||
ConstantsPortlet.MYSQL)) {
|
||||
|
||||
DatabaseType = ConstantsPortlet.MYSQL;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (array[j].toString().contains(
|
||||
|
@ -477,6 +498,11 @@ public class GxtTreePanel extends LayoutContainer {
|
|||
child.setIsDatabase(true);
|
||||
|
||||
child.setDBInfo(DBInfo);
|
||||
|
||||
//check print
|
||||
// rootLogger.log(Level.INFO, "DatabaseType: " + DatabaseType);
|
||||
|
||||
child.setDatabaseType(DatabaseType);
|
||||
|
||||
children.add(child);
|
||||
|
||||
|
@ -555,8 +581,6 @@ public class GxtTreePanel extends LayoutContainer {
|
|||
@Override
|
||||
public void onSuccess(List<FileModel> result) {
|
||||
|
||||
|
||||
|
||||
// System.out.println("SUCCESS");
|
||||
|
||||
// rootLogger.log(Level.SEVERE,
|
||||
|
@ -566,12 +590,14 @@ public class GxtTreePanel extends LayoutContainer {
|
|||
|
||||
if (result.size() == 0) { // the database has not schema
|
||||
|
||||
// element.setIsSchema(false);
|
||||
// element.setIsLoaded(false);
|
||||
loadTables(element);
|
||||
// element.setIsSchema(false);
|
||||
// element.setIsLoaded(false);
|
||||
// loadTables(element);
|
||||
|
||||
rootLogger.log(Level.INFO, "the database has not schema");
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
if (treePanel.isMasked())
|
||||
treePanel.unmask();
|
||||
|
||||
|
@ -616,65 +642,114 @@ public class GxtTreePanel extends LayoutContainer {
|
|||
LinkedHashMap<String, String> dataInput = new LinkedHashMap<String, String>();
|
||||
|
||||
// check if the element is a schema or a database
|
||||
|
||||
// System.out.println("element is a schema: " + element.isSchema());
|
||||
//
|
||||
// if (element.isSchema()) {
|
||||
//
|
||||
// System.out.println("element is a schema: " + element.isSchema());
|
||||
//
|
||||
// FileModel database = store.getParent(element);
|
||||
// FileModel resource = store.getParent(database);
|
||||
//
|
||||
// dataInput.put("ResourceName", resource.getName());
|
||||
// dataInput.put("DatabaseName", database.getName());
|
||||
// dataInput.put("SchemaName", element.getName());
|
||||
//
|
||||
// System.out.println("schema name: " + element.getName());
|
||||
//
|
||||
// rootLogger.log(Level.INFO, "ResourceName: " + resource.getName());
|
||||
// rootLogger.log(Level.INFO, "DatabaseName: " + database.getName());
|
||||
// rootLogger.log(Level.INFO, "SchemaName: " + element.getName());
|
||||
//
|
||||
// // System.out.println(parent1.getName());
|
||||
// // System.out.println(parent.getName());
|
||||
// // System.out.println(element.getName());
|
||||
//
|
||||
// }
|
||||
//
|
||||
// if (element.isDatabase()) {
|
||||
//
|
||||
// System.out.println("element is a database: " + element.isDatabase());
|
||||
//
|
||||
// FileModel resource = store.getParent(element);
|
||||
// // FileModel parent1 = store.getParent(parent);
|
||||
//
|
||||
// dataInput.put("ResourceName", resource.getName());
|
||||
// dataInput.put("DatabaseName", element.getName());
|
||||
// dataInput.put("SchemaName", "");
|
||||
//
|
||||
// rootLogger.log(Level.INFO, "ResourceName: " + resource.getName());
|
||||
// rootLogger.log(Level.INFO, "DatabaseName: " + element.getName());
|
||||
// rootLogger.log(Level.INFO, "SchemaName: " + "");
|
||||
//
|
||||
// // System.out.println(parent1.getName());
|
||||
// // System.out.println(parent.getName());
|
||||
// // System.out.println(element.getName());
|
||||
//
|
||||
// }
|
||||
|
||||
// System.out.println("element is a schema: " + element.isSchema());
|
||||
//
|
||||
// if (element.isSchema()) {
|
||||
//
|
||||
// System.out.println("element is a schema: " + element.isSchema());
|
||||
//
|
||||
// FileModel database = store.getParent(element);
|
||||
// FileModel resource = store.getParent(database);
|
||||
//
|
||||
String resource="";
|
||||
String database="";
|
||||
String schema="";
|
||||
|
||||
|
||||
if (element.isDatabase()){ //the selected item is a database
|
||||
|
||||
database= element.getName();
|
||||
resource=store.getParent(element).getName();
|
||||
|
||||
|
||||
|
||||
dataInput.put("ResourceName", resource);
|
||||
dataInput.put("DatabaseName", database);
|
||||
dataInput.put("SchemaName", "");
|
||||
|
||||
}else { //the selected item is a schema
|
||||
|
||||
FileModel db = store.getParent(element);
|
||||
database = db.getName();
|
||||
|
||||
resource = store.getParent(db).getName();
|
||||
schema = element.getName();
|
||||
|
||||
dataInput.put("ResourceName", resource);
|
||||
dataInput.put("DatabaseName", database);
|
||||
dataInput.put("SchemaName", schema);
|
||||
|
||||
// dataInput.put("ResourceName", resource.getName());
|
||||
// dataInput.put("DatabaseName", database.getName());
|
||||
// dataInput.put("SchemaName", element.getName());
|
||||
//
|
||||
// System.out.println("schema name: " + element.getName());
|
||||
//
|
||||
// rootLogger.log(Level.INFO, "ResourceName: " + resource.getName());
|
||||
// rootLogger.log(Level.INFO, "DatabaseName: " + database.getName());
|
||||
// rootLogger.log(Level.INFO, "SchemaName: " + element.getName());
|
||||
//
|
||||
// // System.out.println(parent1.getName());
|
||||
// // System.out.println(parent.getName());
|
||||
// // System.out.println(element.getName());
|
||||
|
||||
|
||||
}
|
||||
|
||||
// FileModel database = store.getParent(element);
|
||||
// FileModel resource = store.getParent(database);
|
||||
//
|
||||
// dataInput.put("ResourceName", resource.getName());
|
||||
// dataInput.put("DatabaseName", database.getName());
|
||||
|
||||
// if (element.getDatabaseType().equals(ConstantsPortlet.POSTGRES)){
|
||||
//
|
||||
//
|
||||
// }
|
||||
//
|
||||
// if (element.isDatabase()) {
|
||||
//
|
||||
// System.out.println("element is a database: " + element.isDatabase());
|
||||
//
|
||||
// FileModel resource = store.getParent(element);
|
||||
// // FileModel parent1 = store.getParent(parent);
|
||||
//
|
||||
// dataInput.put("ResourceName", resource.getName());
|
||||
// dataInput.put("DatabaseName", element.getName());
|
||||
// dataInput.put("SchemaName", "");
|
||||
//
|
||||
// rootLogger.log(Level.INFO, "ResourceName: " + resource.getName());
|
||||
// rootLogger.log(Level.INFO, "DatabaseName: " + element.getName());
|
||||
// rootLogger.log(Level.INFO, "SchemaName: " + "");
|
||||
//
|
||||
// // System.out.println(parent1.getName());
|
||||
// // System.out.println(parent.getName());
|
||||
// // System.out.println(element.getName());
|
||||
//
|
||||
// else{
|
||||
// dataInput.put("SchemaName", "");
|
||||
// }
|
||||
|
||||
FileModel database = store.getParent(element);
|
||||
FileModel resource = store.getParent(database);
|
||||
|
||||
dataInput.put("ResourceName", resource.getName());
|
||||
dataInput.put("DatabaseName", database.getName());
|
||||
dataInput.put("SchemaName", element.getName());
|
||||
|
||||
// System.out.println("schema name: " + element.getName());
|
||||
|
||||
rootLogger.log(Level.INFO, "ResourceName: " + resource.getName());
|
||||
rootLogger.log(Level.INFO, "DatabaseName: " + database.getName());
|
||||
rootLogger.log(Level.INFO, "SchemaName: " + element.getName());
|
||||
// System.out.println("schema name: " + element.getName());
|
||||
|
||||
// rootLogger.log(Level.INFO, "ResourceName: " + resource.getName());
|
||||
// rootLogger.log(Level.INFO, "DatabaseName: " + database.getName());
|
||||
// rootLogger.log(Level.INFO, "SchemaName: " + element.getName());
|
||||
|
||||
rootLogger.log(Level.INFO, "ResourceName: " + resource);
|
||||
rootLogger.log(Level.INFO, "DatabaseName: " + database);
|
||||
rootLogger.log(Level.INFO, "SchemaName: " + schema);
|
||||
|
||||
|
||||
// System.out.println(parent1.getName());
|
||||
// System.out.println(parent.getName());
|
||||
|
@ -690,16 +765,18 @@ public class GxtTreePanel extends LayoutContainer {
|
|||
// System.out.println("FAILURE");
|
||||
rootLogger.log(Level.SEVERE, "FAILURE RPC getTables");
|
||||
|
||||
// no tables are available
|
||||
// no tables are available (the schema has not table)
|
||||
if (caught.getMessage().equals(
|
||||
"java.lang.Exception: Result not available")) {
|
||||
|
||||
element.setIsExpanded(false);
|
||||
|
||||
|
||||
treePanel.setExpanded(element, false);
|
||||
|
||||
if (treePanel.isMasked())
|
||||
treePanel.unmask();
|
||||
|
||||
element.setIsLoaded(true);
|
||||
|
||||
}
|
||||
|
||||
|
@ -728,25 +805,25 @@ public class GxtTreePanel extends LayoutContainer {
|
|||
element.setIsExpanded(false);
|
||||
|
||||
treePanel.setExpanded(element, false);
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
for (int i = 0; i < result.size(); i++) {
|
||||
|
||||
result.get(i).setIsExpanded(false);
|
||||
|
||||
result.get(i).setIsLoaded(true);
|
||||
|
||||
result.get(i).setIsSchema(false);
|
||||
|
||||
// element.setIsLoaded(true);
|
||||
|
||||
|
||||
|
||||
result.get(i).setIsLoaded(true);
|
||||
|
||||
result.get(i).setIsSchema(false);
|
||||
|
||||
// element.setIsLoaded(true);
|
||||
|
||||
//ppritn check
|
||||
// System.out.println(result.get(i).getName());
|
||||
|
||||
rootLogger.log(Level.INFO, "table: "
|
||||
+ result.get(i).getName());
|
||||
// rootLogger.log(Level.INFO, "table: "
|
||||
// + result.get(i).getName());
|
||||
|
||||
}
|
||||
|
||||
|
@ -887,6 +964,7 @@ public class GxtTreePanel extends LayoutContainer {
|
|||
|
||||
infoOnSelectedItem.put("ResourceName", ResourceNameSelected);
|
||||
infoOnSelectedItem.put("DatabaseName", DatabaseNameSelected);
|
||||
// infoOnSelectedItem.put("SchemaName", "");
|
||||
infoOnSelectedItem.put("TableName", TableNameSelected);
|
||||
|
||||
} else if (treeDepthSelectedItem == 5) { // the selected item is a table
|
||||
|
|
|
@ -189,7 +189,9 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
// System.out.println(inputParameters.get(i).getName());
|
||||
|
||||
inputParameters.get(i).setValue(resourceName);
|
||||
|
||||
|
||||
|
||||
// rootLogger.log(Level.INFO, "ResourceName: " + resourceName);
|
||||
rootLogger.log(Level.INFO, inputParameters.get(i).getName());
|
||||
|
||||
}
|
||||
|
@ -352,6 +354,12 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
inputParameters.get(0).setValue(dataInput.get("ResourceName"));
|
||||
inputParameters.get(1).setValue(dataInput.get("DatabaseName"));
|
||||
inputParameters.get(2).setValue(dataInput.get("SchemaName"));
|
||||
|
||||
rootLogger.log(Level.SEVERE, "ResourceName: " + dataInput.get("ResourceName"));
|
||||
rootLogger.log(Level.SEVERE, "DatabaseName: " + dataInput.get("DatabaseName"));
|
||||
rootLogger.log(Level.SEVERE, "SchemaName: " + dataInput.get("SchemaName"));
|
||||
|
||||
|
||||
|
||||
// System.out.println("size outputMap pre computation: "
|
||||
// + outputMap.size());
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
<inherits name='com.google.gwt.user.User' />
|
||||
|
||||
<inherits name='com.extjs.gxt.ui.GXT' />
|
||||
|
||||
<inherits name="com.google.gwt.logging.Logging"/>
|
||||
|
||||
<!-- We need the JUnit module in the main module, -->
|
||||
<!-- otherwise eclipse complains (Google plugin bug?) -->
|
||||
|
@ -24,5 +26,9 @@
|
|||
<!-- Specify the paths for translatable code -->
|
||||
<source path='client' />
|
||||
<source path='shared' />
|
||||
|
||||
<!-- <set-property name="gwt.logging.logLevel" value="SEVERE"/> -->
|
||||
<!-- <set-property name="gwt.logging.logLevel" value="INFO"/> -->
|
||||
<set-property name="gwt.logging.enabled" value="TRUE"/>
|
||||
|
||||
</module>
|
||||
|
|
Loading…
Reference in New Issue