code cleaned up removing commented lines in class GxtFormSubmitQuery and in packages interfaces, events, datamodel, client

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/databases-manager-portlet@99119 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Loredana Liccardo 2014-07-30 15:36:09 +00:00
parent f90b8a4e71
commit 4c457cfd7e
20 changed files with 11 additions and 167 deletions

View File

@ -105,5 +105,4 @@ public class DatabasesManager implements EntryPoint {
borderLayout.setWidth(rootWidth); borderLayout.setWidth(rootWidth);
} }
} }

View File

@ -14,7 +14,6 @@ public class ComputationOutput {
public void setMapValues(LinkedHashMap<String, String> mapValues) { public void setMapValues(LinkedHashMap<String, String> mapValues) {
this.mapValues = mapValues; this.mapValues = mapValues;
} }
public void setmapKeys(LinkedHashMap<String, String> mapKeys) { public void setmapKeys(LinkedHashMap<String, String> mapKeys) {
@ -22,13 +21,10 @@ public class ComputationOutput {
} }
public LinkedHashMap<String, String> getMapValues() { public LinkedHashMap<String, String> getMapValues() {
return mapValues; return mapValues;
} }
public LinkedHashMap<String, String> getmapKeys() { public LinkedHashMap<String, String> getmapKeys() {
return mapKeys; return mapKeys;
} }
} }

View File

@ -14,7 +14,6 @@ public class FileModel extends BaseModelData implements Serializable {
private static int ID = 1; private static int ID = 1;
// private int id; // private int id;
private boolean isExpanded = true; private boolean isExpanded = true;
// set to true value if the object has been managed calling rpc remote // set to true value if the object has been managed calling rpc remote
// methods // methods
private boolean isLoaded = false; private boolean isLoaded = false;
@ -26,7 +25,6 @@ public class FileModel extends BaseModelData implements Serializable {
private boolean isDatabase = false; private boolean isDatabase = false;
// set if the node in the tree is collapsed // set if the node in the tree is collapsed
private boolean isCollapsed = false; private boolean isCollapsed = false;
// to keep track information about the database // to keep track information about the database
private List<Result> DBInfo = null; private List<Result> DBInfo = null;
// set if database information are displayed // set if database information are displayed
@ -37,7 +35,7 @@ public class FileModel extends BaseModelData implements Serializable {
private boolean isTableDetailsDisplayed = false; private boolean isTableDetailsDisplayed = false;
// to keep track of the database type // to keep track of the database type
private String DatabaseType = null; private String DatabaseType = null;
// resource data
private String ResourceName = null; private String ResourceName = null;
private String DatabaseName = null; private String DatabaseName = null;
@ -50,15 +48,13 @@ public class FileModel extends BaseModelData implements Serializable {
public FileModel(String name) { public FileModel(String name) {
setName(name); setName(name);
setId(); setId();
} }
//constructor for the root element in the tree
public FileModel(String name, int id) {
setName(name);
set("ID", id);
} // constructor for the root element in the tree
public FileModel(String name, int id) {
setName(name);
set("ID", id);
}
public void setId() { public void setId() {
set("ID", ID++); set("ID", ID++);
@ -66,7 +62,6 @@ public class FileModel extends BaseModelData implements Serializable {
public int getId() { public int getId() {
return get("ID"); return get("ID");
} }
public void setName(String name) { public void setName(String name) {
@ -78,30 +73,23 @@ public class FileModel extends BaseModelData implements Serializable {
} }
public void setIsExpanded(boolean value) { public void setIsExpanded(boolean value) {
isExpanded = value; isExpanded = value;
} }
public boolean isExpanded() { public boolean isExpanded() {
return isExpanded; return isExpanded;
} }
public void setIsLoaded(boolean value) { public void setIsLoaded(boolean value) {
isLoaded = value; isLoaded = value;
} }
public boolean isLoaded() { public boolean isLoaded() {
return isLoaded; return isLoaded;
} }
// // set if the object is a schema // // set if the object is a schema
// public void setIsSchema(boolean value) { // public void setIsSchema(boolean value) {
//
// set("isSchema", value); // set("isSchema", value);
// } // }
// //
@ -111,49 +99,40 @@ public class FileModel extends BaseModelData implements Serializable {
// set if the object is a schema // set if the object is a schema
public void setIsSchema(boolean value) { public void setIsSchema(boolean value) {
// set("isSchema", value); // set("isSchema", value);
isSchema = value; isSchema = value;
} }
public boolean isSchema() { public boolean isSchema() {
// return get("isSchema"); // return get("isSchema");
return isSchema; return isSchema;
} }
// // set if the object is a table // // set if the object is a table
// public void setIsTable(boolean value) { // public void setIsTable(boolean value) {
//
// set("isTable", value); // set("isTable", value);
// } // }
// //
// public boolean isTable() { // public boolean isTable() {
//
// return get("isTable"); // return get("isTable");
// } // }
// set if the object is a table // set if the object is a table
public void setIsTable(boolean value) { public void setIsTable(boolean value) {
// set("isTable", value); // set("isTable", value);
isTable = value; isTable = value;
} }
public boolean isTable() { public boolean isTable() {
// return get("isTable"); // return get("isTable");
return isTable; return isTable;
} }
public void setIsDatabase(boolean value) { public void setIsDatabase(boolean value) {
isDatabase = value; isDatabase = value;
} }
public boolean isDatabase() { public boolean isDatabase() {
return isDatabase; return isDatabase;
} }
@ -190,41 +169,33 @@ public class FileModel extends BaseModelData implements Serializable {
} }
public void setDatabaseType(String value) { public void setDatabaseType(String value) {
DatabaseType = value; DatabaseType = value;
} }
public String getDatabaseType() { public String getDatabaseType() {
return this.DatabaseType; return this.DatabaseType;
} }
public void setResourceName(String value) { public void setResourceName(String value) {
ResourceName = value; ResourceName = value;
} }
public String getResourceName() { public String getResourceName() {
return ResourceName; return ResourceName;
} }
public void setDatabaseName(String value) { public void setDatabaseName(String value) {
DatabaseName = value; DatabaseName = value;
} }
public String getDatabaseName() { public String getDatabaseName() {
return DatabaseName; return DatabaseName;
} }
public void setIsCollapsed(boolean value) { public void setIsCollapsed(boolean value) {
isCollapsed = true; isCollapsed = true;
} }
public boolean getIsCollapsed() { public boolean getIsCollapsed() {
return isCollapsed; return isCollapsed;
} }
@ -237,5 +208,4 @@ public class FileModel extends BaseModelData implements Serializable {
} }
return super.equals(obj); return super.equals(obj);
} }
} }

View File

@ -13,16 +13,13 @@ public class Parameter implements Serializable {
public Parameter(String paramName, String paramDescription, public Parameter(String paramName, String paramDescription,
String objectType, String defaultValue) { String objectType, String defaultValue) {
this.setName(paramName); this.setName(paramName);
this.setParamDescription(paramDescription); this.setParamDescription(paramDescription);
this.setObjectType(objectType); this.setObjectType(objectType);
this.setDefaultValue(defaultValue); this.setDefaultValue(defaultValue);
} }
public Parameter() { public Parameter() {
// TODO Auto-generated constructor stub
} }
public String getValue() { public String getValue() {
@ -50,23 +47,18 @@ public class Parameter implements Serializable {
} }
public void setObjectType(String objectType) { public void setObjectType(String objectType) {
this.objectType = objectType; this.objectType = objectType;
} }
public String getObjectType() { public String getObjectType() {
return objectType; return objectType;
} }
public void setDefaultValue(String defaultValue) { public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue; this.defaultValue = defaultValue;
} }
public String getDefaultValue() { public String getDefaultValue() {
return defaultValue; return defaultValue;
} }
} }

View File

@ -17,7 +17,6 @@ public class Result extends BaseModelData implements Serializable {
public Result(String index, String value) { public Result(String index, String value) {
set("index", index); set("index", index);
set("value", value); set("value", value);
} }
public String getValue() { public String getValue() {
@ -27,5 +26,4 @@ public class Result extends BaseModelData implements Serializable {
public String getIndex() { public String getIndex() {
return get("index"); return get("index");
} }
} }

View File

@ -11,21 +11,15 @@ public class Row extends BaseModelData implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
// private static int ID = 0; // private static int ID = 0;
// private static Logger rootLogger = Logger.getLogger("Row"); // private static Logger rootLogger = Logger.getLogger("Row");
public Row() { public Row() {
} }
public Row(List<String> attributes, List<String> values, int index) { public Row(List<String> attributes, List<String> values, int index) {
set("index", index); set("index", index);
for (int i = 0; i < attributes.size(); i++) { for (int i = 0; i < attributes.size(); i++) {
set(attributes.get(i), values.get(i)); set(attributes.get(i), values.get(i));
// print check // print check
// System.out.println("attribute: " + attributes.get(i) + " value: " // System.out.println("attribute: " + attributes.get(i) + " value: "
// + values.get(i)); // + values.get(i));
@ -33,9 +27,7 @@ public class Row extends BaseModelData implements Serializable {
// print check // print check
// rootLogger.log(Level.INFO, "Row-> attribute: " // rootLogger.log(Level.INFO, "Row-> attribute: "
// +attributes.get(i)+ "value: " + values.get(i)); // +attributes.get(i)+ "value: " + values.get(i));
} }
} }
public String getValue(String attribute) { public String getValue(String attribute) {
@ -89,5 +81,4 @@ public class Row extends BaseModelData implements Serializable {
// //
// return elements; // return elements;
// } // }
} }

View File

@ -15,7 +15,6 @@ public class SQLDialect extends BaseModelData {
} }
public SQLDialect(String name) { public SQLDialect(String name) {
setName(name); setName(name);
} }
@ -24,12 +23,10 @@ public class SQLDialect extends BaseModelData {
} }
public String getName() { public String getName() {
return get("name"); return get("name");
} }
public static List<SQLDialect> loadData() { public static List<SQLDialect> loadData() {
List<SQLDialect> dialects = new ArrayList<SQLDialect>(); List<SQLDialect> dialects = new ArrayList<SQLDialect>();
SQLDialect element1 = new SQLDialect(ConstantsPortlet.NONE); SQLDialect element1 = new SQLDialect(ConstantsPortlet.NONE);
@ -41,7 +38,5 @@ public class SQLDialect extends BaseModelData {
dialects.add(element3); dialects.add(element3);
return dialects; return dialects;
} }
} }

View File

@ -5,11 +5,10 @@ public class SubmitQueryData {
private String query; private String query;
private boolean readOnlyQuery; private boolean readOnlyQuery;
private boolean smartCorrection; private boolean smartCorrection;
//the dialect information // the dialect information
private String language; private String language;
public SubmitQueryData(){ public SubmitQueryData() {
} }
public void setQuery(String value) { public void setQuery(String value) {
@ -43,5 +42,4 @@ public class SubmitQueryData {
public String getLanguage() { public String getLanguage() {
return this.language; return this.language;
} }
} }

View File

@ -9,22 +9,15 @@ public class LoadTablesEvent extends GwtEvent<LoadTablesEventHandler> {
@Override @Override
protected void dispatch(LoadTablesEventHandler handler) { protected void dispatch(LoadTablesEventHandler handler) {
// TODO Auto-generated method stub
handler.onLoadTables(this); handler.onLoadTables(this);
} }
@Override @Override
public Type<LoadTablesEventHandler> getAssociatedType() { public Type<LoadTablesEventHandler> getAssociatedType() {
// TODO Auto-generated method stub
return TYPE; return TYPE;
} }
public EventsTypeEnum getKey() { public EventsTypeEnum getKey() {
// TODO Auto-generated method stub
return EventsTypeEnum.LOAD_TABLES_EVENT; return EventsTypeEnum.LOAD_TABLES_EVENT;
} }
} }

View File

@ -9,22 +9,15 @@ public class RandomSamplingEvent extends GwtEvent<RandomSamplingEventHandler> {
@Override @Override
protected void dispatch(RandomSamplingEventHandler handler) { protected void dispatch(RandomSamplingEventHandler handler) {
// TODO Auto-generated method stub
handler.onRandomSampling(this); handler.onRandomSampling(this);
} }
@Override @Override
public Type<RandomSamplingEventHandler> getAssociatedType() { public Type<RandomSamplingEventHandler> getAssociatedType() {
// TODO Auto-generated method stub
return TYPE; return TYPE;
} }
public EventsTypeEnum getKey() { public EventsTypeEnum getKey() {
// TODO Auto-generated method stub
return EventsTypeEnum.RANDOM_SAMPLING_EVENT; return EventsTypeEnum.RANDOM_SAMPLING_EVENT;
} }
} }

View File

@ -9,22 +9,15 @@ public class SamplingEvent extends GwtEvent<SamplingEventHandler> {
@Override @Override
public Type<SamplingEventHandler> getAssociatedType() { public Type<SamplingEventHandler> getAssociatedType() {
// TODO Auto-generated method stub
return TYPE; return TYPE;
} }
@Override @Override
protected void dispatch(SamplingEventHandler handler) { protected void dispatch(SamplingEventHandler handler) {
// TODO Auto-generated method stub
handler.onSampling(this); handler.onSampling(this);
} }
public EventsTypeEnum getKey() { public EventsTypeEnum getKey() {
// TODO Auto-generated method stub
return EventsTypeEnum.SAMPLING_EVENT; return EventsTypeEnum.SAMPLING_EVENT;
} }
} }

View File

@ -9,22 +9,15 @@ public class SelectedItemEvent extends GwtEvent<SelectedItemEventHandler> {
@Override @Override
public Type<SelectedItemEventHandler> getAssociatedType() { public Type<SelectedItemEventHandler> getAssociatedType() {
// TODO Auto-generated method stub
return TYPE; return TYPE;
} }
@Override @Override
protected void dispatch(SelectedItemEventHandler handler) { protected void dispatch(SelectedItemEventHandler handler) {
// TODO Auto-generated method stub
handler.onSelectedItem(this); handler.onSelectedItem(this);
} }
public EventsTypeEnum getKey() { public EventsTypeEnum getKey() {
// TODO Auto-generated method stub
return EventsTypeEnum.SELECTED_ITEM_EVENT; return EventsTypeEnum.SELECTED_ITEM_EVENT;
} }
} }

View File

@ -9,22 +9,15 @@ public class SelectedTableEvent extends GwtEvent<SelectedTableEventHandler> {
@Override @Override
public Type<SelectedTableEventHandler> getAssociatedType() { public Type<SelectedTableEventHandler> getAssociatedType() {
// TODO Auto-generated method stub
return TYPE; return TYPE;
} }
@Override @Override
protected void dispatch(SelectedTableEventHandler handler) { protected void dispatch(SelectedTableEventHandler handler) {
// TODO Auto-generated method stub
handler.onSelectedTable(this); handler.onSelectedTable(this);
} }
public EventsTypeEnum getKey() { public EventsTypeEnum getKey() {
// TODO Auto-generated method stub
return EventsTypeEnum.SELECTED_TABLE_EVENT; return EventsTypeEnum.SELECTED_TABLE_EVENT;
} }
} }

View File

@ -9,22 +9,15 @@ public class ShowCreateTableEvent extends GwtEvent<ShowCreateTableEventHandler>
@Override @Override
protected void dispatch(ShowCreateTableEventHandler handler) { protected void dispatch(ShowCreateTableEventHandler handler) {
// TODO Auto-generated method stub
handler.onShowCreateTable(this); handler.onShowCreateTable(this);
} }
@Override @Override
public Type<ShowCreateTableEventHandler> getAssociatedType() { public Type<ShowCreateTableEventHandler> getAssociatedType() {
// TODO Auto-generated method stub
return TYPE; return TYPE;
} }
public EventsTypeEnum getKey() { public EventsTypeEnum getKey() {
// TODO Auto-generated method stub
return EventsTypeEnum.SHOW_CREATE_TABLE_EVENT; return EventsTypeEnum.SHOW_CREATE_TABLE_EVENT;
} }
} }

View File

@ -9,22 +9,15 @@ public class SmartSamplingEvent extends GwtEvent<SmartSamplingEventHandler> {
@Override @Override
protected void dispatch(SmartSamplingEventHandler handler) { protected void dispatch(SmartSamplingEventHandler handler) {
// TODO Auto-generated method stub
handler.onSmartSampling(this); handler.onSmartSampling(this);
} }
@Override @Override
public Type<SmartSamplingEventHandler> getAssociatedType() { public Type<SmartSamplingEventHandler> getAssociatedType() {
// TODO Auto-generated method stub
return TYPE; return TYPE;
} }
public EventsTypeEnum getKey() { public EventsTypeEnum getKey() {
// TODO Auto-generated method stub
return EventsTypeEnum.SMART_SAMPLING_EVENT; return EventsTypeEnum.SMART_SAMPLING_EVENT;
} }
} }

View File

@ -14,26 +14,19 @@ public class SubmitQueryEvent extends GwtEvent<SubmitQueryEventHandler> {
@Override @Override
public Type<SubmitQueryEventHandler> getAssociatedType() { public Type<SubmitQueryEventHandler> getAssociatedType() {
// TODO Auto-generated method stub
return TYPE; return TYPE;
} }
@Override @Override
protected void dispatch(SubmitQueryEventHandler handler) { protected void dispatch(SubmitQueryEventHandler handler) {
// TODO Auto-generated method stub
handler.onSubmitQuery(this); handler.onSubmitQuery(this);
} }
public EventsTypeEnum getKey() { public EventsTypeEnum getKey() {
// TODO Auto-generated method stub
return EventsTypeEnum.SUBMIT_QUERY_EVENT; return EventsTypeEnum.SUBMIT_QUERY_EVENT;
} }
public int getDialogID(){ public int getDialogID(){
return dialogID; return dialogID;
} }
} }

View File

@ -4,7 +4,5 @@ import org.gcube.portlets.user.databasesmanager.client.events.RandomSamplingEven
import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.EventHandler;
public interface RandomSamplingEventHandler extends EventHandler { public interface RandomSamplingEventHandler extends EventHandler {
public void onRandomSampling(RandomSamplingEvent randomSamplingEvent); public void onRandomSampling(RandomSamplingEvent randomSamplingEvent);
} }

View File

@ -4,7 +4,5 @@ import org.gcube.portlets.user.databasesmanager.client.events.SelectedTableEvent
import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.EventHandler;
public interface SelectedTableEventHandler extends EventHandler { public interface SelectedTableEventHandler extends EventHandler {
public void onSelectedTable(SelectedTableEvent selectedTableEvent); public void onSelectedTable(SelectedTableEvent selectedTableEvent);
} }

View File

@ -4,7 +4,5 @@ import org.gcube.portlets.user.databasesmanager.client.events.SmartSamplingEvent
import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.EventHandler;
public interface SmartSamplingEventHandler extends EventHandler { public interface SmartSamplingEventHandler extends EventHandler {
public void onSmartSampling(SmartSamplingEvent smartSamplingEvent); public void onSmartSampling(SmartSamplingEvent smartSamplingEvent);
} }

View File

@ -13,36 +13,29 @@ import com.extjs.gxt.ui.client.widget.layout.FormData;
//Form that the is used from the user to insert data useful for submit a query //Form that the is used from the user to insert data useful for submit a query
public class GxtFormSubmitQuery extends LayoutContainer { public class GxtFormSubmitQuery extends LayoutContainer {
// private VerticalPanel vp; // private VerticalPanel vp;
private FormPanel form; private FormPanel form;
private FormData formData; private FormData formData;
// GWT logger
// gwt logger
private static Logger rootLogger = Logger.getLogger("GxtFormSubmitQuery"); private static Logger rootLogger = Logger.getLogger("GxtFormSubmitQuery");
public GxtFormSubmitQuery() { public GxtFormSubmitQuery() {
this.setLayout(new FitLayout()); this.setLayout(new FitLayout());
// this.setSize(600, 400); // this.setSize(600, 400);
formData = new FormData("-20"); formData = new FormData("-20");
// vp = new VerticalPanel(); // vp = new VerticalPanel();
// vp.setSpacing(10); // vp.setSpacing(10);
createLayout(); createLayout();
// add(vp); // add(vp);
} }
private void createLayout() { private void createLayout() {
form = new FormPanel(); form = new FormPanel();
// form.setHeading("Submit Query"); // form.setHeading("Submit Query");
form.setHeaderVisible(false); form.setHeaderVisible(false);
// form.setFrame(true); // form.setFrame(true);
// form.setWidth(350); // form.setWidth(350);
// form.setWidth(350); // form.setWidth(350);
// form.setHeight(250); // form.setHeight(250);
@ -52,7 +45,6 @@ public class GxtFormSubmitQuery extends LayoutContainer {
query.setHeight(300); query.setHeight(300);
query.setPreventScrollbars(false); query.setPreventScrollbars(false);
query.setFieldLabel("Query"); query.setFieldLabel("Query");
// query.setHeight(50); // query.setHeight(50);
// query.setWidth(50); // query.setWidth(50);
// query.setAllowBlank(false); // query.setAllowBlank(false);
@ -100,75 +92,50 @@ public class GxtFormSubmitQuery extends LayoutContainer {
// vp.add(form); // vp.add(form);
this.add(form); this.add(form);
} }
// get the query // get the query
private String getQuery() { private String getQuery() {
String query = ((TextArea) form.getWidget(0)).getValue(); String query = ((TextArea) form.getWidget(0)).getValue();
// print check // print check
// System.out.println("GxtFormSubmitQuery->query: " + query);
rootLogger.log(Level.SEVERE, "query: " + query); rootLogger.log(Level.SEVERE, "query: " + query);
return query; return query;
} }
// get the smart correction value // get the smart correction value
private boolean getSmartCorrectionValue() { private boolean getSmartCorrectionValue() {
// CheckBox checkSC = ((CheckBox) form.getWidget(2)); // CheckBox checkSC = ((CheckBox) form.getWidget(2));
CheckBox checkSC = ((CheckBox) form.getWidget(1)); CheckBox checkSC = ((CheckBox) form.getWidget(1));
// print check // print check
// System.out.println("GxtFormSubmitQuery->smartcorrection: "
// + checkSC.getValue());
rootLogger.log(Level.SEVERE, "smartcorrection: " + checkSC.getValue()); rootLogger.log(Level.SEVERE, "smartcorrection: " + checkSC.getValue());
return (checkSC.getValue()); return (checkSC.getValue());
} }
// get data for submit a query // get data for submit a query
public SubmitQueryData getSubmitQueryData() { public SubmitQueryData getSubmitQueryData() {
layout(true); layout(true);
SubmitQueryData data = new SubmitQueryData(); SubmitQueryData data = new SubmitQueryData();
data.setQuery(this.getQuery()); data.setQuery(this.getQuery());
// TO REMOVE // TO REMOVE
// data.setReadOnlyQuery(this.getReadOnlyQueryValue()); // data.setReadOnlyQuery(this.getReadOnlyQueryValue());
data.setSmartCorrection(this.getSmartCorrectionValue()); data.setSmartCorrection(this.getSmartCorrectionValue());
// TO REMOVE // TO REMOVE
// data.setLanguage(this.getLanguage()); // data.setLanguage(this.getLanguage());
return data; return data;
} }
// private String getLanguage() { // private String getLanguage() {
//
// ComboBox<SQLDialect> combo = ((ComboBox<SQLDialect>) form.getWidget(3)); // ComboBox<SQLDialect> combo = ((ComboBox<SQLDialect>) form.getWidget(3));
// SQLDialect item = combo.getValue(); // SQLDialect item = combo.getValue();
//
// System.out.println("GxtFormSubmitQuery->language: " + item.getName()); // System.out.println("GxtFormSubmitQuery->language: " + item.getName());
//
// return item.getName(); // return item.getName();
// } // }
// private boolean getReadOnlyQueryValue() { // private boolean getReadOnlyQueryValue() {
//
// CheckBox checkRO = ((CheckBox) form.getWidget(1)); // CheckBox checkRO = ((CheckBox) form.getWidget(1));
//
// System.out.println("GxtFormSubmitQuery->readonlyquery: " // System.out.println("GxtFormSubmitQuery->readonlyquery: "
// + checkRO.getValue()); // + checkRO.getValue());
// return (checkRO.getValue()); // return (checkRO.getValue());
//
// } // }
} }