diff --git a/1.2/UnionWizardTD.launch b/1.2/UnionWizardTD.launch new file mode 100644 index 0000000..908caf4 --- /dev/null +++ b/1.2/UnionWizardTD.launch @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/1.2/pom.xml b/1.2/pom.xml new file mode 100644 index 0000000..4682f5a --- /dev/null +++ b/1.2/pom.xml @@ -0,0 +1,312 @@ + + + + + maven-parent + org.gcube.tools + 1.0.0 + + + + + 4.0.0 + org.gcube.portlets.user + tabular-data-unionwizard-widget + 1.2.0-SNAPSHOT + + tabular-data-unionwizard-widget + tabular-data-unionwizard-widget allows the union of tabular resources + + + https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-unionwizard-widget + + + + + Giancarlo Panichi + g.panichi@isti.cnr.it + CNR Pisa, Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" + + architect + developer + + + + + + ${project.basedir}/distro + ${project.build.directory}/${project.build.finalName} + 2015-02-16 + https://gcube.wiki.gcube-system.org/gcube/index.php + templates + distro + config + + 2.6.1 + 3.3.2 + 3.1.1 + + ${env.KEYS} + + UTF-8 + UTF-8 + + + + + localRun + + + org.slf4j + slf4j-api + compile + + + ch.qos.logback + logback-classic + 1.0.1 + runtime + + + + + + + + + com.google.gwt + gwt-servlet + ${gwtVersion} + + + com.google.gwt + gwt-user + ${gwtVersion} + + + + junit + junit + 4.8.1 + test + + + javax.validation + validation-api + 1.0.0.GA + test + + + javax.validation + validation-api + 1.0.0.GA + sources + test + + + + com.sencha.gxt + gxt + ${gxtVersion} + + + + + + + org.gcube.portlets.user + tabular-data-gwt-service + [2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT) + provided + + + + + org.gcube.portlets.user + tabular-data-widget-common-event + [1.0.0-SNAPSHOT,2.0.0-SNAPSHOT) + provided + + + + + org.gcube.portlets.user + tabular-data-monitor-widget + [1.0.0-SNAPSHOT,2.0.0-SNAPSHOT) + provided + + + + + + org.gcube.portlets.user + tabular-data-wizard-widget + [1.0.0-SNAPSHOT,2.0.0-SNAPSHOT) + provided + + + + + + com.allen-sauer.gwt.log + gwt-log + ${gwtLogVersion} + provided + + + + org.slf4j + slf4j-api + + + + + + + + + + ${webappDirectory}/WEB-INF/classes + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.16 + + true + + + + + org.apache.maven.surefire + surefire-junit47 + 2.16 + + + + + + + org.codehaus.mojo + gwt-maven-plugin + ${gwtVersion} + + + + resources + + + + + UnionWizardTD.html + ${webappDirectory} + org.gcube.portlets.user.td.unionwizardwidget.UnionWizardTD + + + + + + maven-resources-plugin + 2.6 + + + copy-profile + process-resources + + copy-resources + + + ${configDirectory} + + + ${templatesDirectory} + + profile.xml + + true + + + + + + copy-distro-resources + process-resources + + copy-resources + + + ${distroDirectory} + + + ${templatesDirectory} + + profile.xml + descriptor.xml + + true + + + + + + + + maven-clean-plugin + 2.5 + + + + ${distroDirectory} + + ** + + false + + + ${configDirectory} + + ** + + false + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.2 + + + ${templatesDirectory}/descriptor.xml + + + + + servicearchive + package + + single + + + + + + + + + + + + + org.gcube.distribution + maven-portal-bom + LATEST + pom + import + + + + diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/UnionWizardTD.gwt.xml b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/UnionWizardTD.gwt.xml new file mode 100644 index 0000000..7f2ef90 --- /dev/null +++ b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/UnionWizardTD.gwt.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/ColumnMappingCard.java b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/ColumnMappingCard.java new file mode 100644 index 0000000..595fadd --- /dev/null +++ b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/ColumnMappingCard.java @@ -0,0 +1,100 @@ +package org.gcube.portlets.user.td.unionwizardwidget.client; + +import java.util.ArrayList; + +import org.gcube.portlets.user.td.gwtservice.shared.tr.union.UnionColumnsMapping; +import org.gcube.portlets.user.td.gwtservice.shared.tr.union.UnionSession; +import org.gcube.portlets.user.td.wizardwidget.client.WizardCard; +import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3; + +import com.allen_sauer.gwt.log.client.Log; +import com.google.gwt.user.client.Command; + +public class ColumnMappingCard extends WizardCard { + protected UnionSession unionSession; + protected ColumnMappingCard thisCard; + protected ColumnMappingPanel columnMappingPanel; + + public ColumnMappingCard(final UnionSession unionSession) { + super("Mapping beetween Tabular Resources", ""); + Log.debug("ColumnMappingCard"); + this.unionSession = unionSession; + thisCard = this; + + columnMappingPanel = new ColumnMappingPanel(thisCard,res); + + setContent(columnMappingPanel); + + } + + @Override + public void setup() { + Log.debug("ColumnMappingCard Call Setup "); + Command sayNextCard = new Command() { + + public void execute() { + Log.debug("ColumnMappingCard Call sayNextCard"); + setMapping(); + + } + + }; + + getWizardWindow().setNextButtonCommand(sayNextCard); + + Command sayPreviousCard = new Command() { + public void execute() { + try { + getWizardWindow().previousCard(); + getWizardWindow().removeCard(thisCard); + Log.debug("Remove ColumnMappingCard"); + } catch (Exception e) { + Log.error("sayPreviousCard :" + e.getLocalizedMessage()); + } + } + }; + + getWizardWindow().setPreviousButtonCommand(sayPreviousCard); + getWizardWindow().setEnableNextButton(true); + getWizardWindow().setEnableBackButton(true); + + } + + protected void setMapping() { + getWizardWindow().setEnableNextButton(false); + getWizardWindow().setEnableBackButton(false); + + ArrayList columnsMatch=columnMappingPanel.getSelectedMap(); + if(columnsMatch==null){ + Log.debug("No columns match created: " + +columnsMatch); + UtilsGXT3 + .info("Attentions", + "Creates a valid column map"); + getWizardWindow().setEnableNextButton(true); + getWizardWindow().setEnableBackButton(true); + + } else { + Log.debug("ColumnsMatch created: "+columnsMatch); + unionSession.setColumnsMatch(columnsMatch); + goNext(); + } + + + } + + protected void goNext() { + try { + Log.info("NextCard ColumnSelectionCard"); + UnionOperationInProgressCard progressCard = new UnionOperationInProgressCard( + unionSession); + getWizardWindow().addCard( + progressCard); + getWizardWindow().nextCard(); + } catch (Throwable e) { + Log.error("goNext: " + e.getLocalizedMessage()); + e.printStackTrace(); + } + } + +} diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/ColumnMappingPanel.java b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/ColumnMappingPanel.java new file mode 100644 index 0000000..fbce402 --- /dev/null +++ b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/ColumnMappingPanel.java @@ -0,0 +1,587 @@ +package org.gcube.portlets.user.td.unionwizardwidget.client; + +import java.util.ArrayList; +import java.util.HashMap; + +import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; +import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException; +import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException; +import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData; +import org.gcube.portlets.user.td.gwtservice.shared.tr.union.UnionColumnsMapping; +import org.gcube.portlets.user.td.unionwizardwidget.client.custom.IconButton; +import org.gcube.portlets.user.td.unionwizardwidget.client.properties.ColumnDataProperties; +import org.gcube.portlets.user.td.unionwizardwidget.client.resources.UnionResourceBundle; +import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent; +import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType; +import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; +import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType; +import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeCode; +import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.RelationshipData; +import org.gcube.portlets.user.td.wizardwidget.client.dataresource.ResourceBundle; +import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3; + +import com.allen_sauer.gwt.log.client.Log; +import com.google.gwt.core.client.GWT; +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.event.dom.client.ClickHandler; +import com.google.gwt.event.logical.shared.SelectionEvent; +import com.google.gwt.event.logical.shared.SelectionHandler; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction; +import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode; +import com.sencha.gxt.core.client.util.Margins; +import com.sencha.gxt.data.shared.ListStore; +import com.sencha.gxt.widget.core.client.ContentPanel; +import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData; +import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutPack; +import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer; +import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer.HBoxLayoutAlign; +import com.sencha.gxt.widget.core.client.container.ResizeContainer; +import com.sencha.gxt.widget.core.client.container.SimpleContainer; +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.form.ComboBox; +import com.sencha.gxt.widget.core.client.form.FieldLabel; + +/** + * + * @author "Giancarlo Panichi" email: g.panichi@isti.cnr.it + * + */ +public class ColumnMappingPanel extends ContentPanel { + + private static final String COMBOWIDTH = "200px"; + // private static final String COLUMNLABELWIDTH = "120px"; + protected ResourceBundle res; + protected ColumnMappingCard parent; + protected VerticalLayoutContainer vert; + protected ArrayList sourceColumns; + protected ArrayList unionColumns; + protected ResizeContainer thisPanel; + + protected HashMap columnMap; + protected ArrayList listUnionColumnsMapping; + + protected String itemIdSourceColumn = "itemIdSourceColumn"; + protected String itemIdUnionColumn = "itemIdUnionColumn"; + protected String itemIdLabelColumn = "itemIdLabelColumn"; + protected String itemIdBtnAdd = "itemIdBtnAdd"; + protected String itemIdBtnDel = "itemIdBtnDel"; + + /** + * + * @param parent + * @param res + */ + public ColumnMappingPanel(ColumnMappingCard parent, ResourceBundle res) { + super(); + this.res = res; + this.parent = parent; + thisPanel = this; + + Log.debug("ColumnMappingPanel"); + init(); + retrieveSourceColumns(); + } + + protected void init() { + setHeaderVisible(false); + // setBodyBorder(false); + setBodyStyle("backgroundColor:#DFE8F6;"); + // new Resizable(this, Dir.E, Dir.SE, Dir.S); + // Important: fixed rendering of widgets + forceLayoutOnResize = true; + } + + protected void create() { + + SimpleContainer container = new SimpleContainer(); + + vert = new VerticalLayoutContainer(); + vert.setScrollMode(ScrollMode.AUTO); + vert.setAdjustForScroll(true); + container.add(vert); + + setColumnMap(); + + /* + * FieldLabel columnLabel = new FieldLabel(null, "Column Label"); + * columnLabel.getElement().applyStyles("font-weight:bold"); + * columnLabel.setWidth(COLUMNLABELWIDTH); + * columnLabel.setLabelSeparator(""); + */ + + String currentTRLabel = parent.unionSession.getCurrentTabularResource() + .getName(); + FieldLabel sourceColumnLabel = new FieldLabel(null, currentTRLabel); + sourceColumnLabel.getElement().applyStyles("font-weight:bold"); + sourceColumnLabel.setWidth(COMBOWIDTH); + sourceColumnLabel.setLabelSeparator(""); + + String unionTRLabel = parent.unionSession.getUnionTabularResource() + .getName(); + FieldLabel unionColumnLabel = new FieldLabel(null, unionTRLabel); + unionColumnLabel.getElement().applyStyles("font-weight:bold"); + unionColumnLabel.setWidth(COMBOWIDTH); + unionColumnLabel.setLabelSeparator(""); + + final HBoxLayoutContainer horiz = new HBoxLayoutContainer(); + horiz.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE); + horiz.setPack(BoxLayoutPack.START); + + // horiz.add(columnLabel, new BoxLayoutData(new Margins(2, 1, 2, 1))); + horiz.add(sourceColumnLabel, new BoxLayoutData(new Margins(2, 1, 2, 1))); + horiz.add(unionColumnLabel, new BoxLayoutData(new Margins(2, 1, 2, 1))); + + VerticalLayoutContainer vPanel = new VerticalLayoutContainer(); + vPanel.setScrollMode(ScrollMode.AUTO); + vPanel.setAdjustForScroll(true); + + vPanel.add(horiz, new VerticalLayoutData(1, -1, + new Margins(1, 1, 1, 10))); + vPanel.add(container, new VerticalLayoutData(1, -1, new Margins(1, 1, + 1, 10))); + + add(vPanel); + forceLayout(); + + } + + private void retrieveSourceColumns() { + TRId trId = parent.unionSession.getTrId(); + TDGWTServiceAsync.INSTANCE.getColumns(trId, + new AsyncCallback>() { + + @Override + public void onFailure(Throwable caught) { + if (caught instanceof TDGWTSessionExpiredException) { + parent.getEventBus() + .fireEvent( + new SessionExpiredEvent( + SessionExpiredType.EXPIREDONSERVER)); + } else { + if (caught instanceof TDGWTIsLockedException) { + Log.error(caught.getLocalizedMessage()); + UtilsGXT3.alert("Error Locked", + caught.getLocalizedMessage()); + + } else { + Log.debug("Error retrieving source columns: " + + caught.getLocalizedMessage()); + UtilsGXT3 + .alert("Error retrieving source columns", + "Error retrieving source columns on server!"); + } + } + } + + @Override + public void onSuccess(ArrayList result) { + sourceColumns = result; + retrieveUnionColumns(); + + } + }); + + } + + private void retrieveUnionColumns() { + TRId trId = parent.unionSession.getUnionTabularResource().getTrId(); + TDGWTServiceAsync.INSTANCE.getColumns(trId, + new AsyncCallback>() { + + @Override + public void onFailure(Throwable caught) { + if (caught instanceof TDGWTSessionExpiredException) { + parent.getEventBus() + .fireEvent( + new SessionExpiredEvent( + SessionExpiredType.EXPIREDONSERVER)); + } else { + if (caught instanceof TDGWTIsLockedException) { + Log.error(caught.getLocalizedMessage()); + UtilsGXT3.alert("Error Locked", + caught.getLocalizedMessage()); + + } else { + Log.debug("Error retrieving union columns: " + + caught.getLocalizedMessage()); + UtilsGXT3 + .alert("Error retrieving union columns", + "Error retrieving union columns on server!"); + } + } + } + + @Override + public void onSuccess(ArrayList result) { + unionColumns = result; + create(); + + } + }); + + } + + protected void setColumnMap() { + + final HBoxLayoutContainer horiz = new HBoxLayoutContainer(); + + // Column Label + /* + * TextField columnLabel = new TextField(); + * columnLabel.setItemId(itemIdLabelColumn); + * columnLabel.setAllowBlank(false); + * columnLabel.setWidth(COLUMNLABELWIDTH); + */ + + // Source Combo + ColumnDataProperties propsSourceColumn = GWT + .create(ColumnDataProperties.class); + ListStore storeComboSourceColumn = new ListStore( + propsSourceColumn.id()); + storeComboSourceColumn.addAll(sourceColumns); + + final ComboBox comboSourceColumn = new ComboBox( + storeComboSourceColumn, propsSourceColumn.label()); + comboSourceColumn.setItemId(itemIdSourceColumn); + + Log.debug("ComboSourceColumn created"); + + comboSourceColumn.setEmptyText("Select a column..."); + comboSourceColumn.setWidth(COMBOWIDTH); + comboSourceColumn.setEditable(false); + comboSourceColumn.setTriggerAction(TriggerAction.ALL); + + // Union Combo + ColumnDataProperties propsUnionColumn = GWT + .create(ColumnDataProperties.class); + final ListStore storeComboUnionColumn = new ListStore( + propsUnionColumn.id()); + + final ComboBox comboUnionColumn = new ComboBox( + storeComboUnionColumn, propsUnionColumn.label()); + comboUnionColumn.setItemId(itemIdUnionColumn); + + Log.debug("ComboUnionColumn created"); + + comboUnionColumn.disable(); + comboUnionColumn.setEmptyText("Select a column..."); + comboUnionColumn.setWidth(COMBOWIDTH); + comboUnionColumn.setEditable(false); + comboUnionColumn.setTriggerAction(TriggerAction.ALL); + + final IconButton btnAdd = new IconButton(); + btnAdd.setItemId(itemIdBtnAdd); + btnAdd.setIcon(UnionResourceBundle.INSTANCE.add()); + btnAdd.addClickHandler(new ClickHandler() { + + public void onClick(ClickEvent event) { + Log.debug("Clicked btnAdd"); + addColumnMap(); + thisPanel.forceLayout(); + vert.forceLayout(); + + } + }); + btnAdd.setVisible(true); + + final IconButton btnDel = new IconButton(); + btnDel.setItemId(itemIdBtnDel); + btnDel.setIcon(UnionResourceBundle.INSTANCE.delete()); + btnDel.addClickHandler(new ClickHandler() { + + public void onClick(ClickEvent event) { + Log.debug("Clicked btnDel"); + vert.remove(horiz); + if (vert.getWidgetCount() == 0) { + setColumnMap(); + } else { + + } + thisPanel.forceLayout(); + vert.forceLayout(); + + } + }); + btnDel.setVisible(false); + + comboSourceColumn + .addSelectionHandler(new SelectionHandler() { + + @Override + public void onSelection(SelectionEvent event) { + comboUnionColumn.reset(); + comboUnionColumn.clear(); + storeComboUnionColumn.clear(); + storeComboUnionColumn.commitChanges(); + ColumnData selectedSourceColumn = event + .getSelectedItem(); + + updateStoreComboUnionColumn(selectedSourceColumn, + storeComboUnionColumn); + + storeComboUnionColumn.commitChanges(); + comboUnionColumn.redraw(); + comboUnionColumn.enable(); + forceLayout(); + } + }); + + horiz.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE); + horiz.setPack(BoxLayoutPack.START); + + // horiz.add(columnLabel, new BoxLayoutData(new Margins(2, 1, 2, 1))); + horiz.add(comboSourceColumn, new BoxLayoutData(new Margins(2, 1, 2, 1))); + horiz.add(comboUnionColumn, new BoxLayoutData(new Margins(2, 1, 2, 1))); + horiz.add(btnAdd, new BoxLayoutData(new Margins(2, 1, 2, 1))); + horiz.add(btnDel, new BoxLayoutData(new Margins(2, 1, 2, 1))); + + vert.add(horiz); + } + + protected void addColumnMap() { + + final HBoxLayoutContainer horiz = new HBoxLayoutContainer(); + + // Column Label + /* + * TextField columnLabel = new TextField(); + * columnLabel.setItemId(itemIdLabelColumn); + * columnLabel.setAllowBlank(false); + * columnLabel.setWidth(COLUMNLABELWIDTH); + */ + + // Source Combo + ColumnDataProperties propsSourceColumn = GWT + .create(ColumnDataProperties.class); + ListStore storeComboSourceColumn = new ListStore( + propsSourceColumn.id()); + storeComboSourceColumn.addAll(sourceColumns); + + final ComboBox comboSourceColumn = new ComboBox( + storeComboSourceColumn, propsSourceColumn.label()); + comboSourceColumn.setItemId(itemIdSourceColumn); + + Log.debug("ComboSourceColumn created"); + + comboSourceColumn.setEmptyText("Select a column..."); + comboSourceColumn.setWidth(COMBOWIDTH); + comboSourceColumn.setEditable(false); + comboSourceColumn.setTriggerAction(TriggerAction.ALL); + + // Union Combo + ColumnDataProperties propsUnionColumn = GWT + .create(ColumnDataProperties.class); + final ListStore storeComboUnionColumn = new ListStore( + propsUnionColumn.id()); + + final ComboBox comboUnionColumn = new ComboBox( + storeComboUnionColumn, propsUnionColumn.label()); + comboUnionColumn.setItemId(itemIdUnionColumn); + + Log.debug("ComboUnionColumn created"); + + comboUnionColumn.disable(); + comboUnionColumn.setEmptyText("Select a column..."); + comboUnionColumn.setWidth(COMBOWIDTH); + comboUnionColumn.setEditable(false); + comboUnionColumn.setTriggerAction(TriggerAction.ALL); + + final IconButton btnAdd = new IconButton(); + btnAdd.setItemId(itemIdBtnAdd); + btnAdd.setIcon(UnionResourceBundle.INSTANCE.add()); + btnAdd.addClickHandler(new ClickHandler() { + + public void onClick(ClickEvent event) { + Log.debug("Clicked btnAdd"); + addColumnMap(); + thisPanel.forceLayout(); + vert.forceLayout(); + + } + }); + btnAdd.setVisible(true); + + final IconButton btnDel = new IconButton(); + btnDel.setItemId(itemIdBtnDel); + btnDel.setIcon(UnionResourceBundle.INSTANCE.delete()); + btnDel.addClickHandler(new ClickHandler() { + + public void onClick(ClickEvent event) { + Log.debug("Clicked btnDel"); + vert.remove(horiz); + if (vert.getWidgetCount() == 0) { + setColumnMap(); + } else { + + } + thisPanel.forceLayout(); + vert.forceLayout(); + + } + }); + btnDel.setVisible(true); + + comboSourceColumn + .addSelectionHandler(new SelectionHandler() { + + @Override + public void onSelection(SelectionEvent event) { + comboUnionColumn.reset(); + comboUnionColumn.clear(); + storeComboUnionColumn.clear(); + storeComboUnionColumn.commitChanges(); + + ColumnData selectedSourceColumn = event + .getSelectedItem(); + + updateStoreComboUnionColumn(selectedSourceColumn, + storeComboUnionColumn); + + storeComboUnionColumn.commitChanges(); + comboUnionColumn.redraw(); + comboUnionColumn.enable(); + } + }); + + horiz.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE); + horiz.setPack(BoxLayoutPack.START); + + // horiz.add(columnLabel, new BoxLayoutData(new Margins(2, 1, 2, 1))); + horiz.add(comboSourceColumn, new BoxLayoutData(new Margins(2, 1, 2, 1))); + horiz.add(comboUnionColumn, new BoxLayoutData(new Margins(2, 1, 2, 1))); + horiz.add(btnAdd, new BoxLayoutData(new Margins(2, 1, 2, 1))); + horiz.add(btnDel, new BoxLayoutData(new Margins(2, 1, 2, 1))); + + vert.add(horiz); + } + + protected void updateStoreComboUnionColumn(ColumnData selectedSourceColumn, + ListStore storeComboUnionColumn) { + for (ColumnData col : unionColumns) { + if (selectedSourceColumn.getTypeCode().compareTo( + ColumnTypeCode.DIMENSION.toString()) == 0) { + if (col.getTypeCode().compareTo( + ColumnTypeCode.DIMENSION.toString()) == 0) { + RelationshipData sourceRelData = selectedSourceColumn + .getRelationship(); + RelationshipData colRelData = col.getRelationship(); + if (sourceRelData != null + && colRelData != null + && sourceRelData.getTargetTableId() != null + && colRelData.getTargetTableId() != null + && sourceRelData.getTargetTableId().compareTo( + colRelData.getTargetTableId()) == 0) { + storeComboUnionColumn.add(col); + } + + } + } else { + if (selectedSourceColumn.getTypeCode().compareTo( + ColumnTypeCode.TIMEDIMENSION.toString()) == 0) { + if (col.getTypeCode().compareTo( + ColumnTypeCode.TIMEDIMENSION.toString()) == 0) { + RelationshipData sourceRelData = selectedSourceColumn + .getRelationship(); + RelationshipData colRelData = col.getRelationship(); + + if (sourceRelData != null + && colRelData != null + && sourceRelData.getTargetTableId() != null + && colRelData.getTargetTableId() != null + && sourceRelData.getTargetTableId().compareTo( + colRelData.getTargetTableId()) == 0 + && selectedSourceColumn.getPeriodDataType() + .compareTo(col.getPeriodDataType()) == 0) { + storeComboUnionColumn.add(col); + } + + } + + } else { + if (selectedSourceColumn.getDataTypeName().compareTo( + ColumnDataType.Text.toString()) == 0 + || col.getDataTypeName().compareTo( + ColumnDataType.Text.toString()) == 0) { + storeComboUnionColumn.add(col); + } else { + if ((col.getDataTypeName().compareTo( + ColumnDataType.Integer.toString()) == 0 && selectedSourceColumn + .getDataTypeName().compareTo( + ColumnDataType.Numeric.toString()) == 0) + || (col.getDataTypeName().compareTo( + ColumnDataType.Numeric.toString()) == 0 && selectedSourceColumn + .getDataTypeName().compareTo( + ColumnDataType.Integer + .toString()) == 0)) { + storeComboUnionColumn.add(col); + } else { + if (col.getDataTypeName().compareTo( + selectedSourceColumn.getDataTypeName()) == 0) { + storeComboUnionColumn.add(col); + } else { + + } + } + } + } + } + } + } + + + + /** + * + * @return + */ + protected ArrayList getSelectedMap() { + listUnionColumnsMapping = new ArrayList(); + + int lenght = vert.getWidgetCount(); + int i = 0; + for (; i < lenght; i++) { + HBoxLayoutContainer h = (HBoxLayoutContainer) vert.getWidget(i); + if (h != null) { + /* + * TextField columnLabelField = (TextField) h + * .getItemByItemId(itemIdLabelColumn); if (columnLabelField != + * null) { String columnLabel = + * columnLabelField.getCurrentValue(); if (columnLabel != null + * && !columnLabel.isEmpty()) { + */ + @SuppressWarnings("unchecked") + ComboBox comboSourceColumn = (ComboBox) h + .getItemByItemId(itemIdSourceColumn); + ColumnData sourceColumn = comboSourceColumn.getCurrentValue(); + if (sourceColumn != null) { + @SuppressWarnings("unchecked") + ComboBox comboUnionColumn = (ComboBox) h + .getItemByItemId(itemIdUnionColumn); + ColumnData unionColumn = comboUnionColumn.getCurrentValue(); + if (unionColumn != null) { + UnionColumnsMapping colMatch = new UnionColumnsMapping( + "default", sourceColumn, unionColumn); + listUnionColumnsMapping.add(colMatch); + } else { + Log.debug("Union Column is null"); + } + } else { + Log.debug("Source Column is null"); + } + /* + * } else { Log.debug("Column Label is null"); } } else { + * Log.debug("Column Label Field is null"); } + */ + } else { + Log.debug("HorizontalContainer is null"); + } + } + + return listUnionColumnsMapping; + + } + +} diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/TabResourcesProperties.java b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/TabResourcesProperties.java new file mode 100644 index 0000000..533f85e --- /dev/null +++ b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/TabResourcesProperties.java @@ -0,0 +1,28 @@ +package org.gcube.portlets.user.td.unionwizardwidget.client; + +import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource; + +import com.google.gwt.editor.client.Editor.Path; +import com.sencha.gxt.core.client.ValueProvider; +import com.sencha.gxt.data.shared.ModelKeyProvider; +import com.sencha.gxt.data.shared.PropertyAccess; + +/** + * + * @author "Giancarlo Panichi" + * g.panichi@isti.cnr.it + * + */ +public interface TabResourcesProperties extends PropertyAccess { + + @Path("id") + ModelKeyProvider id(); + + ValueProvider name(); + ValueProvider tabResourceType(); + ValueProvider agency(); + ValueProvider date(); + ValueProvider tableTypeName(); + ValueProvider ownerLogin(); + +} \ No newline at end of file diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/TabResourcesSelectionCard.java b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/TabResourcesSelectionCard.java new file mode 100644 index 0000000..3ba5530 --- /dev/null +++ b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/TabResourcesSelectionCard.java @@ -0,0 +1,284 @@ +package org.gcube.portlets.user.td.unionwizardwidget.client; + +import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; +import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException; +import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException; +import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource; +import org.gcube.portlets.user.td.gwtservice.shared.tr.TableData; +import org.gcube.portlets.user.td.gwtservice.shared.tr.union.UnionSession; +import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent; +import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType; +import org.gcube.portlets.user.td.wizardwidget.client.WizardCard; +import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3; + +import com.allen_sauer.gwt.log.client.Log; +import com.google.gwt.event.logical.shared.SelectionEvent; +import com.google.gwt.event.logical.shared.SelectionHandler; +import com.google.gwt.user.client.Command; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.sencha.gxt.widget.core.client.box.AlertMessageBox; +import com.sencha.gxt.widget.core.client.box.ConfirmMessageBox; +import com.sencha.gxt.widget.core.client.event.DialogHideEvent; +import com.sencha.gxt.widget.core.client.event.DialogHideEvent.DialogHideHandler; +import com.sencha.gxt.widget.core.client.event.HideEvent; +import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler; + +public class TabResourcesSelectionCard extends WizardCard { + protected UnionSession unionSession; + protected TabResourcesSelectionCard thisCard; + protected TabResourcesSelectionPanel tabResourcesSelectionPanel; + protected TabResource selectedTabResource = null; + + public TabResourcesSelectionCard(final UnionSession unionSession) { + super("Select Tabular Resource for Union", ""); + Log.debug("TabResourcesSelectionCard"); + this.unionSession = unionSession; + thisCard = this; + + tabResourcesSelectionPanel = new TabResourcesSelectionPanel(thisCard, + res); + + tabResourcesSelectionPanel + .addSelectionHandler(new SelectionHandler() { + + public void onSelection(SelectionEvent event) { + unionSession + .setUnionTabularResource(tabResourcesSelectionPanel + .getSelectedItem()); + getWizardWindow().setEnableNextButton(true); + } + + }); + + setContent(tabResourcesSelectionPanel); + + } + + @Override + public void setup() { + Log.debug("TabResourcesSelectionCard Call Setup "); + Command sayNextCard = new Command() { + + public void execute() { + Log.debug("TabResourcesSelectionCard Call sayNextCard"); + retrieveLastTable(); + + } + + }; + + getWizardWindow().setNextButtonCommand(sayNextCard); + + Command sayPreviousCard = new Command() { + public void execute() { + try { + getWizardWindow().previousCard(); + getWizardWindow().removeCard(thisCard); + Log.debug("Remove TabResourcesSelectionCard"); + } catch (Exception e) { + Log.error("sayPreviousCard :" + e.getLocalizedMessage()); + } + } + }; + + getWizardWindow().setPreviousButtonCommand(sayPreviousCard); + getWizardWindow().setEnableNextButton(false); + getWizardWindow().setEnableBackButton(false); + + } + + protected void retrieveLastTable() { + getWizardWindow().setEnableNextButton(false); + getWizardWindow().setEnableBackButton(false); + + TDGWTServiceAsync.INSTANCE.getLastTable(unionSession + .getUnionTabularResource().getTrId(), + new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + Log.debug("Attention", + "This tabular resource does not have a valid table"); + AlertMessageBox d = new AlertMessageBox("Attention", + "This tabular resource does not have a valid table"); + d.addHideHandler(new HideHandler() { + + public void onHide(HideEvent event) { + deleteTRWithLastTableNull(); + + } + }); + d.show(); + + } + + @Override + public void onSuccess(TableData result) { + Log.debug("Retrieve last table: " + result); + updateConnectedTRInfo(result); + } + + }); + + } + + protected void deleteTRWithLastTableNull() { + final ConfirmMessageBox mb = new ConfirmMessageBox("Delete", + "Would you like to delete this tabular resource without table?"); + /*Next in GXT 3.1.1 */ + + mb.addDialogHideHandler(new DialogHideHandler() { + + @Override + public void onDialogHide(DialogHideEvent event) { + switch (event.getHideButton()) { + case NO: + getWizardWindow().setEnableNextButton(false); + getWizardWindow().setEnableBackButton(false); + break; + case YES: + callDeleteLastTable(); + break; + default: + break; + + } + + } + }); + + + + /* GXT 3.0.1 + mb.addHideHandler(new HideHandler() { + public void onHide(HideEvent event) { + + if (mb.getHideButton() == mb.getButtonById(PredefinedButton.YES + + .name())) { + callDeleteLastTable(); + + } else if (mb.getHideButton() == mb + .getButtonById(PredefinedButton.NO.name())) { + getWizardWindow().setEnableNextButton(false); + getWizardWindow().setEnableBackButton(false); + } + + } + + });*/ + mb.setWidth(300); + mb.show(); + + } + + protected void callDeleteLastTable() { + Log.debug("Delete TR:" + + unionSession.getUnionTabularResource().getTrId()); + TDGWTServiceAsync.INSTANCE.removeTabularResource(unionSession + .getUnionTabularResource().getTrId(), + new AsyncCallback() { + + public void onFailure(Throwable caught) { + if (caught instanceof TDGWTSessionExpiredException) { + getEventBus() + .fireEvent( + new SessionExpiredEvent( + SessionExpiredType.EXPIREDONSERVER)); + } else { + if (caught instanceof TDGWTIsLockedException) { + Log.error(caught.getLocalizedMessage()); + UtilsGXT3.alert("Error Locked", + caught.getLocalizedMessage()); + getWizardWindow().setEnableNextButton(false); + getWizardWindow().setEnableBackButton(false); + } else { + + AlertMessageBox d = new AlertMessageBox( + "Error", + "Error on delete TabResource: " + + caught.getLocalizedMessage()); + d.addHideHandler(new HideHandler() { + + public void onHide(HideEvent event) { + getWizardWindow().setEnableNextButton( + true); + getWizardWindow().setEnableBackButton( + true); + + } + + }); + d.show(); + + } + } + + } + + public void onSuccess(Void result) { + tabResourcesSelectionPanel.gridReload(); + getWizardWindow().setEnableNextButton(false); + getWizardWindow().setEnableBackButton(false); + } + + }); + } + + protected void updateConnectedTRInfo(TableData table) { + TabResource tabResource = unionSession.getUnionTabularResource(); + tabResource.setTrId(table.getTrId()); + unionSession.setUnionTabularResource(tabResource); + Log.debug("UnionSession: " + unionSession); + retriveCurrentTabularResourceInfo(); + } + + protected void retriveCurrentTabularResourceInfo() { + TDGWTServiceAsync.INSTANCE.getTabResourceInformation( + unionSession.getTrId(), new AsyncCallback() { + + public void onSuccess(TabResource result) { + Log.info("Retrived TR: " + result.getTrId()); + unionSession.setCurrentTabularResource(result); + goNext(); + } + + public void onFailure(Throwable caught) { + if (caught instanceof TDGWTSessionExpiredException) { + getEventBus() + .fireEvent( + new SessionExpiredEvent( + SessionExpiredType.EXPIREDONSERVER)); + } else { + if (caught instanceof TDGWTIsLockedException) { + Log.error(caught.getLocalizedMessage()); + UtilsGXT3.alert("Error Locked", + caught.getLocalizedMessage()); + getWizardWindow().setEnableNextButton(false); + getWizardWindow().setEnableBackButton(false); + } else { + UtilsGXT3 + .alert("Error", + "Error retrienving information on current tabular resource: "); + getWizardWindow().setEnableNextButton(false); + getWizardWindow().setEnableBackButton(false); + } + } + } + + }); + } + + protected void goNext() { + try { + Log.info("NextCard ColumnMappingCard"); + ColumnMappingCard columnSelectionCard = new ColumnMappingCard( + unionSession); + getWizardWindow().addCard(columnSelectionCard); + getWizardWindow().nextCard(); + } catch (Throwable e) { + Log.error("goNext: " + e.getLocalizedMessage()); + } + } + +} diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/TabResourcesSelectionPanel.java b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/TabResourcesSelectionPanel.java new file mode 100644 index 0000000..4dca5fd --- /dev/null +++ b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/TabResourcesSelectionPanel.java @@ -0,0 +1,396 @@ +package org.gcube.portlets.user.td.unionwizardwidget.client; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; +import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException; +import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException; +import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource; +import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent; +import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType; +import org.gcube.portlets.user.td.wizardwidget.client.WizardCard; +import org.gcube.portlets.user.td.wizardwidget.client.dataresource.ResourceBundle; +import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3; + +import com.allen_sauer.gwt.log.client.Log; +import com.google.gwt.core.client.GWT; +import com.google.gwt.core.client.Scheduler; +import com.google.gwt.core.client.Scheduler.ScheduledCommand; +import com.google.gwt.event.dom.client.KeyUpEvent; +import com.google.gwt.event.dom.client.KeyUpHandler; +import com.google.gwt.event.logical.shared.HasSelectionHandlers; +import com.google.gwt.event.logical.shared.SelectionEvent; +import com.google.gwt.event.logical.shared.SelectionHandler; +import com.google.gwt.event.shared.HandlerRegistration; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.sencha.gxt.core.client.IdentityValueProvider; +import com.sencha.gxt.core.client.Style.SelectionMode; +import com.sencha.gxt.data.client.loader.RpcProxy; +import com.sencha.gxt.data.shared.ListStore; +import com.sencha.gxt.data.shared.ModelKeyProvider; +import com.sencha.gxt.data.shared.Store; +import com.sencha.gxt.data.shared.Store.StoreFilter; +import com.sencha.gxt.data.shared.loader.ListLoadConfig; +import com.sencha.gxt.data.shared.loader.ListLoadResult; +import com.sencha.gxt.data.shared.loader.ListLoadResultBean; +import com.sencha.gxt.data.shared.loader.ListLoader; +import com.sencha.gxt.data.shared.loader.LoadResultListStoreBinding; +import com.sencha.gxt.widget.core.client.ContentPanel; +import com.sencha.gxt.widget.core.client.box.ConfirmMessageBox; +import com.sencha.gxt.widget.core.client.button.TextButton; +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.DialogHideEvent; +import com.sencha.gxt.widget.core.client.event.DialogHideEvent.DialogHideHandler; +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.form.TextField; +import com.sencha.gxt.widget.core.client.grid.CheckBoxSelectionModel; +import com.sencha.gxt.widget.core.client.grid.ColumnConfig; +import com.sencha.gxt.widget.core.client.grid.ColumnModel; +import com.sencha.gxt.widget.core.client.grid.Grid; +import com.sencha.gxt.widget.core.client.menu.Item; +import com.sencha.gxt.widget.core.client.menu.Menu; +import com.sencha.gxt.widget.core.client.menu.MenuItem; +import com.sencha.gxt.widget.core.client.toolbar.LabelToolItem; +import com.sencha.gxt.widget.core.client.toolbar.ToolBar; + +public class TabResourcesSelectionPanel extends ContentPanel implements + HasSelectionHandlers { + + private static final TabResourcesProperties properties = GWT + .create(TabResourcesProperties.class); + + protected static final ColumnConfig nameColumn = new ColumnConfig( + properties.name(), 90, "Name"); + protected static final ColumnConfig typeColumn = new ColumnConfig( + properties.tabResourceType(), 30, "Type"); + protected static final ColumnConfig tableTypeNameColumn = new ColumnConfig( + properties.tableTypeName(), 30, "Table Type"); + protected static final ColumnConfig agencyColumn = new ColumnConfig( + properties.agency(), 60, "Agency"); + protected static final ColumnConfig ownerColumn = new ColumnConfig( + properties.ownerLogin(), 70, "Owner"); + protected static final ColumnConfig dateColumn = new ColumnConfig( + properties.date(), 50, "Creation Date"); + + protected Grid grid; + protected ResourceBundle res; + protected Menu contextMenu; + + private TabResource removableTR; + + private WizardCard parent; + + public TabResourcesSelectionPanel(WizardCard parent, ResourceBundle res) { + this.res = res; + this.parent = parent; + Log.debug("TabResourcesSelectionPanel"); + init(); + try { + createContextMenu(); + } catch (Throwable e) { + Log.debug("Error In CreateContextMenu:" + e.getMessage()); + e.printStackTrace(); + } + try { + buildPanel(properties.id(), + Arrays.> asList(nameColumn,typeColumn, + tableTypeNameColumn, ownerColumn, agencyColumn, dateColumn), + nameColumn); + + } catch (Throwable e) { + Log.debug("Error building panel:" + e.getMessage()); + e.printStackTrace(); + } + } + + protected void init() { + setHeaderVisible(false); + // new Resizable(this, Dir.E, Dir.SE, Dir.S); + + } + + protected void buildPanel(ModelKeyProvider keyProvider, + List> columns, + ColumnConfig autoexpandColumn) { + + ToolBar toolBar = new ToolBar(); + toolBar.add(new LabelToolItem("Search: ")); + final TextField searchField = new TextField(); + toolBar.add(searchField); + + TextButton btnReload = new TextButton(); + // btnReload.setText("Reload"); + btnReload.setIcon(res.refresh16()); + btnReload.setToolTip("Reload"); + toolBar.add(btnReload); + + IdentityValueProvider identity = new IdentityValueProvider(); + final CheckBoxSelectionModel sm = new CheckBoxSelectionModel( + identity); + + ColumnModel cm = new ColumnModel(columns); + + final ExtendedListStore store = new ExtendedListStore( + keyProvider); + + searchField.addKeyUpHandler(new KeyUpHandler() { + + public void onKeyUp(KeyUpEvent event) { + Log.trace("searchTerm: " + searchField.getCurrentValue()); + store.applyFilters(); + } + }); + + store.addFilter(new StoreFilter() { + + public boolean select(Store store, TabResource parent, + TabResource item) { + String searchTerm = searchField.getCurrentValue(); + if (searchTerm == null) + return true; + return TabResourcesSelectionPanel.this.select(item, searchTerm); + } + }); + + store.setEnableFilters(true); + + RpcProxy> proxy = new RpcProxy>() { + + public void load(ListLoadConfig loadConfig, + final AsyncCallback> callback) { + loadData(loadConfig, callback); + } + }; + final ListLoader> loader = new ListLoader>( + proxy); + + loader.setRemoteSort(false); + loader.addLoadHandler(new LoadResultListStoreBinding>( + store)); + + grid = new Grid(store, cm) { + @Override + protected void onAfterFirstAttach() { + super.onAfterFirstAttach(); + Scheduler.get().scheduleDeferred(new ScheduledCommand() { + public void execute() { + loader.load(); + } + }); + } + }; + + sm.setSelectionMode(SelectionMode.SINGLE); + grid.setLoader(loader); + grid.setSelectionModel(sm); + grid.getView().setAutoExpandColumn(autoexpandColumn); + grid.getView().setStripeRows(true); + grid.getView().setColumnLines(true); + grid.getView().setAutoFill(true); + grid.setBorders(false); + grid.setLoadMask(true); + grid.setColumnReordering(true); + + SelectHandler sh = new SelectHandler() { + public void onSelect(SelectEvent event) { + loader.load(); + } + }; + + btnReload.addSelectHandler(sh); + + if (contextMenu != null) { + grid.setContextMenu(contextMenu); + } else + grid.setContextMenu(null); + + VerticalLayoutContainer con = new VerticalLayoutContainer(); + con.add(toolBar, new VerticalLayoutData(1, -1)); + con.add(grid, new VerticalLayoutData(1, 1)); + setWidget(con); + } + + protected void createContextMenu() { + contextMenu = new Menu(); + MenuItem deleteTRItem = new MenuItem("Delete"); + deleteTRItem.setId("DeleteTR"); + deleteTRItem + .setIcon(org.gcube.portlets.user.td.unionwizardwidget.client.resources.UnionResourceBundle.INSTANCE + .delete()); + deleteTRItem.addSelectionHandler(new SelectionHandler() { + + @Override + public void onSelection(SelectionEvent event) { + if (grid != null) { + TabResource tabResource = getSelectedItem(); + deleteTR(tabResource); + } + + } + }); + contextMenu.add(deleteTRItem); + + } + + protected boolean select(TabResource item, String searchTerm) { + if (item.getName() != null + && item.getName().toLowerCase() + .contains(searchTerm.toLowerCase())) + return true; + if (item.getTableTypeName() != null + && item.getTableTypeName().toLowerCase() + .contains(searchTerm.toLowerCase())) + return true; + if (item.getAgency() != null + && item.getAgency().toLowerCase() + .contains(searchTerm.toLowerCase())) + return true; + if (item.getDate() != null + && item.getDate().toLowerCase() + .contains(searchTerm.toLowerCase())) + return true; + if (item.getOwnerLogin() != null + && item.getOwnerLogin().toLowerCase() + .contains(searchTerm.toLowerCase())) + return true; + return false; + } + + protected void loadData(ListLoadConfig loadConfig, + final AsyncCallback> callback) { + TDGWTServiceAsync.INSTANCE + .getTabularResources(new AsyncCallback>() { + + public void onFailure(Throwable caught) { + if (caught instanceof TDGWTSessionExpiredException) { + parent.getEventBus() + .fireEvent( + new SessionExpiredEvent( + SessionExpiredType.EXPIREDONSERVER)); + } else { + Log.debug("Error retrieving tabular resource: " + + caught.getLocalizedMessage()); + UtilsGXT3 + .alert("Error!", + "Error retrieving tabular resources on server!"); + } + callback.onFailure(caught); + } + + public void onSuccess(ArrayList result) { + Log.debug("loaded " + result.size() + + " TabularResources"); + callback.onSuccess(new ListLoadResultBean( + result)); + } + }); + } + + public HandlerRegistration addSelectionHandler( + SelectionHandler handler) { + return grid.getSelectionModel().addSelectionHandler(handler); + } + + public TabResource getSelectedItem() { + return grid.getSelectionModel().getSelectedItem(); + } + + protected class ExtendedListStore extends ListStore { + + public ExtendedListStore(ModelKeyProvider keyProvider) { + super(keyProvider); + } + + public void applyFilters() { + super.applyFilters(); + } + + } + + public void gridReload() { + grid.getLoader().load(); + } + + protected void deleteTR(TabResource tabResource) { + removableTR = tabResource; + final ConfirmMessageBox mb = new ConfirmMessageBox("Delete", + "Would you like to delete this tabular resource?"); + + /*Next in GXT 3.1.1 */ + + mb.addDialogHideHandler(new DialogHideHandler() { + + @Override + public void onDialogHide(DialogHideEvent event) { + switch (event.getHideButton()) { + case NO: + break; + case YES: + callDeleteTabularResource(); + break; + default: + break; + + } + + } + }); + + /* GXT 3.0.1 + mb.addHideHandler(new HideHandler() { + public void onHide(HideEvent event) { + + + if (mb.getHideButton() == mb.getButtonById(PredefinedButton.YES + .name())) { + callDeleteTabularResource(); + } else if (mb.getHideButton() == mb + .getButtonById(PredefinedButton.NO.name())) { + // perform NO action + } + + } + }); + */ + mb.setWidth(300); + mb.show(); + + } + + protected void callDeleteTabularResource() { + Log.debug("Delete TR:" + removableTR); + TDGWTServiceAsync.INSTANCE.removeTabularResource(removableTR.getTrId(), + new AsyncCallback() { + + public void onFailure(Throwable caught) { + if (caught instanceof TDGWTSessionExpiredException) { + parent.getEventBus() + .fireEvent( + new SessionExpiredEvent( + SessionExpiredType.EXPIREDONSERVER)); + } else { + if (caught instanceof TDGWTIsLockedException) { + Log.error(caught.getLocalizedMessage()); + UtilsGXT3.alert("Error Locked", + caught.getLocalizedMessage()); + } else { + Log.error("Error on delete TabResource: " + + caught.getLocalizedMessage()); + UtilsGXT3.alert("Error", + "Error on delete TabResource: " + + caught.getLocalizedMessage()); + } + } + } + + public void onSuccess(Void result) { + gridReload(); + } + + }); + } +} diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionOperationInProgressCard.java b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionOperationInProgressCard.java new file mode 100644 index 0000000..e0ffe7c --- /dev/null +++ b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionOperationInProgressCard.java @@ -0,0 +1,292 @@ +/** + * + */ +package org.gcube.portlets.user.td.unionwizardwidget.client; + +import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; +import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsFinalException; +import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException; +import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException; +import org.gcube.portlets.user.td.gwtservice.shared.tr.union.UnionSession; +import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog; +import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener; +import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent; +import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType; +import org.gcube.portlets.user.td.widgetcommonevent.shared.OperationResult; +import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; +import org.gcube.portlets.user.td.wizardwidget.client.WizardCard; + +import com.allen_sauer.gwt.log.client.Log; +import com.google.gwt.safehtml.shared.SafeHtmlBuilder; +import com.google.gwt.user.client.Command; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.ui.FlexTable; +import com.sencha.gxt.core.client.util.Margins; +import com.sencha.gxt.widget.core.client.FramedPanel; +import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData; +import com.sencha.gxt.widget.core.client.container.HtmlLayoutContainer; +import com.sencha.gxt.widget.core.client.container.MarginData; +import com.sencha.gxt.widget.core.client.container.VBoxLayoutContainer; +import com.sencha.gxt.widget.core.client.container.VBoxLayoutContainer.VBoxLayoutAlign; + +/** + * + * @author "Giancarlo Panichi" g.panichi@isti.cnr.it + * + */ +public class UnionOperationInProgressCard extends WizardCard implements + MonitorDialogListener { + + protected UnionOperationInProgressCard thisCard; + protected UnionSession unionSession; + protected TRId newTrId; + protected HtmlLayoutContainer resultField; + + public UnionOperationInProgressCard(final UnionSession unionSession) { + super("Operation In Progress", ""); + + this.unionSession = unionSession; + thisCard = this; + + VBoxLayoutContainer operationInProgressPanel = new VBoxLayoutContainer(); + operationInProgressPanel.setVBoxLayoutAlign(VBoxLayoutAlign.CENTER); + + final FlexTable description = new FlexTable(); + description.setCellSpacing(10); + description.setCellPadding(4); + description.setBorderWidth(0); + + description.setHTML(0, 0, + "Union with: "); + description.setText(0, 1, unionSession.getUnionTabularResource() + .getName()); + description.setHTML(1, 0, + "Type: "); + description.setText(1, 1, unionSession.getUnionTabularResource() + .getTableTypeName()); + + description.setHTML(2, 0, + "Owner: "); + description.setText(2, 1, unionSession.getUnionTabularResource() + .getOwnerLogin()); + + FramedPanel summary = new FramedPanel(); + summary.setHeadingText("Union Summary"); + summary.setWidth(400); + summary.add(description); + operationInProgressPanel.add(summary, new BoxLayoutData(new Margins(20, + 5, 10, 5))); + + resultField = new HtmlLayoutContainer("
"); + + operationInProgressPanel.add(resultField, new BoxLayoutData( + new Margins(10, 5, 10, 5))); + + setCenterWidget(operationInProgressPanel, new MarginData(0)); + resultField.setVisible(false); + + } + + /** + * + */ + public void startUnion() { + TDGWTServiceAsync.INSTANCE.startUnion(unionSession, + new AsyncCallback() { + + public void onSuccess(String taskId) { + openMonitorDialog(taskId); + + } + + public void onFailure(Throwable caught) { + if (caught instanceof TDGWTSessionExpiredException) { + getEventBus() + .fireEvent( + new SessionExpiredEvent( + SessionExpiredType.EXPIREDONSERVER)); + } else { + if (caught instanceof TDGWTIsLockedException) { + Log.error(caught.getLocalizedMessage()); + showErrorAndHide("Error Locked", + caught.getLocalizedMessage(), "", + caught); + } else { + if (caught instanceof TDGWTIsFinalException) { + Log.error(caught.getLocalizedMessage()); + showErrorAndHide("Error Final", + caught.getLocalizedMessage(), "", + caught); + } else { + showErrorAndHide("Error in Union", + "An error occured in union.", + caught.getLocalizedMessage(), + caught); + } + } + } + } + }); + + } + + @Override + public void setup() { + getWizardWindow().setEnableBackButton(false); + setBackButtonVisible(false); + getWizardWindow().setEnableNextButton(false); + getWizardWindow().setNextButtonToFinish(); + startUnion(); + } + + // + protected void openMonitorDialog(String taskId) { + MonitorDialog monitorDialog = new MonitorDialog(taskId, getEventBus()); + monitorDialog.addProgressDialogListener(this); + monitorDialog.show(); + } + + @Override + public void operationComplete(OperationResult operationResult) { + newTrId = operationResult.getTrId(); + SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); + safeHtmlBuilder + .appendHtmlConstant("
Operation Completed
"); + resultField.setHTML(safeHtmlBuilder.toSafeHtml()); + resultField.setVisible(true); + Command sayComplete = new Command() { + public void execute() { + try { + getWizardWindow().close(false); + Log.info("fire Complete: " + newTrId); + + getWizardWindow().fireCompleted(newTrId); + + } catch (Exception e) { + Log.error("fire Complete :" + e.getLocalizedMessage()); + } + } + }; + + getWizardWindow().setNextButtonCommand(sayComplete); + + setNextButtonVisible(true); + getWizardWindow().setEnableNextButton(true); + forceLayout(); + + } + + @Override + public void operationFailed(Throwable caught, String reason, String details) { + SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); + safeHtmlBuilder + .appendHtmlConstant("
Operation Failed
"); + resultField.setHTML(safeHtmlBuilder.toSafeHtml()); + resultField.setVisible(true); + if (caught instanceof TDGWTSessionExpiredException) { + getEventBus() + .fireEvent( + new SessionExpiredEvent( + SessionExpiredType.EXPIREDONSERVER)); + } else { + showErrorAndHide("Error in Union", reason, details, caught); + + } + forceLayout(); + } + + @Override + public void operationStopped(OperationResult operationResult, String reason, String details) { + newTrId = operationResult.getTrId(); + SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); + safeHtmlBuilder + .appendHtmlConstant("
Problems in the Operation
"); + resultField.setHTML(safeHtmlBuilder.toSafeHtml()); + resultField.setVisible(true); + + Command sayComplete = new Command() { + public void execute() { + try { + getWizardWindow().close(false); + Log.info("fire Complete: tabular resource " + + newTrId.getId()); + Log.info("fire Complete: tableId " + newTrId.getTableId()); + + getWizardWindow().fireCompleted(newTrId); + + } catch (Exception e) { + Log.error("fire Complete :" + e.getLocalizedMessage()); + } + } + }; + + getWizardWindow().setNextButtonCommand(sayComplete); + + setNextButtonVisible(true); + getWizardWindow().setEnableNextButton(true); + forceLayout(); + } + + @Override + public void operationAborted() { + SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); + safeHtmlBuilder + .appendHtmlConstant("
Operation Aborted
"); + resultField.setHTML(safeHtmlBuilder.toSafeHtml()); + resultField.setVisible(true); + + Command sayComplete = new Command() { + public void execute() { + try { + getWizardWindow().close(false); + Log.info("fire Aborted"); + + getWizardWindow().fireAborted(); + + } catch (Exception e) { + Log.error("fire Aborted :" + e.getLocalizedMessage()); + } + } + }; + + getWizardWindow().setNextButtonCommand(sayComplete); + + setNextButtonVisible(true); + getWizardWindow().setEnableNextButton(true); + forceLayout(); + + } + + @Override + public void operationPutInBackground() { + SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); + safeHtmlBuilder + .appendHtmlConstant("
Operation in Background
"); + resultField.setHTML(safeHtmlBuilder.toSafeHtml()); + resultField.setVisible(true); + + Command sayComplete = new Command() { + public void execute() { + try { + getWizardWindow().close(false); + Log.info("fire Operation In Background"); + + getWizardWindow().firePutInBackground(); + + } catch (Exception e) { + Log.error("fire Operation In Background :" + + e.getLocalizedMessage()); + } + } + }; + + getWizardWindow().setNextButtonCommand(sayComplete); + + setNextButtonVisible(true); + getWizardWindow().setEnableNextButton(true); + forceLayout(); + + } + +} diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardTD.java b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardTD.java new file mode 100644 index 0000000..56b97c1 --- /dev/null +++ b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardTD.java @@ -0,0 +1,46 @@ +package org.gcube.portlets.user.td.unionwizardwidget.client; + +import org.gcube.portlets.user.td.gwtservice.shared.tr.union.UnionSession; +import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; +import org.gcube.portlets.user.td.wizardwidget.client.WizardWindow; + +import com.allen_sauer.gwt.log.client.Log; +import com.google.web.bindery.event.shared.EventBus; + +/** + * + * @author "Giancarlo Panichi" email: g.panichi@isti.cnr.it + * + */ +public class UnionWizardTD extends WizardWindow { + protected static final int WITHWIZARD = 800; + protected static final int HEIGHTWIZARD = 520; + + protected UnionSession unionSession; + protected TRId trId; + + /** + * + * @param trId + * @param title + * @param eventBus + */ + public UnionWizardTD(TRId trId, String title, EventBus eventBus) { + super(title, eventBus); + Log.debug("UnionWizardTD: " + trId); + setWidth(WITHWIZARD); + setHeight(HEIGHTWIZARD); + + this.trId = trId; + unionSession = new UnionSession(); + unionSession.setTrId(trId); + + TabResourcesSelectionCard tabResourcesSelection = new TabResourcesSelectionCard( + unionSession); + addCard(tabResourcesSelection); + tabResourcesSelection.setup(); + + } + +} \ No newline at end of file diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardTDEntry.java b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardTDEntry.java new file mode 100644 index 0000000..c0cb6dc --- /dev/null +++ b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardTDEntry.java @@ -0,0 +1,23 @@ +package org.gcube.portlets.user.td.unionwizardwidget.client; + +import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; + +import com.allen_sauer.gwt.log.client.Log; +import com.google.gwt.core.client.EntryPoint; +import com.google.web.bindery.event.shared.SimpleEventBus; + +/** + * + * @author "Giancarlo Panichi" + * email: g.panichi@isti.cnr.it + * + */ +public class UnionWizardTDEntry implements EntryPoint { + + public void onModuleLoad() { + TRId trId=new TRId(); + SimpleEventBus eventBus=new SimpleEventBus(); + UnionWizardTD unionWizard= new UnionWizardTD(trId, "Union",eventBus); + Log.info(unionWizard.getId()); + } +} diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/custom/IconButton.html b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/custom/IconButton.html new file mode 100644 index 0000000..9b36b96 --- /dev/null +++ b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/custom/IconButton.html @@ -0,0 +1,4 @@ + +
+
+
\ No newline at end of file diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/custom/IconButton.java b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/custom/IconButton.java new file mode 100644 index 0000000..8d6d6dd --- /dev/null +++ b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/custom/IconButton.java @@ -0,0 +1,51 @@ +package org.gcube.portlets.user.td.unionwizardwidget.client.custom; + + +import com.google.gwt.core.client.GWT; +import com.google.gwt.dom.client.Element; +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.event.dom.client.ClickHandler; +import com.google.gwt.event.dom.client.HasClickHandlers; +import com.google.gwt.event.shared.HandlerRegistration; +import com.google.gwt.resources.client.ImageResource; +import com.google.gwt.safehtml.shared.SafeHtmlBuilder; +import com.google.gwt.user.client.Event; +import com.sencha.gxt.core.client.dom.XDOM; +import com.sencha.gxt.core.client.dom.XElement; +import com.sencha.gxt.widget.core.client.Component; + +/** + * + * @author "Giancarlo Panichi" + * g.panichi@isti.cnr.it + * + */ +public class IconButton extends Component implements HasClickHandlers { + + private IconButtonAppearance appearance; + + public IconButton() { + this((IconButtonAppearance) GWT.create(IconButtonAppearanceDefault.class)); + } + + public IconButton(IconButtonAppearance appearance) { + this.appearance = appearance; + + SafeHtmlBuilder sb = new SafeHtmlBuilder(); + this.appearance.render(sb); + + XElement element=XDOM.create(sb.toSafeHtml()); + setElement((Element)element); + + sinkEvents(Event.ONCLICK); + } + + public HandlerRegistration addClickHandler(ClickHandler handler) { + return addDomHandler(handler, ClickEvent.getType()); + } + + + public void setIcon(ImageResource icon) { + appearance.onUpdateIcon(getElement(), icon); + } +} diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/custom/IconButtonAppearance.java b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/custom/IconButtonAppearance.java new file mode 100644 index 0000000..15ea2ce --- /dev/null +++ b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/custom/IconButtonAppearance.java @@ -0,0 +1,16 @@ +package org.gcube.portlets.user.td.unionwizardwidget.client.custom; + +import com.google.gwt.resources.client.ImageResource; +import com.google.gwt.safehtml.shared.SafeHtmlBuilder; +import com.sencha.gxt.core.client.dom.XElement; + +/** + * + * @author "Giancarlo Panichi" + * g.panichi@isti.cnr.it + * + */ +public interface IconButtonAppearance { + void render(SafeHtmlBuilder sb); + void onUpdateIcon(XElement parent, ImageResource icon); +} \ No newline at end of file diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/custom/IconButtonAppearanceDefault.java b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/custom/IconButtonAppearanceDefault.java new file mode 100644 index 0000000..e2cbb4f --- /dev/null +++ b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/custom/IconButtonAppearanceDefault.java @@ -0,0 +1,75 @@ +package org.gcube.portlets.user.td.unionwizardwidget.client.custom; + + +import com.google.gwt.core.client.GWT; +import com.google.gwt.dom.client.Element; +import com.google.gwt.resources.client.ClientBundle; +import com.google.gwt.resources.client.CssResource; +import com.google.gwt.resources.client.ImageResource; +import com.google.gwt.safehtml.shared.SafeHtml; +import com.google.gwt.safehtml.shared.SafeHtmlBuilder; +import com.google.gwt.user.client.ui.Image; +import com.sencha.gxt.core.client.XTemplates; +import com.sencha.gxt.core.client.dom.XElement; + +/** + * + * @author "Giancarlo Panichi" + * g.panichi@isti.cnr.it + * + */ +public class IconButtonAppearanceDefault implements IconButtonAppearance { + + public interface Template extends XTemplates { + @XTemplate(source = "IconButton.html") + SafeHtml template(IconButtonStyle style); + } + + public interface IconButtonStyle extends CssResource { + @ClassName("iconButton") + public String getIconButton(); + + @ClassName("iconButtonImage") + public String getIconButtonImage(); + + @ClassName("iconButtonRef") + public String getIconButtonRef(); + + } + + private final IconButtonStyle style; + private final Template template; + + public interface IconButtonResources extends ClientBundle { + public static final IconButtonResources INSTANCE = GWT.create(IconButtonResources.class); + + @Source("IconButtonStyle.css") + IconButtonStyle style(); + } + + public IconButtonAppearanceDefault() { + this(IconButtonResources.INSTANCE); + } + + public IconButtonAppearanceDefault(IconButtonResources resources) { + this.style = resources.style(); + this.style.ensureInjected(); + + this.template = GWT.create(Template.class); + } + + + + public void onUpdateIcon(XElement parent, ImageResource icon) { + XElement element = parent.selectNode("." + style.getIconButtonImage()); + Image image=new Image(icon); + Element img=image.getElement(); + img.setClassName(style.getIconButtonRef()); + element.appendChild(img); + + } + + public void render(SafeHtmlBuilder sb) { + sb.append(template.template(style)); + } +} \ No newline at end of file diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/custom/IconButtonStyle.css b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/custom/IconButtonStyle.css new file mode 100644 index 0000000..98ef72c --- /dev/null +++ b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/custom/IconButtonStyle.css @@ -0,0 +1,17 @@ +@CHARSET "UTF-8"; + +.iconButton { + border: none; + font-size: 12px; + margin: 0px; + padding: 0px; +} + +.iconButton .iconButtonImage { + vertical-align: center; +} + +.iconButtonRef { + vertical-align: center; + cursor: pointer; +} \ No newline at end of file diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/properties/ColumnDataProperties.java b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/properties/ColumnDataProperties.java new file mode 100644 index 0000000..b0d059d --- /dev/null +++ b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/properties/ColumnDataProperties.java @@ -0,0 +1,25 @@ +package org.gcube.portlets.user.td.unionwizardwidget.client.properties; + +import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData; + +import com.google.gwt.editor.client.Editor.Path; +import com.sencha.gxt.data.shared.LabelProvider; +import com.sencha.gxt.data.shared.ModelKeyProvider; +import com.sencha.gxt.data.shared.PropertyAccess; + +/** + * + * @author "Giancarlo Panichi" + * g.panichi@isti.cnr.it + * + */ +public interface ColumnDataProperties extends + PropertyAccess { + + @Path("id") + ModelKeyProvider id(); + + LabelProvider label(); + + +} \ No newline at end of file diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/UnionCSS.java b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/UnionCSS.java new file mode 100644 index 0000000..24b2844 --- /dev/null +++ b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/UnionCSS.java @@ -0,0 +1,41 @@ +/** + * + */ +package org.gcube.portlets.user.td.unionwizardwidget.client.resources; + +import com.google.gwt.resources.client.CssResource; + +/** + * + * @author "Giancarlo Panichi" + * g.panichi@isti.cnr.it + * + */ +public interface UnionCSS extends CssResource { + + @ClassName("wizard-title") + public String getWizardTitle(); + + @ClassName("wizard-footer") + public String getWizardFooter(); + + @ClassName("source-selection-hover") + public String getSourceSelectionHover(); + + @ClassName("column-excluded") + public String getColumnExcluded(); + + @ClassName("importSelection-sources") + public String getImportSelectionSources(); + + @ClassName("importSelection-source") + public String getImportSelectionSource(); + + @ClassName("sdmxRegistryUrlStyle") + public String getSDMXRegistryUrlStyle(); + + @ClassName("sdmxRegistryUrlInputStyle") + public String getSDMXRegistryUrlInputStyle(); + + +} diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/UnionResourceBundle.java b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/UnionResourceBundle.java new file mode 100644 index 0000000..df77749 --- /dev/null +++ b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/UnionResourceBundle.java @@ -0,0 +1,51 @@ +package org.gcube.portlets.user.td.unionwizardwidget.client.resources; + + + +import com.google.gwt.core.client.GWT; +import com.google.gwt.resources.client.ClientBundle; +import com.google.gwt.resources.client.ImageResource; + + +public interface UnionResourceBundle extends ClientBundle { + + public static final UnionResourceBundle INSTANCE=GWT.create(UnionResourceBundle.class); + + @Source("UnionWizardTD.css") + UnionCSS unionCss(); + + @Source("arrow-refresh.png") + ImageResource refresh(); + + @Source("arrow-refresh_16.png") + ImageResource refresh_16(); + + @Source("arrow-refresh_32.png") + ImageResource refresh32(); + + @Source("accept.png") + ImageResource csvCheckSuccess(); + + @Source("error.png") + ImageResource csvCheckFailure(); + + @Source("loading.gif") + ImageResource loading(); + + @Source("information.png") + ImageResource information(); + + @Source("add.png") + ImageResource add(); + + @Source("add_32.png") + ImageResource add32(); + + @Source("delete.png") + ImageResource delete(); + + @Source("delete_32.png") + ImageResource delete32(); + +} + \ No newline at end of file diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/UnionWizardTD.css b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/UnionWizardTD.css new file mode 100644 index 0000000..553fd48 --- /dev/null +++ b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/UnionWizardTD.css @@ -0,0 +1,54 @@ +@CHARSET "UTF-8"; + + +.wizard-title { + padding: 5px; + font-weight: bold; + font-size: small; + background-color: #C3D9FF; +} + +.wizard-footer { + padding: 5px; + font-weight: bold; + font-size: small; + text-align: right; + background-color: #CDEB8B +} + +.source-selection-hover:hover { + cursor: pointer; +} + + + +.column-excluded { + background-color: #e6e0da !important; + color: #bfa698; +} + +.importSelection-sources { + padding: 30px; + display: block; + margin-top: 20px; + +} + +.importSelection-source { + padding-bottom: 20px; +} + + + +.sdmxRegistryUrlStyle { + padding-top:5px; +} + +.sdmxRegistryUrlInputStyle { + width:300px!important; +} + + +input#sdmxRegistryUrlInputFieldId-input { + width:300px!important; +} diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/accept.png b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/accept.png new file mode 100644 index 0000000..89c8129 Binary files /dev/null and b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/accept.png differ diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/add.png b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/add.png new file mode 100644 index 0000000..6b1ab47 Binary files /dev/null and b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/add.png differ diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/add_32.png b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/add_32.png new file mode 100644 index 0000000..6981821 Binary files /dev/null and b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/add_32.png differ diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/arrow-refresh.png b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/arrow-refresh.png new file mode 100644 index 0000000..764f995 Binary files /dev/null and b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/arrow-refresh.png differ diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/arrow-refresh_16.png b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/arrow-refresh_16.png new file mode 100644 index 0000000..72edf8a Binary files /dev/null and b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/arrow-refresh_16.png differ diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/arrow-refresh_32.png b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/arrow-refresh_32.png new file mode 100644 index 0000000..f3521ea Binary files /dev/null and b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/arrow-refresh_32.png differ diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/codelistmapping.png b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/codelistmapping.png new file mode 100644 index 0000000..0485079 Binary files /dev/null and b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/codelistmapping.png differ diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/codelistmapping_32.png b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/codelistmapping_32.png new file mode 100644 index 0000000..b5624ab Binary files /dev/null and b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/codelistmapping_32.png differ diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/delete.png b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/delete.png new file mode 100644 index 0000000..b639afd Binary files /dev/null and b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/delete.png differ diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/delete_32.png b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/delete_32.png new file mode 100644 index 0000000..020b555 Binary files /dev/null and b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/delete_32.png differ diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/error.png b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/error.png new file mode 100644 index 0000000..c37bd06 Binary files /dev/null and b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/error.png differ diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/information.png b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/information.png new file mode 100644 index 0000000..12cd1ae Binary files /dev/null and b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/information.png differ diff --git a/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/loading.gif b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/loading.gif new file mode 100644 index 0000000..e846e1d Binary files /dev/null and b/1.2/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/loading.gif differ diff --git a/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/UnionWizardTD.gwt.xml b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/UnionWizardTD.gwt.xml new file mode 100644 index 0000000..7f2ef90 --- /dev/null +++ b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/UnionWizardTD.gwt.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/Messages.properties b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/Messages.properties new file mode 100644 index 0000000..c222555 --- /dev/null +++ b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/Messages.properties @@ -0,0 +1,2 @@ +sendButton = Send +nameField = Enter your name \ No newline at end of file diff --git a/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/Messages_fr.properties b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/Messages_fr.properties new file mode 100644 index 0000000..b4a7627 --- /dev/null +++ b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/Messages_fr.properties @@ -0,0 +1,2 @@ +sendButton = Envoyer +nameField = Entrez votre nom \ No newline at end of file diff --git a/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/custom/IconButton.html b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/custom/IconButton.html new file mode 100644 index 0000000..9b36b96 --- /dev/null +++ b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/custom/IconButton.html @@ -0,0 +1,4 @@ + +
+
+
\ No newline at end of file diff --git a/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/custom/IconButtonStyle.css b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/custom/IconButtonStyle.css new file mode 100644 index 0000000..98ef72c --- /dev/null +++ b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/custom/IconButtonStyle.css @@ -0,0 +1,17 @@ +@CHARSET "UTF-8"; + +.iconButton { + border: none; + font-size: 12px; + margin: 0px; + padding: 0px; +} + +.iconButton .iconButtonImage { + vertical-align: center; +} + +.iconButtonRef { + vertical-align: center; + cursor: pointer; +} \ No newline at end of file diff --git a/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/UnionWizardTD.css b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/UnionWizardTD.css new file mode 100644 index 0000000..553fd48 --- /dev/null +++ b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/UnionWizardTD.css @@ -0,0 +1,54 @@ +@CHARSET "UTF-8"; + + +.wizard-title { + padding: 5px; + font-weight: bold; + font-size: small; + background-color: #C3D9FF; +} + +.wizard-footer { + padding: 5px; + font-weight: bold; + font-size: small; + text-align: right; + background-color: #CDEB8B +} + +.source-selection-hover:hover { + cursor: pointer; +} + + + +.column-excluded { + background-color: #e6e0da !important; + color: #bfa698; +} + +.importSelection-sources { + padding: 30px; + display: block; + margin-top: 20px; + +} + +.importSelection-source { + padding-bottom: 20px; +} + + + +.sdmxRegistryUrlStyle { + padding-top:5px; +} + +.sdmxRegistryUrlInputStyle { + width:300px!important; +} + + +input#sdmxRegistryUrlInputFieldId-input { + width:300px!important; +} diff --git a/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/accept.png b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/accept.png new file mode 100644 index 0000000..89c8129 Binary files /dev/null and b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/accept.png differ diff --git a/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/add.png b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/add.png new file mode 100644 index 0000000..6b1ab47 Binary files /dev/null and b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/add.png differ diff --git a/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/add_32.png b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/add_32.png new file mode 100644 index 0000000..6981821 Binary files /dev/null and b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/add_32.png differ diff --git a/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/arrow-refresh.png b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/arrow-refresh.png new file mode 100644 index 0000000..764f995 Binary files /dev/null and b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/arrow-refresh.png differ diff --git a/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/arrow-refresh_16.png b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/arrow-refresh_16.png new file mode 100644 index 0000000..72edf8a Binary files /dev/null and b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/arrow-refresh_16.png differ diff --git a/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/arrow-refresh_32.png b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/arrow-refresh_32.png new file mode 100644 index 0000000..f3521ea Binary files /dev/null and b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/arrow-refresh_32.png differ diff --git a/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/codelistmapping.png b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/codelistmapping.png new file mode 100644 index 0000000..0485079 Binary files /dev/null and b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/codelistmapping.png differ diff --git a/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/codelistmapping_32.png b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/codelistmapping_32.png new file mode 100644 index 0000000..b5624ab Binary files /dev/null and b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/codelistmapping_32.png differ diff --git a/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/delete.png b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/delete.png new file mode 100644 index 0000000..b639afd Binary files /dev/null and b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/delete.png differ diff --git a/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/delete_32.png b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/delete_32.png new file mode 100644 index 0000000..020b555 Binary files /dev/null and b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/delete_32.png differ diff --git a/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/error.png b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/error.png new file mode 100644 index 0000000..c37bd06 Binary files /dev/null and b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/error.png differ diff --git a/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/information.png b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/information.png new file mode 100644 index 0000000..12cd1ae Binary files /dev/null and b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/information.png differ diff --git a/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/loading.gif b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/loading.gif new file mode 100644 index 0000000..e846e1d Binary files /dev/null and b/1.2/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/resources/loading.gif differ diff --git a/1.2/src/main/webapp/UnionWizardTD.css b/1.2/src/main/webapp/UnionWizardTD.css new file mode 100644 index 0000000..7aca7ac --- /dev/null +++ b/1.2/src/main/webapp/UnionWizardTD.css @@ -0,0 +1,34 @@ +/** Add css rules here for your application. */ + + +/** Example rules used by the template application (remove for your app) */ +h1 { + font-size: 2em; + font-weight: bold; + color: #777777; + margin: 40px 0px 70px; + text-align: center; +} + +.sendButton { + display: block; + font-size: 16pt; +} + +/** Most GWT widgets already have a style name defined */ +.gwt-DialogBox { + width: 400px; +} + +.dialogVPanel { + margin: 5px; +} + +.serverResponseLabelError { + color: red; +} + +/** Set ids using widget.getElement().setId("idOfElement") */ +#closeButton { + margin: 15px 6px 6px; +} diff --git a/1.2/src/main/webapp/UnionWizardTD.html b/1.2/src/main/webapp/UnionWizardTD.html new file mode 100644 index 0000000..5f67805 --- /dev/null +++ b/1.2/src/main/webapp/UnionWizardTD.html @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + Web Application Starter Project + + + + + + + + + + + + + + + + + + + + + + +

Web Application Starter Project

+ + + + + + + + + + + + +
Please enter your name:
+ + diff --git a/1.2/src/main/webapp/WEB-INF/web.xml b/1.2/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..eb27dcd --- /dev/null +++ b/1.2/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,40 @@ + + + + + + + + TDGWTService + org.gcube.portlets.user.td.gwtservice.server.TDGWTServiceImpl + + + + jUnitHostImpl + com.google.gwt.junit.server.JUnitHostImpl + + + + + + + + TDGWTService + tdgwtservice/TDGWTService + + + jUnitHostImpl + UnionWizardWidgets/junithost/* + + + + + + + + UnionWizardTD.html + + + diff --git a/1.2/src/test/java/org/gcube/portlets/user/td/unionwizardwidget/client/GwtTestUnionWizardTD.java b/1.2/src/test/java/org/gcube/portlets/user/td/unionwizardwidget/client/GwtTestUnionWizardTD.java new file mode 100644 index 0000000..fa0a84e --- /dev/null +++ b/1.2/src/test/java/org/gcube/portlets/user/td/unionwizardwidget/client/GwtTestUnionWizardTD.java @@ -0,0 +1,82 @@ +package org.gcube.portlets.user.td.unionwizardwidget.client; + +import java.util.ArrayList; + +import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTService; +import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; +import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.junit.client.GWTTestCase; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.rpc.ServiceDefTarget; + +/** + * GWT JUnit integration tests must extend GWTTestCase. + * Using "GwtTest*" naming pattern exclude them from running with + * surefire during the test phase. + * + * If you run the tests using the Maven command line, you will have to + * navigate with your browser to a specific url given by Maven. + * See http://mojo.codehaus.org/gwt-maven-plugin/user-guide/testing.html + * for details. + */ +public class GwtTestUnionWizardTD extends GWTTestCase { + + /** + * Must refer to a valid module that sources this class. + */ + public String getModuleName() { + return "org.gcube.portlets.user.unionwizardwidget.UnionWizardTDJUnit"; + } + + /** + * This test will send a request to the server + */ + public void testResource() { + // Create the service that we will test. + TDGWTServiceAsync tdGWTService = GWT.create(TDGWTService.class); + ServiceDefTarget target = (ServiceDefTarget) tdGWTService; + System.out.println(GWT.getModuleBaseURL() + "TDGWTService"); + target.setServiceEntryPoint(GWT.getModuleBaseURL() + "TDGWTService"); + + // Since RPC calls are asynchronous, we will need to wait for a response + // after this test method returns. This line tells the test runner to wait + // up to 7 seconds before timing out. + delayTestFinish(7000); + + // Send a request to the server. + tdGWTService.getTabularResources(new AsyncCallback>() { + + + public void onFailure(Throwable caught) { + // The request resulted in an unexpected error. + fail("Request failure: " + caught.getMessage()); + + } + + public void onSuccess(ArrayList result) { + // Shows the first three resources. + int i=0; + for(TabResource tr:result){ + i++; + System.out.println(tr.toString()); + if(i>3){ + break; + } + } + + assertTrue(result.size()>0); + + // Now that we have received a response, we need to tell the test runner + // that the test is complete. You must call finishTest() after an + // asynchronous test finishes successfully, or the test will time out. + finishTest(); + + } + }); + + } + + +} diff --git a/1.2/src/test/resources/org/gcube/portlets/user/td/unionwizardwidget/UnionWizardTDJUnit.gwt.xml b/1.2/src/test/resources/org/gcube/portlets/user/td/unionwizardwidget/UnionWizardTDJUnit.gwt.xml new file mode 100644 index 0000000..bd02383 --- /dev/null +++ b/1.2/src/test/resources/org/gcube/portlets/user/td/unionwizardwidget/UnionWizardTDJUnit.gwt.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + diff --git a/1.2/templates/INSTALL b/1.2/templates/INSTALL new file mode 100644 index 0000000..e69de29 diff --git a/1.2/templates/LICENSE b/1.2/templates/LICENSE new file mode 100644 index 0000000..cc51139 --- /dev/null +++ b/1.2/templates/LICENSE @@ -0,0 +1,6 @@ +gCube System - License +------------------------------------------------------------ + +The gCube/gCore software is licensed as Free Open Source software conveying to the EUPL (http://ec.europa.eu/idabc/eupl). +The software and documentation is provided by its authors/distributors "as is" and no expressed or +implied warranty is given for its use, quality or fitness for a particular case. \ No newline at end of file diff --git a/1.2/templates/MAINTAINERS b/1.2/templates/MAINTAINERS new file mode 100644 index 0000000..0bc9be3 --- /dev/null +++ b/1.2/templates/MAINTAINERS @@ -0,0 +1 @@ +Giancarlo Panichi (giancarlo.panichi@isti.cnr.it), CNR Pisa, Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" diff --git a/1.2/templates/README b/1.2/templates/README new file mode 100644 index 0000000..7e3ad55 --- /dev/null +++ b/1.2/templates/README @@ -0,0 +1,48 @@ +The gCube System - ${name} +------------------------------------------------------------ + +This work has been supported by the following European projects: iMarine (FP7-INFRASTRUCTURES-2011-2) + +Authors +------- + +Giancarlo Panichi (giancarlo.panichi@isti.cnr.it), CNR Pisa, +Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" + + +Version and Release Date +------------------------ + +v. ${version} (${release.date}) + + +Description +----------- + +${project.description} + + +Download information +-------------------- +Source code is available from SVN: + ${scm.url} + +Binaries can be downloaded from: + http://software.d4science.research-infrastructures.eu/ + + +Documentation +------------- + +${project.description} + +Documentation is available on-line from the Projects Documentation Wiki: + ${wikiurl} + + +Licensing +--------- + +This software is licensed under the terms you may find in the file named "LICENSE" in this directory. + + diff --git a/1.2/templates/changelog.xml b/1.2/templates/changelog.xml new file mode 100644 index 0000000..33661de --- /dev/null +++ b/1.2/templates/changelog.xml @@ -0,0 +1,16 @@ + + + Updated to GWT 2.6.1 + Updated to GXT 3.1.1 + Fixed Creation Date in TabResourcesSelectionPanel [issue #3149] + + + Added flows + Fixed Final and Lock error + + + First Release + + \ No newline at end of file diff --git a/1.2/templates/descriptor.xml b/1.2/templates/descriptor.xml new file mode 100644 index 0000000..b978636 --- /dev/null +++ b/1.2/templates/descriptor.xml @@ -0,0 +1,39 @@ + + servicearchive + + tar.gz + + / + + + ${distroDirectory} + / + true + + README + LICENSE + INSTALL + MAINTAINERS + changelog.xml + + 755 + + + + + ${distroDirectory}/svnpath.txt + /${artifactId} + + + ${configDirectory}/profile.xml + / + + + target/${build.finalName}.${packaging} + /${artifactId} + + + \ No newline at end of file diff --git a/1.2/templates/profile.xml b/1.2/templates/profile.xml new file mode 100644 index 0000000..19ed5bc --- /dev/null +++ b/1.2/templates/profile.xml @@ -0,0 +1,29 @@ + + + + Service + + ${project.description} + PortletsUser + ${project.name} + ${version} + + + ${project.description} + ${project.name} + ${version} + + ${project.groupId} + ${project.artifactId} + ${project.version} + + library + + ${project.build.finalName}.${project.packaging} + + + + + + + diff --git a/1.2/templates/svnpath.txt b/1.2/templates/svnpath.txt new file mode 100644 index 0000000..dcd0d22 --- /dev/null +++ b/1.2/templates/svnpath.txt @@ -0,0 +1 @@ +${scm.url} \ No newline at end of file