added logs
This commit is contained in:
parent
52ebe6d98e
commit
0e22394486
10
.classpath
10
.classpath
|
@ -6,13 +6,19 @@
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="optional" value="true"/>
|
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
<attribute name="test" value="true"/>
|
<attribute name="test" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
|
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="test" value="true"/>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
|
|
@ -3,27 +3,34 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<wb-module deploy-name="metadata-profile-form-builder-widget-0.1.0-SNAPSHOT">
|
<wb-module deploy-name="metadata-profile-form-builder-widget-0.1.0-SNAPSHOT">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||||
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/resources"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -33,14 +40,17 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<property name="java-output-path" value="/metadata-profile-form-builder-widget/target/classes"/>
|
<property name="java-output-path" value="/metadata-profile-form-builder-widget/target/classes"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</wb-module>
|
</wb-module>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</project-modules>
|
</project-modules>
|
||||||
|
|
1
pom.xml
1
pom.xml
|
@ -111,7 +111,6 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-fileupload</groupId>
|
<groupId>commons-fileupload</groupId>
|
||||||
<artifactId>commons-fileupload</artifactId>
|
<artifactId>commons-fileupload</artifactId>
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.portal</groupId>
|
<groupId>org.gcube.portal</groupId>
|
||||||
|
|
|
@ -6,8 +6,7 @@
|
||||||
<!-- Other module inherits -->
|
<!-- Other module inherits -->
|
||||||
<inherits name="com.github.gwtbootstrap.Bootstrap" />
|
<inherits name="com.github.gwtbootstrap.Bootstrap" />
|
||||||
<!-- Responsive design -->
|
<!-- Responsive design -->
|
||||||
<set-property name="bootstrap.responsiveDesign"
|
<!-- <set-property name="bootstrap.responsiveDesign" value="true" /> -->
|
||||||
value="true" />
|
|
||||||
<inherits
|
<inherits
|
||||||
name='com.github.gwtbootstrap.datetimepicker.Datetimepicker' />
|
name='com.github.gwtbootstrap.datetimepicker.Datetimepicker' />
|
||||||
<inherits name='com.github.gwtbootstrap.datepicker.Datepicker' />
|
<inherits name='com.github.gwtbootstrap.datepicker.Datepicker' />
|
||||||
|
@ -19,8 +18,7 @@
|
||||||
|
|
||||||
<inherits name='com.google.gwt.json.JSON' />
|
<inherits name='com.google.gwt.json.JSON' />
|
||||||
|
|
||||||
<inherits
|
<inherits name='org.gcube.portlets.widgets.openlayerbasicwidgets.olbasicwidgets' />
|
||||||
name='org.gcube.portlets.widgets.openlayerbasicwidgets.olbasicwidgets' />
|
|
||||||
|
|
||||||
<stylesheet src='MetadataProfileFormBuilder.css' />
|
<stylesheet src='MetadataProfileFormBuilder.css' />
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||||
xmlns:g="urn:import:com.google.gwt.user.client.ui">
|
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
||||||
|
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
|
||||||
<g:HTMLPanel>
|
<g:HTMLPanel>
|
||||||
<div class="bar-container">
|
<div class="bar-container">
|
||||||
<g:HTML styleName="progress myBackground" ui:field='progressBarContainer' >
|
<g:HTML styleName="progress myBackground"
|
||||||
|
ui:field='progressBarContainer'>
|
||||||
<span class="blue" style="width: 100%;">
|
<span class="blue" style="width: 100%;">
|
||||||
<span id="upload-percent-number">0%</span>
|
<span id="upload-percent-number">0%</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -3,6 +3,7 @@ package org.gcube.portlets.widgets.mpformbuilder.client.ui.upload;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.gcube.portlets.widgets.mpformbuilder.client.ConstantsMPFormBuilder;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.client.ui.upload.events.NotifyUploadEvent;
|
import org.gcube.portlets.widgets.mpformbuilder.client.ui.upload.events.NotifyUploadEvent;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.client.ui.upload.events.NotifyUploadEvent.UPLOAD_EVENT_TYPE;
|
import org.gcube.portlets.widgets.mpformbuilder.client.ui.upload.events.NotifyUploadEvent.UPLOAD_EVENT_TYPE;
|
||||||
|
|
||||||
|
@ -44,7 +45,7 @@ public class SingleUploadMonitor {
|
||||||
*/
|
*/
|
||||||
private void startTimer(TimerUpload timer){
|
private void startTimer(TimerUpload timer){
|
||||||
String clientUploadKey = timer.getInitWorkspaceUploader().getClientUploadKey();
|
String clientUploadKey = timer.getInitWorkspaceUploader().getClientUploadKey();
|
||||||
GWT.log("Starting new timer for key: "+clientUploadKey);
|
ConstantsMPFormBuilder.jslog("Starting new timer for key: "+clientUploadKey);
|
||||||
currentTimersRun.put(clientUploadKey, timer);
|
currentTimersRun.put(clientUploadKey, timer);
|
||||||
timer.scheduleRepeating(2000);
|
timer.scheduleRepeating(2000);
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,12 +56,17 @@ public class TimerUpload extends Timer{
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
|
ConstantsMPFormBuilder.jslog("Timer run called");
|
||||||
|
|
||||||
final SingleUploadMonitor monitor = SingleUploadMonitor.getInstance();
|
final SingleUploadMonitor monitor = SingleUploadMonitor.getInstance();
|
||||||
|
|
||||||
|
ConstantsMPFormBuilder.jslog("Calling getUpload Status...");
|
||||||
|
|
||||||
MetadataProfileFormBuilderServiceAsync.Util.getInstance().getUploadStatus(initWorkspaceUploader.getClientUploadKey(), new AsyncCallback<FileUploadingState>() {
|
MetadataProfileFormBuilderServiceAsync.Util.getInstance().getUploadStatus(initWorkspaceUploader.getClientUploadKey(), new AsyncCallback<FileUploadingState>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(final FileUploadingState result) {
|
public void onSuccess(final FileUploadingState result) {
|
||||||
|
ConstantsMPFormBuilder.jslog("getUploadStatus returned: "+result);
|
||||||
try{
|
try{
|
||||||
synchronized(this){
|
synchronized(this){
|
||||||
lastWorkspaceUploader = result;
|
lastWorkspaceUploader = result;
|
||||||
|
@ -110,7 +115,7 @@ public class TimerUpload extends Timer{
|
||||||
upv.update(result);;
|
upv.update(result);;
|
||||||
}else{
|
}else{
|
||||||
// monitor.deleteUploaderByClientKey(workspaceUploader.getClientUploadKey());
|
// monitor.deleteUploaderByClientKey(workspaceUploader.getClientUploadKey());
|
||||||
GWT.log("Timer is null or already closed or completed");
|
ConstantsMPFormBuilder.jslog("Timer is null or already closed or completed");
|
||||||
cancel();
|
cancel();
|
||||||
monitor.removeTimer(initWorkspaceUploader.getClientUploadKey());
|
monitor.removeTimer(initWorkspaceUploader.getClientUploadKey());
|
||||||
}
|
}
|
||||||
|
@ -140,7 +145,7 @@ public class TimerUpload extends Timer{
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void cancel() {
|
public void cancel() {
|
||||||
GWT.log("Cancelling timer for "+lastWorkspaceUploader);
|
ConstantsMPFormBuilder.jslog("Cancelling timer for "+lastWorkspaceUploader);
|
||||||
super.cancel();
|
super.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -531,6 +531,7 @@ public class MetadataProfileFormBuilderUploadServlet extends HttpServlet impleme
|
||||||
workspaceUploader.setStatusDescription("File uploaded correclty");
|
workspaceUploader.setStatusDescription("File uploaded correclty");
|
||||||
workspaceUploader.setUploadStatus(UPLOAD_STATUS.COMPLETED);
|
workspaceUploader.setUploadStatus(UPLOAD_STATUS.COMPLETED);
|
||||||
saveWorkspaceUploaderInSession(workspaceUploader, request.getSession());
|
saveWorkspaceUploaderInSession(workspaceUploader, request.getSession());
|
||||||
|
logger.info("File uploaded at: "+tempFile.getAbsolutePath());
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
workspaceUploader.setStatusDescription("Error on uploading: "+fileName+". "+e.getMessage());
|
workspaceUploader.setStatusDescription("Error on uploading: "+fileName+". "+e.getMessage());
|
||||||
workspaceUploader.setUploadStatus(UPLOAD_STATUS.FAILED);
|
workspaceUploader.setUploadStatus(UPLOAD_STATUS.FAILED);
|
||||||
|
|
|
@ -5,6 +5,8 @@ package org.gcube.portlets.widgets.mpformbuilder.shared.upload;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class FileUploaded.
|
* The Class FileUploaded.
|
||||||
|
@ -13,12 +15,13 @@ import java.io.Serializable;
|
||||||
*
|
*
|
||||||
* Oct 8, 2020
|
* Oct 8, 2020
|
||||||
*/
|
*/
|
||||||
public class FileUploaded implements Serializable{
|
public class FileUploaded implements Serializable, IsSerializable{
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = -3849355202624924112L;
|
private static final long serialVersionUID = -7869956386977214114L;
|
||||||
|
|
||||||
/** The file name. */
|
/** The file name. */
|
||||||
private String fileName;
|
private String fileName;
|
||||||
|
|
|
@ -17,11 +17,11 @@ import com.google.gwt.user.client.rpc.IsSerializable;
|
||||||
*/
|
*/
|
||||||
public class FileUploadingState implements Serializable, IsSerializable{
|
public class FileUploadingState implements Serializable, IsSerializable{
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = 2858520729654840274L;
|
private static final long serialVersionUID = 5634754596251776526L;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Enum UPLOAD_STATUS.
|
* The Enum UPLOAD_STATUS.
|
||||||
|
|
|
@ -4,18 +4,22 @@ import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class UploadProgress.
|
* The Class UploadProgress.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||||
* Sep 1, 2015
|
* Sep 1, 2015
|
||||||
*/
|
*/
|
||||||
public final class UploadProgress implements Serializable{
|
public final class UploadProgress implements Serializable, IsSerializable{
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = 419707497192632320L;
|
private static final long serialVersionUID = 8859140133243692103L;
|
||||||
|
|
||||||
private List<UploadEvent> events = new ArrayList<UploadEvent>();
|
private List<UploadEvent> events = new ArrayList<UploadEvent>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -6,8 +6,7 @@
|
||||||
<!-- Other module inherits -->
|
<!-- Other module inherits -->
|
||||||
<inherits name="com.github.gwtbootstrap.Bootstrap" />
|
<inherits name="com.github.gwtbootstrap.Bootstrap" />
|
||||||
<!-- Responsive design -->
|
<!-- Responsive design -->
|
||||||
<set-property name="bootstrap.responsiveDesign"
|
<!-- <set-property name="bootstrap.responsiveDesign" value="true" /> -->
|
||||||
value="true" />
|
|
||||||
<inherits
|
<inherits
|
||||||
name='com.github.gwtbootstrap.datetimepicker.Datetimepicker' />
|
name='com.github.gwtbootstrap.datetimepicker.Datetimepicker' />
|
||||||
<inherits name='com.github.gwtbootstrap.datepicker.Datepicker' />
|
<inherits name='com.github.gwtbootstrap.datepicker.Datepicker' />
|
||||||
|
@ -19,8 +18,7 @@
|
||||||
|
|
||||||
<inherits name='com.google.gwt.json.JSON' />
|
<inherits name='com.google.gwt.json.JSON' />
|
||||||
|
|
||||||
<inherits
|
<inherits name='org.gcube.portlets.widgets.openlayerbasicwidgets.olbasicwidgets' />
|
||||||
name='org.gcube.portlets.widgets.openlayerbasicwidgets.olbasicwidgets' />
|
|
||||||
|
|
||||||
<stylesheet src='MetadataProfileFormBuilder.css' />
|
<stylesheet src='MetadataProfileFormBuilder.css' />
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue