- total number rows added in the header of the result related to the submit Query operation: classes ComputationOutput,SubmitQueryResultWithFileFromServlet,GxtBorderLayoutPanel, GWTdbManagerServiceImpl modified.

- class Result modified in order to implement IsSerializable and not Serializable
- pom file modified in order to use gwt 2.6.1 with scope compile and not use gwt from the portal bom file.

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/databases-manager-portlet@101939 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Loredana Liccardo 2014-12-05 15:04:06 +00:00
parent 7ed18bcc2d
commit ba666c807c
6 changed files with 58 additions and 20 deletions

38
pom.xml
View File

@ -30,7 +30,9 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Convenience property to set the GWT version --> <!-- Convenience property to set the GWT version -->
<gwtVersion>2.5.1</gwtVersion> <gwtVersion>2.6.1</gwtVersion>
<gxt2Version>2.6.1</gxt2Version>
<!-- GWT needs at least java 1.5 --> <!-- GWT needs at least java 1.5 -->
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory> <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<!-- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> --> <!-- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> -->
@ -39,11 +41,11 @@
<dependencies> <dependencies>
<!-- Dependencies for the SM client library --> <!-- Dependencies for the SM client library -->
<!-- <dependency> --> <!-- <dependency> -->
<!-- <groupId>org.gcube.applicationsupportlayer</groupId> --> <!-- <groupId>org.gcube.applicationsupportlayer</groupId> -->
<!-- <artifactId>aslcore</artifactId> --> <!-- <artifactId>aslcore</artifactId> -->
<!-- <version>[1.0.0-SNAPSHOT,5.0.0-SNAPSHOT)</version> --> <!-- <version>[1.0.0-SNAPSHOT,5.0.0-SNAPSHOT)</version> -->
<!-- </dependency> --> <!-- </dependency> -->
<dependency> <dependency>
<groupId>org.gcube.data.analysis</groupId> <groupId>org.gcube.data.analysis</groupId>
<artifactId>statistical-manager-cl</artifactId> <artifactId>statistical-manager-cl</artifactId>
@ -83,7 +85,7 @@
<groupId>xalan</groupId> <groupId>xalan</groupId>
<artifactId>xalan</artifactId> <artifactId>xalan</artifactId>
<version>2.7.1</version> <version>2.7.1</version>
<!-- <scope>compile</scope> --> <!-- <scope>compile</scope> -->
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
@ -224,13 +226,15 @@
<dependency> <dependency>
<groupId>com.google.gwt</groupId> <groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId> <artifactId>gwt-servlet</artifactId>
<!-- <version>${gwtVersion}</version> --> <version>${gwtVersion}</version>
<!-- <scope>runtime</scope> --> <!-- <scope>runtime</scope> -->
<!-- <scope>compile</scope> -->
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.google.gwt</groupId> <groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId> <artifactId>gwt-user</artifactId>
<!-- <version>${gwtVersion}</version> --> <version>${gwtVersion}</version>
<!-- <scope>provided</scope> -->
<!-- <scope>provided</scope> --> <!-- <scope>provided</scope> -->
</dependency> </dependency>
<dependency> <dependency>
@ -252,11 +256,19 @@
<classifier>sources</classifier> <classifier>sources</classifier>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!-- <dependency> -->
<!-- <groupId>com.extjs.gxt</groupId> -->
<!-- <artifactId>gxt</artifactId> -->
<!-- <version>2.2.5</version> -->
<!-- </dependency> -->
<dependency> <dependency>
<groupId>com.extjs.gxt</groupId> <groupId>com.sencha.gxt</groupId>
<artifactId>gxt</artifactId> <artifactId>gxt2.2.5-gwt2.X</artifactId>
<version>2.2.5</version> <version>${gxt2Version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
@ -288,7 +300,7 @@
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId> <artifactId>gwt-maven-plugin</artifactId>
<version>2.5.1</version> <version>${gwtVersion}</version>
<executions> <executions>
<execution> <execution>
<goals> <goals>

View File

@ -7,6 +7,7 @@ public class ComputationOutput {
private LinkedHashMap<String, String> mapValues; private LinkedHashMap<String, String> mapValues;
private LinkedHashMap<String, String> mapKeys; private LinkedHashMap<String, String> mapKeys;
private String urlFile; private String urlFile;
private int submitQueryTotalRows;
public ComputationOutput() { public ComputationOutput() {
mapKeys = new LinkedHashMap<String, String>(); mapKeys = new LinkedHashMap<String, String>();
@ -37,4 +38,12 @@ public class ComputationOutput {
public String getUrlFile(){ public String getUrlFile(){
return this.urlFile; return this.urlFile;
} }
public void setSubmitQueryTotalRows(int val){
this.submitQueryTotalRows = val;
}
public int getSubmitQueryTotalRows(){
return this.submitQueryTotalRows;
}
} }

View File

@ -3,8 +3,9 @@ package org.gcube.portlets.user.databasesmanager.client.datamodel;
import java.io.Serializable; import java.io.Serializable;
import com.extjs.gxt.ui.client.data.BaseModelData; import com.extjs.gxt.ui.client.data.BaseModelData;
import com.google.gwt.user.client.rpc.IsSerializable;
public class Result extends BaseModelData implements Serializable { public class Result extends BaseModelData implements IsSerializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -12,6 +12,7 @@ public class SubmitQueryResultWithFileFromServlet extends BaseModelData
private List<String> attributes; private List<String> attributes;
private String convertedQuery; private String convertedQuery;
private String urlFile; private String urlFile;
private int submitQueryTotalRows;
public SubmitQueryResultWithFileFromServlet() { public SubmitQueryResultWithFileFromServlet() {
@ -27,11 +28,12 @@ public class SubmitQueryResultWithFileFromServlet extends BaseModelData
// } // }
public SubmitQueryResultWithFileFromServlet(List<String> attributes, public SubmitQueryResultWithFileFromServlet(List<String> attributes,
String query, String urlFile) { String query, String urlFile, int submitQueryTotalRows) {
set("attributes", attributes); set("attributes", attributes);
set("convertedQuery", query); set("convertedQuery", query);
// set("fileName", fileName); // set("fileName", fileName);
set("urlFile", urlFile); set("urlFile", urlFile);
set("submitQueryTotalRows", submitQueryTotalRows);
} }
@ -50,5 +52,9 @@ public class SubmitQueryResultWithFileFromServlet extends BaseModelData
public String getUrlFile(){ public String getUrlFile(){
return get("urlFile"); return get("urlFile");
} }
public int getSubmitQueryTotalRows(){
return get("submitQueryTotalRows");
}
} }

View File

@ -999,8 +999,10 @@ public class GxtBorderLayoutPanel extends ContentPanel {
// get path // get path
// String fileName = obj.getFileName(); // String fileName = obj.getFileName();
String urlFile = obj.getUrlFile(); String urlFile = obj.getUrlFile();
int submitQueryTotalRows = obj.getSubmitQueryTotalRows();
parseSubmitQueryResult(form, dialogID, parseSubmitQueryResult(form, dialogID,
listAttributes, query, urlFile, UID); listAttributes, query, urlFile, UID, submitQueryTotalRows);
} }
@ -1011,7 +1013,7 @@ public class GxtBorderLayoutPanel extends ContentPanel {
// start the parsing of the submit result in order to obtain a table // start the parsing of the submit result in order to obtain a table
private void parseSubmitQueryResult(Dialog dialog, final int dialogID, private void parseSubmitQueryResult(Dialog dialog, final int dialogID,
final List<String> listAttributes, String query, final String urlFile, final List<String> listAttributes, String query, final String urlFile,
final String UID) { final String UID, int submitQueryTotalRows) {
final Dialog form = dialog; final Dialog form = dialog;
// define the proxy and create the grid to display in the dialog // define the proxy and create the grid to display in the dialog
@ -1175,7 +1177,7 @@ public class GxtBorderLayoutPanel extends ContentPanel {
}; };
// submitResult.setLayout(new FitLayout()); // submitResult.setLayout(new FitLayout());
submitResult.setHeading("Result Query " + dialogID); submitResult.setHeading("Result Query " + dialogID+ " (Total Rows: "+submitQueryTotalRows+")");
submitResult.setResizable(false); submitResult.setResizable(false);
submitResult.setSize(600, 400); submitResult.setSize(600, 400);
submitResult.setScrollMode(Scroll.NONE); submitResult.setScrollMode(Scroll.NONE);

View File

@ -697,9 +697,11 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
removeJob(UID); removeJob(UID);
String urlFile=outputData.getUrlFile(); String urlFile=outputData.getUrlFile();
int submitQueryTotalRows = outputData.getSubmitQueryTotalRows();
result = new SubmitQueryResultWithFileFromServlet( result = new SubmitQueryResultWithFileFromServlet(
listAttributes, convertedQuery, urlFile); listAttributes, convertedQuery, urlFile,submitQueryTotalRows);
// put the two data in cache // put the two data in cache
net.sf.ehcache.Element dataToCache = new net.sf.ehcache.Element( net.sf.ehcache.Element dataToCache = new net.sf.ehcache.Element(
@ -1837,7 +1839,13 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
throw new Exception("Error in server while generating the file."); throw new Exception("Error in server while generating the file.");
} }
} else{ } else if(key.equals("Total Rows")){
//to recover the total number for the resutl of a submit query operation
SMResource smres = smMap.get(key);
SMObject obje = (SMObject) smres;
String outstring = obje.url();
outputData.setSubmitQueryTotalRows(Integer.parseInt(outstring));
}else{
// add key value // add key value
mapKeys.put(String.valueOf(i), key); mapKeys.put(String.valueOf(i), key);
SMResource smres = smMap.get(key); SMResource smres = smMap.get(key);