From 5966ec1fdf924a548a910a61db01fa8ade3df533 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Tue, 29 Oct 2013 13:58:31 +0000 Subject: [PATCH] Cleaned and restored the project git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-sdmx-export-widget@84550 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../client/document/CodelistDocument.java | 59 --- .../client/document/DatasetDocument.java | 60 --- .../client/document/SDMXDocument.java | 38 -- .../client/general/SimpleWizardCard.java | 33 -- .../client/general/WizardCard.java | 273 ----------- .../client/general/WizardListener.java | 36 -- .../client/general/WizardWindow.java | 447 ------------------ .../progress/ImportProgressBarUpdater.java | 87 ---- .../progress/OperationProgressListener.java | 42 -- .../progress/OperationProgressUpdater.java | 131 ----- .../client/rpc/SDMXExportWizardService.java | 37 -- .../rpc/SDMXExportWizardServiceAsync.java | 41 -- .../client/source/FileSource.java | 54 --- .../client/source/SDMXRegistrySource.java | 68 --- .../client/source/Source.java | 27 -- .../client/source/WorkspaceSource.java | 54 --- .../client/util/ErrorMessageBox.java | 70 --- .../client/util/Format.java | 35 -- .../client/util/NOPCallBack.java | 20 - .../client/util/WizardResources.java | 32 -- .../sdmxexportwizardtd/shared/Agencies.java | 109 ----- .../sdmxexportwizardtd/shared/Codelist.java | 95 ---- .../sdmxexportwizardtd/shared/Constants.java | 15 - .../sdmxexportwizardtd/shared/Dataset.java | 93 ---- .../shared/ExportMonitor.java | 73 --- .../shared/FieldVerifier.java | 42 -- .../shared/SDMXExportSession.java | 56 --- .../shared/SDMXExportWizardException.java | 30 -- .../sdmxexportwizardtd/shared/Status.java | 15 - .../shared/TableDetail.java | 78 --- 30 files changed, 2250 deletions(-) delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/document/CodelistDocument.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/document/DatasetDocument.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/document/SDMXDocument.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/general/SimpleWizardCard.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/general/WizardCard.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/general/WizardListener.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/general/WizardWindow.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/progress/ImportProgressBarUpdater.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/progress/OperationProgressListener.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/progress/OperationProgressUpdater.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/rpc/SDMXExportWizardService.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/rpc/SDMXExportWizardServiceAsync.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/source/FileSource.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/source/SDMXRegistrySource.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/source/Source.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/source/WorkspaceSource.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/util/ErrorMessageBox.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/util/Format.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/util/NOPCallBack.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/util/WizardResources.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/Agencies.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/Codelist.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/Constants.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/Dataset.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/ExportMonitor.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/FieldVerifier.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/SDMXExportSession.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/SDMXExportWizardException.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/Status.java delete mode 100644 src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/TableDetail.java diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/document/CodelistDocument.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/document/CodelistDocument.java deleted file mode 100644 index 5288f78..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/document/CodelistDocument.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.gcube.portlets.user.sdmxexportwizardtd.client.document; - - -/** - * - * @author "Giancarlo Panichi" - * g.panichi@isti.cnr.it - * - */ -public class CodelistDocument implements SDMXDocument { - - private static final long serialVersionUID = 8732679674877915333L; - - public static final CodelistDocument INSTANCE = new CodelistDocument(); - - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return "codelist"; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return "Codelist document"; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDescription() { - return "Select this document if you want to retrive codelist"; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("Codelist Document [getId()="); - builder.append(getId()); - builder.append(", getName()="); - builder.append(getName()); - builder.append(", getDescription()="); - builder.append(getDescription()); - builder.append("]"); - return builder.toString(); - } - - - -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/document/DatasetDocument.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/document/DatasetDocument.java deleted file mode 100644 index 367e21d..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/document/DatasetDocument.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.gcube.portlets.user.sdmxexportwizardtd.client.document; - - -/** - * - * @author "Giancarlo Panichi" - * g.panichi@isti.cnr.it - * - */ -public class DatasetDocument implements SDMXDocument { - - - private static final long serialVersionUID = 6134053739629827095L; - - public static final DatasetDocument INSTANCE = new DatasetDocument(); - - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return "dataset"; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return "Dataset document"; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDescription() { - return "Select this document if you want to retrive dataset"; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("DataSet Document [getId()="); - builder.append(getId()); - builder.append(", getName()="); - builder.append(getName()); - builder.append(", getDescription()="); - builder.append(getDescription()); - builder.append("]"); - return builder.toString(); - } - - - -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/document/SDMXDocument.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/document/SDMXDocument.java deleted file mode 100644 index ae2299a..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/document/SDMXDocument.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.sdmxexportwizardtd.client.document; - -import java.io.Serializable; - - - - -/** - * SDMX document type interface. All SDMX document type have to implement this interface. - * @author "Giancarlo Panichi" - * g.panichi@isti.cnr.it - * - */ -public interface SDMXDocument extends Serializable { - - /** - * Returns the document id. - * @return the document id. - */ - public String getId(); - - /** - * Returns the document name. - * @return the document name. - */ - public String getName(); - - /** - * Returns the document description. - * @return the document description. - */ - public String getDescription(); - - -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/general/SimpleWizardCard.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/general/SimpleWizardCard.java deleted file mode 100644 index fbc23b1..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/general/SimpleWizardCard.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.sdmxexportwizardtd.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); - } - -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/general/WizardCard.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/general/WizardCard.java deleted file mode 100644 index 0dd44ca..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/general/WizardCard.java +++ /dev/null @@ -1,273 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.sdmxexportwizardtd.client.general; - -import org.gcube.portlets.user.sdmxexportwizardtd.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.IMPL; - - /** - * 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.sdmxExportCss().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.sdmxExportCss().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.sdmxExportCss().getWizardFooter()); - footerPanel.add(footerHtml); - - setSouthWidget(footerPanel, new BorderLayoutData(30)); - - } - - - /** - * {@inheritDoc} - */ - public void setTitle(String title) - { - titleHtml.setHTML("

"+title+"

"); - } - - /** - * Sets the card footer. - * @param footer the footer. - */ - public void setFooter(String footer) - { - footerHtml.setHTML("

"+footer+"

"); - } - - /** - * 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 true to enable it, false otherwise. - */ - public void setEnableNextButton(boolean enable) - { - if (wizardWindow!=null){ - wizardWindow.setEnableNextButton(enable); - } - } - - /** - * Enables the back button. - * @param enable true to enable the button, false 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 true to show the button, false otherwise. - */ - public void setNextButtonVisible(boolean visible) - { - if (wizardWindow!=null){ - wizardWindow.setNextButtonVisible(visible); - } - } - - /** - * Visible the back button. - * @param visible true to show the button, false 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(); - } - -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/general/WizardListener.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/general/WizardListener.java deleted file mode 100644 index be3653a..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/general/WizardListener.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.sdmxexportwizardtd.client.general; - -import org.gcube.portlets.user.td.gxtservice.shared.TRId; - - - -/** - * - * @author "Giancarlo Panichi" - * g.panichi@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 null. - * @param reason the failure reason or null. - * @param details the failure details or null. - */ - public void failed(Throwable throwable, String reason, String details); - -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/general/WizardWindow.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/general/WizardWindow.java deleted file mode 100644 index a278ee1..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/general/WizardWindow.java +++ /dev/null @@ -1,447 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.sdmxexportwizardtd.client.general; - -import java.util.ArrayList; - -import org.gcube.portlets.user.sdmxexportwizardtd.client.util.ErrorMessageBox; -import org.gcube.portlets.user.td.gxtservice.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; - -/** - * - * @author "Giancarlo Panichi" - * g.panichi@isti.cnr.it - * - */ -public class WizardWindow extends Window { - - protected ArrayList cardStack = new ArrayList(); - - 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 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(); - - 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 distiimport org.gcube.portlets.user.sdmxexportwizardtd.shared.TRId;nguish between hide and hide with button - /*closeBtn.removeAllListeners(); - closeBtn.addListener(Events.Select, new Listener() { - public void handleEvent(ComponentEvent ce) { - MessageBox.confirm("Confirm", "Are you sure to cancel the operation?", new Listener() { - - @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()+" newPos"+ newPos); - 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 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 true to enable the next button, false otherwise. - */ - public void setEnableNextButton(boolean enable) - { - nextButton.setEnabled(enable); - } - - /** - * Enables the back button on the wizard. - * @param enable true to enable the back button, false 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 getCardStack() - { - return cardStack; - } - - public void showErrorAndHide(String title, final String failureReason, final String failureDetails, final Throwable throwable) - { - ErrorMessageBox.showError(title, failureReason, failureDetails, new Callback() { - - @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); - } -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/progress/ImportProgressBarUpdater.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/progress/ImportProgressBarUpdater.java deleted file mode 100644 index c8e9cd7..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/progress/ImportProgressBarUpdater.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.sdmxexportwizardtd.client.progress; - - - - -import org.gcube.portlets.user.td.gxtservice.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 OperationProgressListener} events. - * - * @author "Giancarlo Panichi" - * g.panichi@isti.cnr.it - * - */ -public class ImportProgressBarUpdater implements OperationProgressListener { - - protected ProgressBar progressBar; - //protected FramedPanel operationResult; - //protected WizardWindow wizardWindow; - /** - * Creates a new {@link ProgressBar} updater. - * @param progressBar the {@link ProgressBar} to update. - */ - public ImportProgressBarUpdater(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..."); - - } - -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/progress/OperationProgressListener.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/progress/OperationProgressListener.java deleted file mode 100644 index 1cb0d38..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/progress/OperationProgressListener.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.sdmxexportwizardtd.client.progress; - -import org.gcube.portlets.user.td.gxtservice.shared.TRId; - - - -/** - * Defines a listener for operation progress. - * - * @author "Giancarlo Panichi" - * g.panichi@isti.cnr.it - * - */ -public interface OperationProgressListener { - - /** - * 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); -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/progress/OperationProgressUpdater.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/progress/OperationProgressUpdater.java deleted file mode 100644 index 25c5feb..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/progress/OperationProgressUpdater.java +++ /dev/null @@ -1,131 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.sdmxexportwizardtd.client.progress; - -import java.util.ArrayList; - -import org.gcube.portlets.user.sdmxexportwizardtd.client.rpc.SDMXExportWizardServiceAsync; -import org.gcube.portlets.user.sdmxexportwizardtd.shared.ExportMonitor; -import org.gcube.portlets.user.td.gxtservice.shared.TRId; - - -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 OperationProgressListener}. - * - * @author "Giancarlo Panichi" - * g.panichi@isti.cnr.it - * - */ -public class OperationProgressUpdater extends Timer { - - protected ArrayList listeners = new ArrayList(); - - - /** - * {@inheritDoc} - */ - @Override - public void run() { - Log.debug("requesting operation progress"); - SDMXExportWizardServiceAsync.INSTANCE.getExportMonitor(new AsyncCallback() { - - @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(ExportMonitor result) { - Log.info("retrieved ImportMonitor: "+result.getStatus()); - switch (result.getStatus()) { - case WAITING: - break; - case INITIALIZING: - fireOperationInitializing(); - break; - case IN_PROGRESS: - fireOperationUpdate(result.getProgress()); - break; - case FAILED: - cancel(); - fireOperationFailed(result.getError(),"Failed Client Library Import", result.getStatusDescription()); - break; - case SUCCEDED: - cancel(); - Log.info("Import fisnish TableId :"+result.getTrId()); - fireOperationComplete(result.getTrId()); - break; - case ABORTED: - cancel(); - break; - default: - break; - } - - } - - - - - - }); - - - - } - - protected String getStack(Throwable e) - { - String message = e.getLocalizedMessage()+" ->
"; - Throwable c = e.getCause(); - if (c!=null) message += getStack(c); - return message; - } - - protected void fireOperationInitializing() - { - for (OperationProgressListener listener:listeners) listener.operationInitializing(); - } - - protected void fireOperationUpdate(float elaborated) - { - for (OperationProgressListener listener:listeners) listener.operationUpdate(elaborated); - } - - protected void fireOperationComplete(TRId trId) - { - for (OperationProgressListener listener:listeners) listener.operationComplete(trId); - } - - protected void fireOperationFailed(Throwable caught, String failure, String failureDetails) - { - for (OperationProgressListener listener:listeners) listener.operationFailed(caught, failure, failureDetails); - } - - /** - * Add a new {@link OperationProgressListener} to this {@link OperationProgressUpdater}. - * @param listener the listener to add. - */ - public void addListener(OperationProgressListener listener) - { - listeners.add(listener); - } - - /** - * Removes the specified {@link OperationProgressListener} from this {@link OperationProgressUpdater}. - * @param listener the listener to remove. - */ - public void removeListener(OperationProgressListener listener) - { - listeners.remove(listener); - } -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/rpc/SDMXExportWizardService.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/rpc/SDMXExportWizardService.java deleted file mode 100644 index bf00e5b..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/rpc/SDMXExportWizardService.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.sdmxexportwizardtd.client.rpc; - -import java.util.List; - -import org.gcube.portlets.user.sdmxexportwizardtd.shared.Agencies; -import org.gcube.portlets.user.sdmxexportwizardtd.shared.Codelist; -import org.gcube.portlets.user.sdmxexportwizardtd.shared.Dataset; -import org.gcube.portlets.user.sdmxexportwizardtd.shared.ExportMonitor; -import org.gcube.portlets.user.sdmxexportwizardtd.shared.SDMXExportSession; -import org.gcube.portlets.user.sdmxexportwizardtd.shared.SDMXExportWizardException; - -import com.google.gwt.user.client.rpc.RemoteService; -import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; - -/** - * @author "Federico De Faveri defaveri@isti.cnr.it" - * - */ -@RemoteServiceRelativePath("SDMXExportWizardService") -public interface SDMXExportWizardService extends RemoteService { - - public List getCodelists() throws SDMXExportWizardException; - - public List getDatasets() throws SDMXExportWizardException; - - public List getAgencies() throws SDMXExportWizardException; - - public void setSDMXSession(SDMXExportSession s) throws SDMXExportWizardException; - - public ExportMonitor getExportMonitor() throws SDMXExportWizardException; - - public void exportSDMXClientLibraryRequest(SDMXExportSession s) throws SDMXExportWizardException; - -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/rpc/SDMXExportWizardServiceAsync.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/rpc/SDMXExportWizardServiceAsync.java deleted file mode 100644 index 463dae7..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/rpc/SDMXExportWizardServiceAsync.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.sdmxexportwizardtd.client.rpc; - -import java.util.List; - -import org.gcube.portlets.user.sdmxexportwizardtd.shared.Agencies; -import org.gcube.portlets.user.sdmxexportwizardtd.shared.Codelist; -import org.gcube.portlets.user.sdmxexportwizardtd.shared.Dataset; -import org.gcube.portlets.user.sdmxexportwizardtd.shared.ExportMonitor; -import org.gcube.portlets.user.sdmxexportwizardtd.shared.SDMXExportSession; -import org.gcube.portlets.user.sdmxexportwizardtd.shared.SDMXExportWizardException; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.user.client.rpc.AsyncCallback; - -/** - * - * @author "Giancarlo Panichi" - * g.panichi@isti.cnr.it - * - */ - -public interface SDMXExportWizardServiceAsync { - - public SDMXExportWizardServiceAsync INSTANCE = GWT.create(SDMXExportWizardService.class); - - void getCodelists(AsyncCallback> callback); - - void getDatasets(AsyncCallback> callback); - - void getAgencies(AsyncCallback> callback); - - void setSDMXSession(SDMXExportSession s, AsyncCallback callback); - - void getExportMonitor(AsyncCallback callback); - - void exportSDMXClientLibraryRequest(SDMXExportSession s,AsyncCallback callback); - -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/source/FileSource.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/source/FileSource.java deleted file mode 100644 index 54d9b28..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/source/FileSource.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.gcube.portlets.user.sdmxexportwizardtd.client.source; - - -public class FileSource implements Source { - - - private static final long serialVersionUID = -5990408094142286488L; - - public static final FileSource INSTANCE = new FileSource(); - - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return "File"; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return "File source"; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDescription() { - return "Select this source if you want to retrive document from File"; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("File source [getId()="); - builder.append(getId()); - builder.append(", getName()="); - builder.append(getName()); - builder.append(", getDescription()="); - builder.append(getDescription()); - builder.append("]"); - return builder.toString(); - } - - - -} \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/source/SDMXRegistrySource.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/source/SDMXRegistrySource.java deleted file mode 100644 index 95ee8fd..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/source/SDMXRegistrySource.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.gcube.portlets.user.sdmxexportwizardtd.client.source; - - - - -public class SDMXRegistrySource implements Source { - - - private static final long serialVersionUID = 3254879141340681969L; - - public static final SDMXRegistrySource INSTANCE = new SDMXRegistrySource(); - - protected String url; - - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return "SDMXRegistry"; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return "SDMX Registry source"; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDescription() { - return "Select this source if you want to retrive document from SDMX Registry"; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("SDMXRegistry source [getId()="); - builder.append(getId()); - builder.append(", getName()="); - builder.append(getName()); - builder.append(", getDescription()="); - builder.append(getDescription()); - builder.append(", getUrl()="); - builder.append(getUrl()); - builder.append("]"); - return builder.toString(); - } - - - -} \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/source/Source.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/source/Source.java deleted file mode 100644 index 9caec41..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/source/Source.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.gcube.portlets.user.sdmxexportwizardtd.client.source; - -import java.io.Serializable; - - -public interface Source extends Serializable { - - /** - * Returns the document type id. - * @return the document type id. - */ - public String getId(); - - /** - * Returns the document type name. - * @return the document type name. - */ - public String getName(); - - /** - * Returns the document type description. - * @return the document type description. - */ - public String getDescription(); - - -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/source/WorkspaceSource.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/source/WorkspaceSource.java deleted file mode 100644 index 103a02c..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/source/WorkspaceSource.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.gcube.portlets.user.sdmxexportwizardtd.client.source; - - -public class WorkspaceSource implements Source { - - - private static final long serialVersionUID = 2826706131664617270L; - - public static final WorkspaceSource INSTANCE = new WorkspaceSource(); - - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return "Workspace"; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return "Workspace source"; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDescription() { - return "Select this source if you want to retrive document from Workspace"; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("Workspace source [getId()="); - builder.append(getId()); - builder.append(", getName()="); - builder.append(getName()); - builder.append(", getDescription()="); - builder.append(getDescription()); - builder.append("]"); - return builder.toString(); - } - - - -} \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/util/ErrorMessageBox.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/util/ErrorMessageBox.java deleted file mode 100644 index 7186283..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/util/ErrorMessageBox.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.sdmxexportwizardtd.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 "Federico De Faveri defaveri@isti.cnr.it" - * - */ -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()); - } - - public static void showError(String title, String failureReason, final String failureDetails, final Callback 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("
"+failureDetails+"
")); - //simple.getItem(0).getFocusSupport().setIgnore(true); - - //FIXME simple.setScrollMode(ScrollMode.AUTO); - - simple.setHideOnButtonClick(true); - simple.setWidth(400); - simple.setHeight(400); - simple.show(); - } - -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/util/Format.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/util/Format.java deleted file mode 100644 index b00d5ce..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/util/Format.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.sdmxexportwizardtd.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(); - } - -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/util/NOPCallBack.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/util/NOPCallBack.java deleted file mode 100644 index 8b6c6e9..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/util/NOPCallBack.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.sdmxexportwizardtd.client.util; - -import com.google.gwt.core.client.Callback; - -/** - * @author "Federico De Faveri defaveri@isti.cnr.it" - * - */ -public class NOPCallBack implements Callback { - - @Override - public void onFailure(F reason) {} - - @Override - public void onSuccess(T result) {} - -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/util/WizardResources.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/util/WizardResources.java deleted file mode 100644 index fded541..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/client/util/WizardResources.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.sdmxexportwizardtd.client.util; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.resources.client.ClientBundle; - -/** - * @author Federico De Faveri defaveri@isti.cnr.it - * - */ -public interface WizardResources extends ClientBundle { - - public static final WizardResources INSTANCE = GWT.create(WizardResources.class); - -/* @Source("org/gcube/portlets/user/csvimportwizardgxt3/client/util/resources/accept.png") - ImageResource csvCheckSuccess(); - - @Source("org/gcube/portlets/user/csvimportwizardgxt3/client/util/resources/error.png") - ImageResource csvCheckFailure(); - - @Source("org/gcube/portlets/user/csvimportwizardgxt3/client/util/resources/loading.gif") - ImageResource loading(); - - @Source("org/gcube/portlets/user/csvimportwizardgxt3/client/util/resources/information.png") - ImageResource information(); - - @Source("org/gcube/portlets/user/csvimportwizardgxt3/client/util/resources/Wizard.css") - WizardCss wizardCss(); -*/ -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/Agencies.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/Agencies.java deleted file mode 100644 index 74f10c5..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/Agencies.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.sdmxexportwizardtd.shared; - -import java.io.Serializable; - -/** - * - * @author "Giancarlo Panichi" - * g.panichi@isti.cnr.it - * - */ -public class Agencies implements Serializable { - - private static final long serialVersionUID = -8353499109124097114L; - - protected String id; - protected String name; - protected String description; - protected String nameLabel; - //protected boolean newAgency; - - - public Agencies(){} - - /** - * @param id - * @param name - * @param agencyId - */ - public Agencies(String id, String name, String description) { - this.id = id; - this.name = name; - this.description = description; - this.nameLabel=id; - //this.newAgency=false; - } - - - - /** - * - * @param id - * @param name - * @param description - * @param newAgency - */ - public Agencies(String id, String name, String description, boolean newAgency) { - this.id = id; - this.name = name; - this.description = description; - this.nameLabel=id; - //this.newAgency=newAgency; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getNameLabel() { - return nameLabel; - } - - public void setNameLabel(String nameLabel) { - this.nameLabel = nameLabel; - } -/* - public boolean isNewAgency() { - return newAgency; - } - - public void setNewAgency(boolean newAgency) { - this.newAgency = newAgency; - } -*/ - @Override - public String toString() { - return "Agencies [id=" + id + ", name=" + name + ", description=" - + description + ", nameLabel=" + nameLabel + ", newAgency=" - /*+ newAgency */+ "]"; - } - - - - - - -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/Codelist.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/Codelist.java deleted file mode 100644 index 7a59c64..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/Codelist.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.sdmxexportwizardtd.shared; - -import java.io.Serializable; - -/** - * @author "Federico De Faveri defaveri@isti.cnr.it" - * - */ -public class Codelist implements Serializable { - - private static final long serialVersionUID = -8353499109124097114L; - - protected String id; - protected String name; - protected String agencyId; - protected String version; - protected String description; - - - public Codelist(){} - - /** - * @param id - * @param name - * @param agencyId - */ - public Codelist(String id, String name, String agencyId,String version, String description) { - this.id = id; - this.name = name; - this.agencyId = agencyId; - this.version = version; - this.description = description; - } - - /** - * @return the id - */ - public String getId() { - return id; - } - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @return the agencyId - */ - public String getAgencyId() { - return agencyId; - } - - - /** - * @return the version - */ - public String getVersion() { - return version; - } - - - /** - * @return the version - */ - public String getDescription() { - return description; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("Codelist [id="); - builder.append(id); - builder.append(", name="); - builder.append(name); - builder.append(", agencyId="); - builder.append(agencyId); - builder.append(", version="); - builder.append(version); - builder.append(", description="); - builder.append(description); - builder.append("]"); - - return builder.toString(); - } -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/Constants.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/Constants.java deleted file mode 100644 index 9f85f19..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/Constants.java +++ /dev/null @@ -1,15 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.sdmxexportwizardtd.shared; - - -/** - */ -public class Constants { - - public final static String VERSION = "1.0.0"; - public final static String DEFAULT_USER = "giancarlo.panichi"; - public final static String DEFAULT_SCOPE = "/gcube/devsec"; - -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/Dataset.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/Dataset.java deleted file mode 100644 index 8cf9419..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/Dataset.java +++ /dev/null @@ -1,93 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.sdmxexportwizardtd.shared; - -import java.io.Serializable; - -/** - * @author "Federico De Faveri defaveri@isti.cnr.it" - * - */ -public class Dataset implements Serializable { - - private static final long serialVersionUID = -8353499109124097114L; - - protected String id; - protected String name; - protected String agencyId; - protected String version; - protected String description; - - - public Dataset(){} - - /** - * @param id - * @param name - * @param agencyId - */ - public Dataset(String id, String name, String agencyId, String version, String description) { - this.id = id; - this.name = name; - this.agencyId = agencyId; - this.version = version; - this.description = description; - } - - /** - * @return the id - */ - public String getId() { - return id; - } - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @return the agencyId - */ - public String getAgencyId() { - return agencyId; - } - - /** - * @return the version - */ - public String getVersion() { - return version; - } - - - /** - * @return the version - */ - public String getDescription() { - return description; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("Codelist [id="); - builder.append(id); - builder.append(", name="); - builder.append(name); - builder.append(", agencyId="); - builder.append(agencyId); - builder.append(", version="); - builder.append(version); - builder.append(", description="); - builder.append(description); - builder.append("]"); - return builder.toString(); - } -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/ExportMonitor.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/ExportMonitor.java deleted file mode 100644 index a82edff..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/ExportMonitor.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.gcube.portlets.user.sdmxexportwizardtd.shared; - -import java.io.Serializable; - -import org.gcube.portlets.user.td.gxtservice.shared.TRId; - - - -public class ExportMonitor implements Serializable { - - private static final long serialVersionUID = -5998841163159590481L; - - - protected float progress; - protected Status status; - protected String statusDescription; - protected Throwable error; - protected TRId trId; - - public float getProgress(){ - return progress; - }; - - public Status getStatus(){ - return status; - } - - public String getStatusDescription(){ - return statusDescription; - } - - public void setProgress(float progress) { - this.progress = progress; - } - - public void setStatus(Status status) { - this.status = status; - } - - public void setStatus(int status) { - this.status = Status.values()[status]; - } - - public void setStatusDescription(String statusDescription) { - this.statusDescription = statusDescription; - } - - public Throwable getError() { - return error; - } - - public void setError(Throwable error) { - this.error = error; - } - - public TRId getTrId() { - return trId; - } - - public void setTrId(TRId trId) { - this.trId = trId; - } - - @Override - public String toString() { - return "ImportMonitor [progress=" + progress + ", status=" + status - + ", statusDescription=" + statusDescription + ", error=" - + error + ", trId=" + trId + "]"; - } - - - -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/FieldVerifier.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/FieldVerifier.java deleted file mode 100644 index 5f4423f..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/FieldVerifier.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.gcube.portlets.user.sdmxexportwizardtd.shared; - -/** - *

- * FieldVerifier validates that the name the user enters is valid. - *

- *

- * This class is in the shared packing because we use it in both - * the client code and on the server. On the client, we verify that the name is - * valid before sending an RPC request so the user doesn't have to wait for a - * network round trip to get feedback. On the server, we verify that the name is - * correct to ensure that the input is correct regardless of where the RPC - * originates. - *

- *

- * When creating a class that is used on both the client and the server, be sure - * that all code is translatable and does not use native JavaScript. Code that - * is note translatable (such as code that interacts with a database or the file - * system) cannot be compiled into client side JavaScript. Code that uses native - * JavaScript (such as Widgets) cannot be run on the server. - *

- */ -public class FieldVerifier { - - /** - * Verifies that the specified name is valid for our service. - * - * In this example, we only require that the name is at least four - * characters. In your application, you can use more complex checks to ensure - * that usernames, passwords, email addresses, URLs, and other fields have the - * proper syntax. - * - * @param name the name to validate - * @return true if valid, false if invalid - */ - public static boolean isValidName(String name) { - if (name == null) { - return false; - } - return name.length() > 3; - } -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/SDMXExportSession.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/SDMXExportSession.java deleted file mode 100644 index 022d8d4..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/SDMXExportSession.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.sdmxexportwizardtd.shared; - -import java.io.Serializable; - - -/** - * - * @author "Giancarlo Panichi" - * g.panichi@isti.cnr.it - * - */ -public class SDMXExportSession implements Serializable { - - private static final long serialVersionUID = 4176034045408445284L; - - protected String id; - - protected Codelist selectedCodelist; - protected TableDetail tableDetail; - protected Agencies agency; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public Codelist getSelectedCodelist() { - return selectedCodelist; - } - public void setSelectedCodelist(Codelist selectedCodelist) { - this.selectedCodelist = selectedCodelist; - } - public TableDetail getTableDetail() { - return tableDetail; - } - public void setTableDetail(TableDetail tableDetail) { - this.tableDetail = tableDetail; - } - public Agencies getAgency() { - return agency; - } - public void setAgency(Agencies agency) { - this.agency = agency; - } - @Override - public String toString() { - return "SDMXExportSession [id=" + id + ", selectedCodelist=" - + selectedCodelist + ", tableDetail=" + tableDetail - + ", agency=" + agency + "]"; - } - -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/SDMXExportWizardException.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/SDMXExportWizardException.java deleted file mode 100644 index b824b26..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/SDMXExportWizardException.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.sdmxexportwizardtd.shared; - -/** - * @author "Federico De Faveri defaveri@isti.cnr.it" - * - */ -public class SDMXExportWizardException extends Exception { - - private static final long serialVersionUID = -9066034060104406559L; - - /** - * - */ - public SDMXExportWizardException() { - super(); - } - - /** - * @param message - */ - public SDMXExportWizardException(String message) { - super(message); - } - - - -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/Status.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/Status.java deleted file mode 100644 index 298a330..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/Status.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.gcube.portlets.user.sdmxexportwizardtd.shared; - -import java.io.Serializable; - - -public enum Status implements Serializable{ - - WAITING, - INITIALIZING, - IN_PROGRESS, - SUCCEDED, - FAILED, - ABORTED; - -} diff --git a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/TableDetail.java b/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/TableDetail.java deleted file mode 100644 index 2664dfb..0000000 --- a/src/main/java/org/gcube/portlets/user/sdmxexportwizardtd/shared/TableDetail.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.gcube.portlets.user.sdmxexportwizardtd.shared; - -import java.io.Serializable; - - -/** - * - * @author "Giancarlo Panichi" - * g.panichi@isti.cnr.it - * - */ -public class TableDetail implements Serializable { - - private static final long serialVersionUID = 7515852391099302206L; - - private String name; - private String description; - private String right; - private String agency; - - public TableDetail(){ - - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getRight() { - return right; - } - - public void setRight(String right) { - this.right = right; - } - - public String getAgency() { - return agency; - } - - public void setAgency(String agency) { - this.agency = agency; - } - - - - - public String toString(){ - StringBuilder builder = new StringBuilder(); - builder.append("TableDetail [name="); - builder.append(name); - builder.append(", description="); - builder.append(description); - builder.append(", right="); - builder.append(right); - builder.append(", agency="); - builder.append(agency); - builder.append("]"); - - return builder.toString(); - } - - - - -} \ No newline at end of file