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

View File

@ -7,6 +7,7 @@ public class ComputationOutput {
private LinkedHashMap<String, String> mapValues;
private LinkedHashMap<String, String> mapKeys;
private String urlFile;
private int submitQueryTotalRows;
public ComputationOutput() {
mapKeys = new LinkedHashMap<String, String>();
@ -37,4 +38,12 @@ public class ComputationOutput {
public String getUrlFile(){
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 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;

View File

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

View File

@ -999,8 +999,10 @@ public class GxtBorderLayoutPanel extends ContentPanel {
// get path
// String fileName = obj.getFileName();
String urlFile = obj.getUrlFile();
int submitQueryTotalRows = obj.getSubmitQueryTotalRows();
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
private void parseSubmitQueryResult(Dialog dialog, final int dialogID,
final List<String> listAttributes, String query, final String urlFile,
final String UID) {
final String UID, int submitQueryTotalRows) {
final Dialog form = 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.setHeading("Result Query " + dialogID);
submitResult.setHeading("Result Query " + dialogID+ " (Total Rows: "+submitQueryTotalRows+")");
submitResult.setResizable(false);
submitResult.setSize(600, 400);
submitResult.setScrollMode(Scroll.NONE);

View File

@ -697,9 +697,11 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
removeJob(UID);
String urlFile=outputData.getUrlFile();
int submitQueryTotalRows = outputData.getSubmitQueryTotalRows();
result = new SubmitQueryResultWithFileFromServlet(
listAttributes, convertedQuery, urlFile);
listAttributes, convertedQuery, urlFile,submitQueryTotalRows);
// put the two data in cache
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.");
}
} 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
mapKeys.put(String.valueOf(i), key);
SMResource smres = smMap.get(key);