Rename package

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-csv-import-widget@84050 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2013-10-24 13:32:03 +00:00
parent 16551d535c
commit d00e34c8b3
47 changed files with 77 additions and 1664 deletions

View File

@ -1,41 +0,0 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.data;
import java.util.ArrayList;
import java.util.List;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
/**
* @author "Federico De Faveri defaveri@isti.cnr.it"
*
*/
public final class CSVData extends JavaScriptObject {
protected CSVData(){}
public static final native CSVData getCSVData(String json) /*-{
var data = eval('(' + json + ')');
return data;
}-*/;
public final List<CSVRow> getRows()
{
JsArray<CSVRow> jsRows = getJSRows();
List<CSVRow> rows = new ArrayList<CSVRow>(jsRows.length());
for (int i = 0; i < jsRows.length(); i++) {
rows.add(jsRows.get(i));
}
return rows;
}
protected final native JsArray<CSVRow> getJSRows() /*-{
return this['records'];
}-*/;
}

View File

@ -1,33 +0,0 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.data;
import com.google.gwt.core.client.JavaScriptObject;
/**
* @author "Federico De Faveri defaveri@isti.cnr.it"
*
*/
public final class CSVRow extends JavaScriptObject {
protected CSVRow(){}
/**
* @return the id
*/
public String getId() {
//FIXME
return getField("Id");
}
public native String getField(String column)
/*-{
return this[column];
}-*/;
}

View File

@ -1,22 +0,0 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.data;
import com.sencha.gxt.data.shared.ModelKeyProvider;
/**
* @author "Federico De Faveri defaveri@isti.cnr.it"
*
*/
public class CSVRowKeyProvider implements ModelKeyProvider<CSVRow> {
/**
* {@inheritDoc}
*/
@Override
public String getKey(CSVRow item) {
return item.getId();
}
}

View File

@ -1,47 +0,0 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.data;
import com.sencha.gxt.core.client.ValueProvider;
/**
* @author "Federico De Faveri defaveri@isti.cnr.it"
*
*/
public class CSVRowValueProvider implements ValueProvider<CSVRow, String> {
protected String column;
/**
* @param column
*/
public CSVRowValueProvider(String column) {
this.column = column;
}
/**
* {@inheritDoc}
*/
@Override
public String getValue(CSVRow row) {
return row.getField(column);
}
/**
* {@inheritDoc}
*/
@Override
public void setValue(CSVRow object, String value) {
}
/**
* {@inheritDoc}
*/
@Override
public String getPath() {
return column;
}
}

View File

@ -1,33 +0,0 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.general;
import com.google.gwt.user.client.ui.HTML;
import com.sencha.gxt.widget.core.client.ContentPanel;
/**
* A simple wizard card.
* @author Federico De Faveri defaveri@isti.cnr.it
*/
public class SimpleWizardCard extends WizardCard {
/**
* Create a new simple wizard card.
* @param title the card title.
* @param footer the card footer.
* @param content the card content.
*/
public SimpleWizardCard(String title, String footer, String content) {
super(title, footer);
ContentPanel contentPanel = new ContentPanel();
contentPanel.setHeaderVisible(false);
HTML htmlContent = new HTML(content);
htmlContent.setStyleName("wizard-simple-content");
contentPanel.add(htmlContent);
setContent(contentPanel);
}
}

View File

@ -1,273 +0,0 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.general;
import org.gcube.portlets.user.csvimportwizardtd.client.dataresource.ResourceBundle;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.ui.HTML;
import com.sencha.gxt.widget.core.client.Component;
import com.sencha.gxt.widget.core.client.ContentPanel;
import com.sencha.gxt.widget.core.client.container.BorderLayoutContainer;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
/**
* Represents a Wizard Card.
* @author Federico De Faveri defaveri@isti.cnr.it
*/
public class WizardCard extends BorderLayoutContainer {
private WizardWindow wizardWindow;
protected ContentPanel titlePanel;
protected ContentPanel footerPanel;
protected boolean calculateFooter = false;
protected HTML titleHtml;
protected HTML footerHtml;
final protected ResourceBundle res=ResourceBundle.INSTANCE;
/**
* Creates a new wizard card.
* The footer is automatically calculated.
* @param title the card title.
*/
public WizardCard(String title) {
this(title,"");
calculateFooter = true;
}
/**
* Creates a new wizard card.
* @param title the card title.
* @param footer the card footer.
*/
public WizardCard(String title, String footer) {
Log.info(title);
res.importCss().ensureInjected();
//add the title panel
titlePanel = new ContentPanel();
titlePanel.setHeight(30);
titlePanel.setBodyStyle("background-color:#C3D9FF");
titlePanel.setHeaderVisible(false);
titleHtml = new HTML(title);
titleHtml.setStylePrimaryName(res.importCss().getWizardTitle());
titlePanel.add(titleHtml);
setNorthWidget(titlePanel, new BorderLayoutData(30));
//add the footer panel
footerPanel = new ContentPanel();
footerPanel.setHeight(30);
footerPanel.setBodyStyle("background-color:#CDEB8B");
footerPanel.setHeaderVisible(false);
footerHtml = new HTML(footer);
footerHtml.setStylePrimaryName(res.importCss().getWizardFooter());
footerPanel.add(footerHtml);
setSouthWidget(footerPanel, new BorderLayoutData(30));
}
/**
* {@inheritDoc}
*/
public void setTitle(String title)
{
titleHtml.setHTML("<h1>"+title+"</h1>");
}
/**
* Sets the card footer.
* @param footer the footer.
*/
public void setFooter(String footer)
{
footerHtml.setHTML("<p>"+footer+"</p>");
}
/**
* Sets the card content.
* @param content the card content.
*/
public void setContent(Component content)
{
setCenterWidget(content);
}
/**
* Sets the card content.
* @param content the card content.
*/
public void setContent(com.google.gwt.user.client.ui.Panel content)
{
setCenterWidget(content);
}
/**
* Enables the next button.
* @param enable <code>true</code> to enable it, <code>false</code> otherwise.
*/
public void setEnableNextButton(boolean enable)
{
if (wizardWindow!=null){
wizardWindow.setEnableNextButton(enable);
}
}
/**
* Enables the back button.
* @param enable <code>true</code> to enable the button, <code>false</code> otherwise.
*/
public void setEnableBackButton(boolean enable)
{
if (wizardWindow!=null){
wizardWindow.setEnableBackButton(enable);
}
}
/**
* Sets the next button label.
* @param text the button label.
*/
public void setNextButtonText(String text)
{
if (wizardWindow!=null){
wizardWindow.setNextButtonText(text);
}
}
/**
* Sets the back button label.
* @param text the button label.
*/
public void setBackButtonText(String text)
{
if (wizardWindow!=null){
wizardWindow.setBackButtonText(text);
}
}
/**
* Visible the next button.
* @param visible <code>true</code> to show the button, <code>false</code> otherwise.
*/
public void setNextButtonVisible(boolean visible)
{
if (wizardWindow!=null){
wizardWindow.setNextButtonVisible(visible);
}
}
/**
* Visible the back button.
* @param visible <code>true</code> to show the button, <code>false</code> otherwise.
*/
public void setBackButtonVisible(boolean visible)
{
if (wizardWindow!=null){
wizardWindow.setBackButtonVisible(visible);
}
}
public void setNextButtonToFinish()
{
if (wizardWindow!=null){
wizardWindow.setNextButtonToFinish();
}
}
/**
* Sets the WizardWindow for this import card.
* @param wizardWindow the WizardWindow.
*/
protected void setWizardWindow(WizardWindow wizardWindow)
{
this.wizardWindow = wizardWindow;
if (calculateFooter) {
StringBuilder footer = new StringBuilder();
footer.append("Step ");
footer.append(getCardPosition());
footer.append(" of ");
footer.append(getCardSize());
setFooter(footer.toString());
}
}
/**
* Returns the current wizard window.
* @return the wizard window.
*/
protected WizardWindow getWizardWindow()
{
if (wizardWindow==null) throw new IllegalStateException("No Wizard Window setup");
return wizardWindow;
}
public void addToWindowTitle(String toAdd)
{
wizardWindow.setTitle(wizardWindow.getOriginalTitle()+toAdd);
}
/**
* Called before the card is showed.
*/
public void setup()
{
}
/**
* Called when the card is disposed.
*/
public void dispose()
{}
/**
* Add a listener to the next button.
* @param listener the listener to add.
*/
public void addNextButtonListener(SelectHandler listener)
{
if (wizardWindow!=null){
wizardWindow.addNextButtonListener(listener);
}
}
/**
* Gets the number of cards in the wizard window.
* @return the number of cards.
*/
public int getCardSize()
{
return getWizardWindow().getCardStackSize();
}
/**
* Returns this card position on card list.
* @return the card position on the card stack.
*/
public int getCardPosition()
{
int indexPosition = getWizardWindow().getCardStack().indexOf(this);
return (indexPosition>=0)?indexPosition+1:indexPosition;
}
public void showErrorAndHide(String title, final String failureReason, final String failureDetails, final Throwable throwable)
{
wizardWindow.showErrorAndHide(title, failureReason, failureDetails, throwable);
}
public void hideWindow()
{
wizardWindow.hide();
}
}

View File

@ -1,33 +0,0 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.general;
import org.gcube.portlets.user.td.gwtservice.shared.TRId;
/**
* @author "Federico De Faveri defaveri@isti.cnr.it"
*
*/
public interface WizardListener {
/**
* Called when the wizard is completed without errors
*/
public void completed(TRId id);
/**
* Called when the wizard has been aborted by the user.
*/
public void aborted();
/**
* Called when the something in the wizard is failed.
* @param throwable the exception or <code>null</code>.
* @param reason the failure reason or <code>null</code>.
* @param details the failure details or <code>null</code>.
*/
public void failed(Throwable throwable, String reason, String details);
}

View File

@ -1,445 +0,0 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.general;
import java.util.ArrayList;
import org.gcube.portlets.user.csvimportwizardtd.client.util.ErrorMessageBox;
import org.gcube.portlets.user.td.gwtservice.shared.TRId;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.Callback;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.ui.Widget;
import com.google.web.bindery.event.shared.SimpleEventBus;
import com.sencha.gxt.core.client.resources.ThemeStyles;
import com.sencha.gxt.widget.core.client.Dialog;
import com.sencha.gxt.widget.core.client.Window;
import com.sencha.gxt.widget.core.client.button.TextButton;
import com.sencha.gxt.widget.core.client.container.CardLayoutContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
import com.sencha.gxt.widget.core.client.toolbar.FillToolItem;
import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
/**
* A generic Wizard Window.
* @author Federico De Faveri defaveri@isti.cnr.it
*/
public class WizardWindow extends Window {
protected ArrayList<WizardCard> cardStack = new ArrayList<WizardCard>();
protected TextButton backButton;
protected TextButton nextButton;
protected String originalTitle;
protected boolean checkBeforeClose = true;
protected boolean nextCardFinish = false;
protected Command nextButtonAction = null;
protected Command previousButtonAction = null;
protected CardLayoutContainer cardContainer;
protected ArrayList<WizardListener> listeners;
protected SimpleEventBus eventBus;
/**
* Create a new Wizard Window with the specified title.
* @param title the wizard window title.
*/
public WizardWindow(String title)
{
super();
this.eventBus= new SimpleEventBus();
Log.info(title);
//setModal(true);
setResizable(true);
setCollapsible(true);
listeners = new ArrayList<WizardListener>();
setHeadingText(title);
this.originalTitle = title;
VerticalLayoutContainer container = new VerticalLayoutContainer();
cardContainer = new CardLayoutContainer();
container.add(cardContainer, new VerticalLayoutData(1, 1));
ToolBar toolbar = new ToolBar();
toolbar.addStyleName(ThemeStyles.getStyle().borderTop());
backButton = new TextButton("Back");
backButton.setEnabled(false);
backButton.setTabIndex(1001);
toolbar.add(backButton);
toolbar.add(new FillToolItem());
nextButton = new TextButton("Next");
nextButton.setTabIndex(1000);
toolbar.add(nextButton);
toolbar.setLayoutData(new VerticalLayoutData(1, -1));
container.add(toolbar);
SelectHandler selectionHandler = new SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
TextButton button = (TextButton)event.getSource();
String btnID = button.getId();
if (btnID.equals(backButton.getId())) {
if(previousButtonAction!=null) previousButtonAction.execute();
else previousCard();
} else {
if (nextButtonAction!=null) nextButtonAction.execute();
else nextCard();
}
}
};
backButton.addSelectHandler(selectionHandler);
nextButton.addSelectHandler(selectionHandler);
setWidget(container);
}
/**
* {@inheritDoc}
*/
@Override
protected void initTools() {
super.initTools();
//we can't distinguish between hide and hide with button
/*closeBtn.removeAllListeners();
closeBtn.addListener(Events.Select, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent ce) {
MessageBox.confirm("Confirm", "Are you sure to cancel the operation?", new Listener<MessageBoxEvent>() {
@Override
public void handleEvent(MessageBoxEvent be) {
if (be.getButtonClicked().getItemId().equals(Dialog.YES)) {
hide();
fireAborted();
}
}
});
}
});*/
}
public void addListener(WizardListener listener)
{
listeners.add(listener);
}
public void removeListener(WizardListener listener)
{
listeners.remove(listener);
}
/**
* Shows the next available card.
*/
public void nextCard()
{
Widget activeItem = cardContainer.getActiveWidget();
if (activeItem instanceof WizardCard) ((WizardCard)activeItem).dispose();
int cardPos = cardStack.indexOf(activeItem);
//NEXT ->
nextButton.setEnabled(true);
backButton.setEnabled(true);
int newPos=cardPos+1;
if (newPos == 0) {
//we are moving forward from the first card
backButton.setEnabled(false);
}
nextButtonAction=null;
previousButtonAction=null;
Log.info("cardStack size:"+cardStack.size());
WizardCard card = cardStack.get(newPos);
cardContainer.setActiveWidget(card);
doLayout();
if (card instanceof WizardCard) ((WizardCard)card).setup();
}
/**
* Shows the previous available card.
*/
public void previousCard()
{
Widget activeItem = cardContainer.getActiveWidget();
if (activeItem instanceof WizardCard) ((WizardCard)activeItem).dispose();
int cardPos = cardStack.indexOf(activeItem);
//BACK <-
nextButton.setEnabled(true);
backButton.setEnabled(true);
int newPos=cardPos-1;
if (newPos == 0) {
backButton.setEnabled(false);
}
nextButtonAction=null;
previousButtonAction=null;
WizardCard card = cardStack.get(newPos);
cardContainer.setActiveWidget(card);
doLayout();
if (card instanceof WizardCard) ((WizardCard)card).setup();
}
/**
* Returns the number of available cards.
* @return
*/
public int getCardStackSize()
{
return cardStack.size();
}
/**
* Returns the current active card.
* @return
*/
public int getCurrentCard()
{
return cardStack.indexOf(cardContainer.getActiveWidget());
}
public boolean checkBeforeClose()
{
return true;
}
public void close(boolean check) {
checkBeforeClose = check;
hide();
}
/**
* Sets the label of next button to "Finish" value and add a close command to it.
*/
public void setNextButtonToFinish()
{
nextButton.setText("Finish");
nextButtonAction = new Command() {
public void execute() {
close(false);
}
};
}
/**
* Set the command for the next button.
* @param command the command to execute.
*/
public void setNextButtonCommand(Command command)
{
nextButtonAction = command;
}
/**
* Set the command for the previous button.
* @param command the command to execute.
*/
public void setPreviousButtonCommand(Command command)
{
previousButtonAction = command;
}
/**
* {@inheritDoc}
*/
@Override
public void show() {
super.show();
Widget activeItem = cardContainer.getActiveWidget();
if (activeItem instanceof WizardCard) ((WizardCard)activeItem).setup();
}
/**
* Set the card list.
* @param cards
*/
public void setCards(ArrayList<WizardCard> cards)
{
for (WizardCard card:cards) {
addCard(card);
}
}
/**
* Adds a card to this wizard.
* @param card the card to add.
*/
public void addCard(WizardCard card)
{
card.setWizardWindow(this);
cardContainer.add(card);
cardStack.add(card);
}
/**
* Remove a card to this wizard.
* @param card the card to add.
*/
public void removeCard(WizardCard card)
{
cardContainer.remove(card);
cardStack.remove(card);
}
/**
* Enables the next button on the wizard.
* @param enable <code>true</code> to enable the next button, <code>false</code> otherwise.
*/
public void setEnableNextButton(boolean enable)
{
nextButton.setEnabled(enable);
}
/**
* Enables the back button on the wizard.
* @param enable <code>true</code> to enable the back button, <code>false</code> otherwise.
*/
public void setEnableBackButton(boolean enable)
{
backButton.setEnabled(enable);
}
/**
* Sets the next button label.
* @param text the button label.
*/
protected void setNextButtonText(String text)
{
nextButton.setText(text);
}
/**
* Sets the back button label.
* @param text the button label.
*/
protected void setBackButtonText(String text)
{
backButton.setText(text);
}
/**
* Sets visible next button.
* @param visible
*/
protected void setNextButtonVisible(boolean visible)
{
nextButton.setVisible(visible);
}
/**
* Sets visible back button.
* @param visible
*/
protected void setBackButtonVisible(boolean visible)
{
backButton.setVisible(visible);
}
/**
* Add a listener to the next button.
* @param listener the listener to add.
*/
protected void addNextButtonListener(SelectHandler listener)
{
nextButton.addSelectHandler(listener);
}
/**
* @return the originalTitle
*/
public String getOriginalTitle() {
return originalTitle;
}
/**
* Returns the card list.
* @return teh card list.
*/
public ArrayList<WizardCard> getCardStack()
{
return cardStack;
}
public void showErrorAndHide(String title, final String failureReason, final String failureDetails, final Throwable throwable)
{
ErrorMessageBox.showError(title, failureReason, failureDetails, new Callback<Dialog, Void>() {
@Override
public void onSuccess(Dialog result) {
}
@Override
public void onFailure(Void reason) {
hide();
fireFailed(throwable, failureReason, failureDetails);
}
});
}
public void fireCompleted(TRId id)
{
for (WizardListener listener:listeners) listener.completed(id);
}
public void fireAborted()
{
for (WizardListener listener:listeners) listener.aborted();
}
public void fireFailed(Throwable throwable, String reason, String details)
{
for (WizardListener listener:listeners) listener.failed(throwable, reason, details);
}
}

View File

@ -1,87 +0,0 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.progress;
import org.gcube.portlets.user.td.gwtservice.shared.TRId;
import com.allen_sauer.gwt.log.client.Log;
import com.sencha.gxt.widget.core.client.ProgressBar;
/**
* Updates a {@link ProgressBar} progress and text based on {@link CSVImportProgressListener} events.
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class CSVImportProgressBarUpdater implements CSVImportProgressListener {
protected ProgressBar progressBar;
//protected FramedPanel operationResult;
//protected WizardWindow wizardWindow;
/**
* Creates a new {@link ProgressBar} updater.
* @param progressBar the {@link ProgressBar} to update.
*/
public CSVImportProgressBarUpdater(ProgressBar progressBar) {
this.progressBar = progressBar;
//this.wizardWindow = w;
//this.operationResult = operationResult;
}
/**
* {@inheritDoc}
*/
@Override
public void operationComplete(TRId trId) {// TODO Auto-generated method stub
Log.info("Import complete");
progressBar.updateProgress(1, "Import complete.");
/*final FlexTable descriptionResult = new FlexTable();
descriptionResult.setCellSpacing(10);
descriptionResult.setCellPadding(4);
descriptionResult.setBorderWidth(0);
descriptionResult.setText(0, 0, "Result: ");
descriptionResult.setText(0, 1, "Import complete");
operationResult.add(descriptionResult);
operationResult.setVisible(true);
*/
//wizardWindow.setEnableNextButton(true);
}
/**
* {@inheritDoc}
*/
@Override
public void operationFailed(Throwable caught, String reason, String failureDetails) {
Log.info("Import failed");
progressBar.updateText("Import failed.");
}
@Override
public void operationInitializing() {
Log.info("Inport inizializing");
progressBar.updateProgress(0, "initializing...");
}
@Override
public void operationUpdate(float elaborated) {
Log.info("Import elaborated: "+elaborated);
if (elaborated == 0) progressBar.updateProgress(0, "initializing...");
if (elaborated>0 && elaborated<1) {
Log.trace("progress "+elaborated);
int elab=new Float(elaborated*100).intValue();
progressBar.updateProgress(elaborated,elab+"% importing...");
}
if (elaborated == 1) progressBar.updateProgress(1, "completing...");
}
}

View File

@ -1,42 +0,0 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.progress;
import org.gcube.portlets.user.td.gwtservice.shared.TRId;
/**
* Defines a listener for operation progress.
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface CSVImportProgressListener {
/**
* Called when the operation is starting.
*/
public void operationInitializing();
/**
* Called when there is a progress for the operation.
* @param elaborated the elaborated part.
*/
public void operationUpdate(float elaborated);
/**
* Called when the operation is complete.
*/
public void operationComplete(TRId trId);
/**
* Called when the operation is failed.
* @param caught the failure exception.
* @param reason the failure reason.
*/
public void operationFailed(Throwable caught, String reason, String failureDetails);
}

View File

@ -1,124 +0,0 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.progress;
import java.util.ArrayList;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.TRId;
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportMonitor;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.rpc.AsyncCallback;
/**
* This {@link Timer} retrieves {@link OperationProgress} from the specified {@link OperationProgressSource} with the scheduled interval.
* The retrieved information are spread to the subscribed {@link CSVImportProgressListener}.
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class CSVImportProgressUpdater extends Timer {
protected ArrayList<CSVImportProgressListener> listeners = new ArrayList<CSVImportProgressListener>();
/**
* {@inheritDoc}
*/
@Override
public void run() {
Log.debug("requesting operation progress");
TDGWTServiceAsync.INSTANCE.getCSVImportMonitor(new AsyncCallback<CSVImportMonitor>() {
@Override
public void onFailure(Throwable caught) {
cancel();
Log.error("Error retrieving the operation state", caught);
String message = getStack(caught);
fireOperationFailed(caught, "Failed getting operation updates", message);
}
@Override
public void onSuccess(CSVImportMonitor result) {
Log.info("retrieved CSVImportMonitor: "+result.getState());
switch (result.getState()) {
case INPROGRESS:
fireOperationUpdate(result.getElaboratedLenght());
break;
case FAILED:
cancel();
fireOperationFailed(new Throwable("Failed Client Library Import") ,result.getFailureReason(), result.getFailureDetails());
break;
case COMPLETED:
cancel();
//Log.info("Import fisnish TableId :"+result.getTrId());
//fireOperationComplete(result.getTrId());
break;
default:
break;
}
}
});
}
protected String getStack(Throwable e)
{
String message = e.getLocalizedMessage()+" -> <br>";
Throwable c = e.getCause();
if (c!=null) message += getStack(c);
return message;
}
protected void fireOperationInitializing()
{
for (CSVImportProgressListener listener:listeners) listener.operationInitializing();
}
protected void fireOperationUpdate(float elaborated)
{
for (CSVImportProgressListener listener:listeners) listener.operationUpdate(elaborated);
}
protected void fireOperationComplete(TRId trId)
{
for (CSVImportProgressListener listener:listeners) listener.operationComplete(trId);
}
protected void fireOperationFailed(Throwable caught, String failure, String failureDetails)
{
for (CSVImportProgressListener listener:listeners) listener.operationFailed(caught, failure, failureDetails);
}
/**
* Add a new {@link CSVImportProgressListener} to this {@link CSVImportProgressUpdater}.
* @param listener the listener to add.
*/
public void addListener(CSVImportProgressListener listener)
{
listeners.add(listener);
}
/**
* Removes the specified {@link CSVImportProgressListener} from this {@link CSVImportProgressUpdater}.
* @param listener the listener to remove.
*/
public void removeListener(CSVImportProgressListener listener)
{
listeners.remove(listener);
}
}

View File

@ -1,82 +0,0 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.progress;
import com.allen_sauer.gwt.log.client.Log;
import com.sencha.gxt.widget.core.client.ProgressBar;
/**
* Updates a {@link ProgressBar} progress and text based on {@link CSVImportProgressListener} events.
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class FileUploadProgressBarUpdater implements FileUploadProgressListener {
protected ProgressBar progressBar;
/**
* Creates a new {@link ProgressBar} updater.
* @param progressBar the {@link ProgressBar} to update.
*/
public FileUploadProgressBarUpdater(ProgressBar progressBar) {
this.progressBar = progressBar;
//this.wizardWindow = w;
//this.operationResult = operationResult;
}
/**
* {@inheritDoc}
*/
@Override
public void operationComplete() {// TODO Auto-generated method stub
Log.info("File upload complete");
progressBar.updateProgress(1, "File upload complete.");
/*final FlexTable descriptionResult = new FlexTable();
descriptionResult.setCellSpacing(10);
descriptionResult.setCellPadding(4);
descriptionResult.setBorderWidth(0);
descriptionResult.setText(0, 0, "Result: ");
descriptionResult.setText(0, 1, "Import complete");
operationResult.add(descriptionResult);
operationResult.setVisible(true);
*/
//wizardWindow.setEnableNextButton(true);
}
/**
* {@inheritDoc}
*/
@Override
public void operationFailed(Throwable caught, String reason, String failureDetails) {
Log.info("File upload failed");
progressBar.updateText("File upload failed.");
}
@Override
public void operationInitializing() {
Log.info("File upload inizializing");
progressBar.updateProgress(0, "initializing...");
}
@Override
public void operationUpdate(float elaborated) {
Log.info("File upload elaborated: "+elaborated);
if (elaborated == 0) progressBar.updateProgress(0, "initializing...");
if (elaborated>0 && elaborated<1) {
Log.trace("progress "+elaborated);
int elab=new Float(elaborated*100).intValue();
progressBar.updateProgress(elaborated,elab+"% uploading...");
}
if (elaborated == 1) progressBar.updateProgress(1, "completing...");
}
}

View File

@ -1,48 +0,0 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.progress;
import com.allen_sauer.gwt.log.client.Log;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class FileUploadProgressCardUpdater implements FileUploadProgressListener {
/**
*
*/
public FileUploadProgressCardUpdater() {
}
@Override
public void operationComplete() {
Log.info("File upload complete");
}
/**
* {@inheritDoc}
*/
@Override
public void operationFailed(Throwable caught, String reason, String failureDetails) {
Log.info("File upload failed");
}
@Override
public void operationInitializing() {
Log.info("File upload inizializing");
}
@Override
public void operationUpdate(float elaborated) {
Log.info("File uploading: "+elaborated);
}
}

View File

@ -1,41 +0,0 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.progress;
/**
* Defines a listener for operation progress.
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface FileUploadProgressListener {
/**
* Called when the operation is starting.
*/
public void operationInitializing();
/**
* Called when there is a progress for the operation.
* @param elaborated the elaborated part.
*/
public void operationUpdate(float elaborated);
/**
* Called when the operation is complete.
*/
public void operationComplete();
/**
* Called when the operation is failed.
* @param caught the failure exception.
* @param reason the failure reason.
*/
public void operationFailed(Throwable caught, String reason, String failureDetails);
}

View File

@ -1,125 +0,0 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.progress;
import java.util.ArrayList;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.file.FileUploadMonitor;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.rpc.AsyncCallback;
/**
* This {@link Timer} retrieves {@link OperationProgress} from the specified {@link OperationProgressSource} with the scheduled interval.
* The retrieved information are spread to the subscribed {@link CSVImportProgressListener}.
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class FileUploadProgressUpdater extends Timer {
protected ArrayList<FileUploadProgressListener> listeners = new ArrayList<FileUploadProgressListener>();
/**
* {@inheritDoc}
*/
@Override
public void run() {
Log.debug("requesting operation progress");
TDGWTServiceAsync.INSTANCE.getFileUploadMonitor(new AsyncCallback<FileUploadMonitor>() {
@Override
public void onFailure(Throwable caught) {
cancel();
Log.error("Error retrieving the operation state", caught);
String message = getStack(caught);
fireOperationFailed(caught, "Failed getting operation updates", message);
}
@Override
public void onSuccess(FileUploadMonitor result) {
Log.info("retrieved FileUploadMonitor: "+result.getState());
switch (result.getState()) {
case STARTED:
Log.info("File Upload Started");
break;
case INPROGRESS:
fireOperationUpdate(result.getElaboratedLenght());
break;
case FAILED:
cancel();
fireOperationFailed(new Throwable("Failed Client Library Import") ,result.getFailureReason(), result.getFailureDetails());
break;
case COMPLETED:
cancel();
Log.info("File Upload Completed");
fireOperationComplete();
break;
default:
break;
}
}
});
}
protected String getStack(Throwable e)
{
String message = e.getLocalizedMessage()+" -> <br>";
Throwable c = e.getCause();
if (c!=null) message += getStack(c);
return message;
}
protected void fireOperationInitializing()
{
for (FileUploadProgressListener listener:listeners) listener.operationInitializing();
}
protected void fireOperationUpdate(float elaborated)
{
for (FileUploadProgressListener listener:listeners) listener.operationUpdate(elaborated);
}
protected void fireOperationComplete()
{
for (FileUploadProgressListener listener:listeners) listener.operationComplete();
}
protected void fireOperationFailed(Throwable caught, String failure, String failureDetails)
{
for (FileUploadProgressListener listener:listeners) listener.operationFailed(caught, failure, failureDetails);
}
/**
* Add a new {@link CSVImportProgressListener} to this {@link FileUploadProgressUpdater}.
* @param listener the listener to add.
*/
public void addListener(FileUploadProgressListener listener)
{
listeners.add(listener);
}
/**
* Removes the specified {@link CSVImportProgressListener} from this {@link FileUploadProgressUpdater}.
* @param listener the listener to remove.
*/
public void removeListener(FileUploadProgressListener listener)
{
listeners.remove(listener);
}
}

View File

@ -1,72 +0,0 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.util;
import com.google.gwt.core.client.Callback;
import com.google.gwt.user.client.ui.Label;
import com.sencha.gxt.widget.core.client.Dialog;
import com.sencha.gxt.widget.core.client.Dialog.PredefinedButton;
import com.sencha.gxt.widget.core.client.box.MessageBox;
import com.sencha.gxt.widget.core.client.event.HideEvent;
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ErrorMessageBox {
private static final String DETAILS = "Details";
public static void showError(String title, String failureReason, final String failureDetails)
{
showError(title, failureReason, failureDetails, new NOPCallBack<Dialog, Void>());
}
public static void showError(String title, String failureReason, final String failureDetails, final Callback<Dialog, Void> callback)
{
final MessageBox box = new MessageBox(title);
box.setMessage(failureReason);
box.addHideHandler(new HideHandler() {
@Override
public void onHide(HideEvent event) {
Dialog dialog = (Dialog) event.getSource();
if (dialog.getHideButton().getText().equals(DETAILS)){
//box.close();
showErrorDetails("Error details", failureDetails);
} else callback.onSuccess(dialog);
}
});
/*FIXME box.setIcon(MessageBox.ERROR);
box.getDialog().cancelText = DETAILS;
box.getDialog().setButtons(MessageBox.OKCANCEL);*/
box.show();
}
public static void showErrorDetails(String title, String failureDetails)
{
final Dialog simple = new Dialog();
simple.setHeadingText(title);
simple.setPredefinedButtons(PredefinedButton.OK);
simple.setBodyStyleName("pad-text");
simple.add(new Label("<PRE>"+failureDetails+"</PRE>"));
//simple.getItem(0).getFocusSupport().setIgnore(true);
//FIXME simple.setScrollMode(ScrollMode.AUTO);
simple.setHideOnButtonClick(true);
simple.setWidth(400);
simple.setHeight(400);
simple.show();
}
}

View File

@ -1,35 +0,0 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.util;
/**
* @author Federico De Faveri defaveri@isti.cnr.it
*
*/
public class Format {
/**
* Converts a file size into a {@link String} representation adding the misure unit.
* @param size the file size.
* @return the textual representation.
*/
public static String fileSize(long size) {
StringBuilder text = new StringBuilder();
if (size < 1024) {
text.append(size);
text.append(" bytes");
} else if (size < 1048576) {
text.append(Math.round(((size * 10) / 1024)) / 10);
text.append(" KB");
} else if (size < 1073741824) {
text.append(Math.round(((size * 10) / 1048576)) / 10);
text.append(" MB");
} else {
text.append(Math.round(((size * 10) / 1073741824)) / 10);
text.append(" GB");
}
return text.toString();
}
}

View File

@ -1,20 +0,0 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.util;
import com.google.gwt.core.client.Callback;
/**
* @author "Federico De Faveri defaveri@isti.cnr.it"
*
*/
public class NOPCallBack<T,F> implements Callback<T, F> {
@Override
public void onFailure(F reason) {}
@Override
public void onSuccess(T result) {}
}

View File

@ -1,10 +1,10 @@
package org.gcube.portlets.user.csvimportwizardtd.client;
package org.gcube.portlets.user.td.csvimportwidget.client;
import java.util.ArrayList;
import org.gcube.portlets.user.csvimportwizardtd.client.csvgrid.CSVGrid;
import org.gcube.portlets.user.csvimportwizardtd.client.general.WizardCard;
import org.gcube.portlets.user.csvimportwizardtd.client.util.ErrorMessageBox;
import org.gcube.portlets.user.td.csvimportwidget.client.csvgrid.CSVGrid;
import org.gcube.portlets.user.td.csvimportwidget.client.general.WizardCard;
import org.gcube.portlets.user.td.csvimportwidget.client.util.ErrorMessageBox;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.csv.AvailableCharsetList;
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportSession;

View File

@ -1,4 +1,4 @@
package org.gcube.portlets.user.csvimportwizardtd.client;
package org.gcube.portlets.user.td.csvimportwidget.client;
import java.util.ArrayList;
@ -21,7 +21,9 @@ import com.sencha.gxt.widget.core.client.grid.ColumnModel;
import com.sencha.gxt.widget.core.client.grid.Grid;
/**
* @author Federico De Faveri defaveri@isti.cnr.it
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class CSVErrorWindow extends Window {

View File

@ -1,6 +1,6 @@
package org.gcube.portlets.user.csvimportwizardtd.client;
package org.gcube.portlets.user.td.csvimportwidget.client;
import org.gcube.portlets.user.csvimportwizardtd.client.general.WizardWindow;
import org.gcube.portlets.user.td.csvimportwidget.client.general.WizardWindow;
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportSession;
import com.allen_sauer.gwt.log.client.Log;

View File

@ -1,4 +1,4 @@
package org.gcube.portlets.user.csvimportwizardtd.client;
package org.gcube.portlets.user.td.csvimportwidget.client;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.EntryPoint;

View File

@ -1,9 +1,9 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client;
package org.gcube.portlets.user.td.csvimportwidget.client;
import org.gcube.portlets.user.csvimportwizardtd.client.general.WizardCard;
import org.gcube.portlets.user.td.csvimportwidget.client.general.WizardCard;
import org.gcube.portlets.user.td.gwtservice.shared.TabResource;
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportSession;

View File

@ -1,9 +1,9 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client;
package org.gcube.portlets.user.td.csvimportwidget.client;
import org.gcube.portlets.user.csvimportwizardtd.client.general.WizardCard;
import org.gcube.portlets.user.td.csvimportwidget.client.general.WizardCard;
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportSession;
import com.allen_sauer.gwt.log.client.Log;

View File

@ -1,9 +1,9 @@
package org.gcube.portlets.user.csvimportwizardtd.client;
package org.gcube.portlets.user.td.csvimportwidget.client;
import java.util.ArrayList;
import org.gcube.portlets.user.csvimportwizardtd.client.dataresource.ResourceBundle;
import org.gcube.portlets.user.td.csvimportwidget.client.dataresource.ResourceBundle;
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVRowError;
import com.google.gwt.event.dom.client.ClickEvent;

View File

@ -1,13 +1,13 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client;
package org.gcube.portlets.user.td.csvimportwidget.client;
import org.gcube.portlets.user.csvimportwizardtd.client.dataresource.ResourceBundle;
import org.gcube.portlets.user.csvimportwizardtd.client.general.WizardCard;
import org.gcube.portlets.user.csvimportwizardtd.client.progress.FileUploadProgressBarUpdater;
import org.gcube.portlets.user.csvimportwizardtd.client.progress.FileUploadProgressListener;
import org.gcube.portlets.user.csvimportwizardtd.client.progress.FileUploadProgressUpdater;
import org.gcube.portlets.user.td.csvimportwidget.client.general.WizardCard;
import org.gcube.portlets.user.td.csvimportwidget.client.progress.FileUploadProgressBarUpdater;
import org.gcube.portlets.user.td.csvimportwidget.client.progress.FileUploadProgressListener;
import org.gcube.portlets.user.td.csvimportwidget.client.progress.FileUploadProgressUpdater;
import org.gcube.portlets.user.td.csvimportwidget.client.dataresource.ResourceBundle;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;

View File

@ -1,9 +1,9 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client;
package org.gcube.portlets.user.td.csvimportwidget.client;
import org.gcube.portlets.user.csvimportwizardtd.client.general.WizardCard;
import org.gcube.portlets.user.td.csvimportwidget.client.general.WizardCard;
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportSession;
import org.gcube.portlets.user.td.gwtservice.shared.source.FileSource;

View File

@ -5,9 +5,9 @@ package org.gcube.portlets.user.td.csvimportwidget.client.csvgrid;
import java.util.ArrayList;
import org.gcube.portlets.user.csvimportwizardtd.client.data.CSVRow;
import org.gcube.portlets.user.csvimportwizardtd.client.data.CSVRowKeyProvider;
import org.gcube.portlets.user.csvimportwizardtd.client.data.CSVRowValueProvider;
import org.gcube.portlets.user.td.csvimportwidget.client.data.CSVRow;
import org.gcube.portlets.user.td.csvimportwidget.client.data.CSVRowKeyProvider;
import org.gcube.portlets.user.td.csvimportwidget.client.data.CSVRowValueProvider;
import com.allen_sauer.gwt.log.client.Log;

View File

@ -5,7 +5,7 @@ package org.gcube.portlets.user.td.csvimportwidget.client.csvgrid;
import java.util.ArrayList;
import org.gcube.portlets.user.csvimportwizardtd.client.data.CSVRow;
import org.gcube.portlets.user.td.csvimportwidget.client.data.CSVRow;
import org.gcube.portlets.user.td.csvimportwidget.client.dataresource.ResourceBundle;
import com.google.gwt.event.logical.shared.SelectionEvent;

View File

@ -3,15 +3,17 @@
*/
package org.gcube.portlets.user.td.csvimportwidget.client.csvgrid;
import org.gcube.portlets.user.csvimportwizardtd.client.data.CSVData;
import org.gcube.portlets.user.csvimportwizardtd.client.data.CSVRow;
import org.gcube.portlets.user.td.csvimportwidget.client.data.CSVData;
import org.gcube.portlets.user.td.csvimportwidget.client.data.CSVRow;
import com.sencha.gxt.data.shared.loader.DataReader;
import com.sencha.gxt.data.shared.loader.ListLoadResult;
import com.sencha.gxt.data.shared.loader.ListLoadResultBean;
/**
* @author "Federico De Faveri defaveri@isti.cnr.it"
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class CSVJsonReader implements DataReader<ListLoadResult<CSVRow>, String> {

View File

@ -1,7 +1,7 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.data;
package org.gcube.portlets.user.td.csvimportwidget.client.data;
import java.util.ArrayList;
import java.util.List;
@ -10,7 +10,9 @@ import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
/**
* @author "Federico De Faveri defaveri@isti.cnr.it"
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public final class CSVData extends JavaScriptObject {

View File

@ -1,12 +1,14 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.data;
package org.gcube.portlets.user.td.csvimportwidget.client.data;
import com.google.gwt.core.client.JavaScriptObject;
/**
* @author "Federico De Faveri defaveri@isti.cnr.it"
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public final class CSVRow extends JavaScriptObject {

View File

@ -1,7 +1,7 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.data;
package org.gcube.portlets.user.td.csvimportwidget.client.data;
import com.sencha.gxt.data.shared.ModelKeyProvider;

View File

@ -1,7 +1,7 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.data;
package org.gcube.portlets.user.td.csvimportwidget.client.data;
import com.sencha.gxt.core.client.ValueProvider;

View File

@ -1,12 +1,14 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.dataresource;
package org.gcube.portlets.user.td.csvimportwidget.client.dataresource;
import com.google.gwt.resources.client.CssResource;
/**
* @author Federico De Faveri defaveri@isti.cnr.it
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface CSVImportCSS extends CssResource {

View File

@ -1,4 +1,4 @@
package org.gcube.portlets.user.csvimportwizardtd.client.dataresource;
package org.gcube.portlets.user.td.csvimportwidget.client.dataresource;

View File

@ -5,7 +5,7 @@ package org.gcube.portlets.user.td.csvimportwidget.client.general;
import java.util.ArrayList;
import org.gcube.portlets.user.csvimportwizardtd.client.util.ErrorMessageBox;
import org.gcube.portlets.user.td.csvimportwidget.client.util.ErrorMessageBox;
import org.gcube.portlets.user.td.gwtservice.shared.TRId;

View File

@ -1,12 +1,12 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.progress;
package org.gcube.portlets.user.td.csvimportwidget.client.progress;
import org.gcube.portlets.user.td.gxtservice.shared.TRId;
import org.gcube.portlets.user.td.gwtservice.shared.TRId;
import com.allen_sauer.gwt.log.client.Log;
import com.sencha.gxt.widget.core.client.ProgressBar;

View File

@ -1,9 +1,9 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.progress;
package org.gcube.portlets.user.td.csvimportwidget.client.progress;
import org.gcube.portlets.user.td.gxtservice.shared.TRId;
import org.gcube.portlets.user.td.gwtservice.shared.TRId;

View File

@ -1,13 +1,13 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.progress;
package org.gcube.portlets.user.td.csvimportwidget.client.progress;
import java.util.ArrayList;
import org.gcube.portlets.user.td.gxtservice.client.rpc.TDGXTServiceAsync;
import org.gcube.portlets.user.td.gxtservice.shared.TRId;
import org.gcube.portlets.user.td.gxtservice.shared.csv.CSVImportMonitor;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.TRId;
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportMonitor;
import com.allen_sauer.gwt.log.client.Log;
@ -33,7 +33,7 @@ public class CSVImportProgressUpdater extends Timer {
@Override
public void run() {
Log.debug("requesting operation progress");
TDGXTServiceAsync.INSTANCE.getCSVImportMonitor(new AsyncCallback<CSVImportMonitor>() {
TDGWTServiceAsync.INSTANCE.getCSVImportMonitor(new AsyncCallback<CSVImportMonitor>() {
@Override
public void onFailure(Throwable caught) {

View File

@ -1,7 +1,7 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.progress;
package org.gcube.portlets.user.td.csvimportwidget.client.progress;
import com.allen_sauer.gwt.log.client.Log;

View File

@ -1,7 +1,7 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.progress;
package org.gcube.portlets.user.td.csvimportwidget.client.progress;
import com.allen_sauer.gwt.log.client.Log;

View File

@ -1,7 +1,7 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.progress;
package org.gcube.portlets.user.td.csvimportwidget.client.progress;

View File

@ -1,12 +1,12 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.progress;
package org.gcube.portlets.user.td.csvimportwidget.client.progress;
import java.util.ArrayList;
import org.gcube.portlets.user.td.gxtservice.client.rpc.TDGXTServiceAsync;
import org.gcube.portlets.user.td.gxtservice.shared.file.FileUploadMonitor;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.file.FileUploadMonitor;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.Timer;
@ -31,7 +31,7 @@ public class FileUploadProgressUpdater extends Timer {
@Override
public void run() {
Log.debug("requesting operation progress");
TDGXTServiceAsync.INSTANCE.getFileUploadMonitor(new AsyncCallback<FileUploadMonitor>() {
TDGWTServiceAsync.INSTANCE.getFileUploadMonitor(new AsyncCallback<FileUploadMonitor>() {
@Override
public void onFailure(Throwable caught) {

View File

@ -1,7 +1,7 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.util;
package org.gcube.portlets.user.td.csvimportwidget.client.util;
import com.google.gwt.core.client.Callback;
import com.google.gwt.user.client.ui.Label;

View File

@ -1,10 +1,12 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.util;
package org.gcube.portlets.user.td.csvimportwidget.client.util;
/**
* @author Federico De Faveri defaveri@isti.cnr.it
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class Format {

View File

@ -1,13 +1,17 @@
/**
*
*/
package org.gcube.portlets.user.csvimportwizardtd.client.util;
package org.gcube.portlets.user.td.csvimportwidget.client.util;
import com.google.gwt.core.client.Callback;
/**
* @author "Federico De Faveri defaveri@isti.cnr.it"
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
* @param <T>
* @param <F>
*/
public class NOPCallBack<T,F> implements Callback<T, F> {