Updated ColumnMapping
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@97860 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
72a24a21a6
commit
60c933b91a
|
@ -1,12 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/tabular-data-column-widget-1.2.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||
<classpathentry kind="src" output="target/tabular-data-column-widget-1.3.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/tabular-data-column-widget-1.2.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
|
||||
<classpathentry excluding="**" kind="src" output="target/tabular-data-column-widget-1.3.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
|
@ -44,5 +44,5 @@
|
|||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/tabular-data-column-widget-1.2.0-SNAPSHOT/WEB-INF/classes"/>
|
||||
<classpathentry kind="output" path="target/tabular-data-column-widget-1.3.0-SNAPSHOT/WEB-INF/classes"/>
|
||||
</classpath>
|
||||
|
|
|
@ -4666,3 +4666,35 @@ Compiling...
|
|||
Compilation completed in 0.00 seconds
|
||||
Removing invalidated units
|
||||
Finding entry point classes
|
||||
Public resources found in...
|
||||
Translatable source found in...
|
||||
Found 0 cached/archived units. Used 0 / 2719 units from cache.
|
||||
Compiling...
|
||||
50% complete (ETR: 5 seconds)
|
||||
50% complete (ETR: 5 seconds)
|
||||
50% complete (ETR: 5 seconds)
|
||||
50% complete (ETR: 5 seconds)
|
||||
50% complete (ETR: 5 seconds)
|
||||
50% complete (ETR: 5 seconds)
|
||||
60% complete (ETR: 4 seconds)
|
||||
70% complete (ETR: 3 seconds)
|
||||
80% complete (ETR: 2 seconds)
|
||||
90% complete (ETR: 1 seconds)
|
||||
100% complete (ETR: 0 seconds)
|
||||
Compilation completed in 12.77 seconds
|
||||
Removing invalidated units
|
||||
Finding entry point classes
|
||||
Public resources found in...
|
||||
Translatable source found in...
|
||||
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
|
||||
Compiling...
|
||||
Compilation completed in 0.00 seconds
|
||||
Removing invalidated units
|
||||
Finding entry point classes
|
||||
Public resources found in...
|
||||
Translatable source found in...
|
||||
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
|
||||
Compiling...
|
||||
Compilation completed in 0.00 seconds
|
||||
Removing invalidated units
|
||||
Finding entry point classes
|
||||
|
|
4
pom.xml
4
pom.xml
|
@ -13,7 +13,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.gcube.portlets.user</groupId>
|
||||
<artifactId>tabular-data-column-widget</artifactId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<version>1.3.0-SNAPSHOT</version>
|
||||
|
||||
|
||||
<name>tabular-data-column-widget</name>
|
||||
|
@ -38,7 +38,7 @@
|
|||
<properties>
|
||||
<distroDirectory>${project.basedir}/distro</distroDirectory>
|
||||
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
|
||||
<release.date>2014-06-05</release.date>
|
||||
<release.date>2014-07-04</release.date>
|
||||
<templatesDirectory>templates</templatesDirectory>
|
||||
<distroDirectory>distro</distroDirectory>
|
||||
<configDirectory>config</configDirectory>
|
||||
|
|
|
@ -13,6 +13,12 @@ import com.sencha.gxt.widget.core.client.Window;
|
|||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author "Giancarlo Panichi"
|
||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ColumnMappingDialog extends Window {
|
||||
protected String WIDTH = "650px";
|
||||
protected String HEIGHT = "530px";
|
||||
|
|
|
@ -3,8 +3,6 @@ package org.gcube.portlets.user.td.columnwidget.client.mapping;
|
|||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.DimensionRow;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author "Giancarlo Panichi"
|
||||
|
@ -15,7 +13,7 @@ public class ColumnMappingList implements Serializable{
|
|||
|
||||
private static final long serialVersionUID = 733237646914552402L;
|
||||
|
||||
protected ArrayList<DimensionRow> mapping;
|
||||
protected ArrayList<ColumnMappingData> mapping;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -28,16 +26,16 @@ public class ColumnMappingList implements Serializable{
|
|||
*
|
||||
* @param mapping
|
||||
*/
|
||||
public ColumnMappingList(ArrayList<DimensionRow> mapping){
|
||||
public ColumnMappingList(ArrayList<ColumnMappingData> mapping){
|
||||
this.mapping=mapping;
|
||||
|
||||
}
|
||||
|
||||
public ArrayList<DimensionRow> getMapping() {
|
||||
public ArrayList<ColumnMappingData> getMapping() {
|
||||
return mapping;
|
||||
}
|
||||
|
||||
public void setMapping(ArrayList<DimensionRow> mapping) {
|
||||
public void setMapping(ArrayList<ColumnMappingData> mapping) {
|
||||
this.mapping = mapping;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,51 +1,67 @@
|
|||
package org.gcube.portlets.user.td.columnwidget.client.mapping;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.user.td.columnwidget.client.custom.IconButton;
|
||||
import org.gcube.portlets.user.td.columnwidget.client.dimension.DimensionRowSelectionDialog;
|
||||
import org.gcube.portlets.user.td.columnwidget.client.dimension.DimensionRowSelectionListener;
|
||||
import org.gcube.portlets.user.td.columnwidget.client.dimension.DimensionRowsProperties;
|
||||
import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.DimensionRow;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.CellData;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
|
||||
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.web.bindery.event.shared.EventBus;
|
||||
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.FramedPanel;
|
||||
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.VerticalLayoutContainer;
|
||||
import com.sencha.gxt.widget.core.client.form.TextField;
|
||||
import com.sencha.gxt.widget.core.client.event.TriggerClickEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.TriggerClickEvent.TriggerClickHandler;
|
||||
import com.sencha.gxt.widget.core.client.form.ComboBox;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author "Giancarlo Panichi"
|
||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
* @author "Giancarlo Panichi" email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ColumnMappingPanel extends FramedPanel implements
|
||||
DimensionRowSelectionListener {
|
||||
protected String WIDTH = "560px";
|
||||
protected String HEIGHT = "520px";
|
||||
public class ColumnMappingPanel extends FramedPanel {
|
||||
protected static final String WIDTH = "560px";
|
||||
protected static final String HEIGHT = "520px";
|
||||
protected static final String COMBOWIDTH ="120px";
|
||||
|
||||
|
||||
protected ColumnMappingPanel thisPanel;
|
||||
|
||||
|
||||
protected ColumnMappingDialog parent;
|
||||
protected TRId trId;
|
||||
protected ColumnData selectedColumn;
|
||||
protected TabResource dimensionTR;
|
||||
protected ColumnData columnReference;
|
||||
protected ColumnData referenceColumn;
|
||||
protected EventBus eventBus;
|
||||
|
||||
|
||||
protected VerticalLayoutContainer vert;
|
||||
protected String itemIdSourceValueArg;
|
||||
protected String itemIdTargetValueArg;
|
||||
protected String itemIdBtnAdd;
|
||||
protected String itemIdBtnDel;
|
||||
|
||||
|
||||
protected ColumnMappingList columnMappingList;
|
||||
|
||||
protected ArrayList<ColumnMappingData> mapping;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
@ -53,50 +69,162 @@ public class ColumnMappingPanel extends FramedPanel implements
|
|||
* @param trId
|
||||
* @param selectedColumn
|
||||
* @param dimensionTR
|
||||
* @param columnReference
|
||||
* @param referenceColumn
|
||||
* @param eventBus
|
||||
*/
|
||||
public ColumnMappingPanel(ColumnMappingDialog parent, TRId trId,
|
||||
ColumnData selectedColumn, TabResource dimensionTR,
|
||||
ColumnData columnReference, EventBus eventBus) {
|
||||
ColumnData referenceColumn, EventBus eventBus) {
|
||||
this.parent = parent;
|
||||
this.trId = trId;
|
||||
this.selectedColumn = selectedColumn;
|
||||
this.dimensionTR = dimensionTR;
|
||||
this.columnReference = columnReference;
|
||||
this.referenceColumn = referenceColumn;
|
||||
this.eventBus = eventBus;
|
||||
thisPanel=this;
|
||||
thisPanel = this;
|
||||
Log.debug("ColumnMappingPanel: [parent:" + parent + " , trId:" + trId
|
||||
+ ", selectedColumn:" + selectedColumn + ", dimensionTR:"
|
||||
+ dimensionTR + ", columnReference:" + columnReference
|
||||
+ ", eventBus:" + eventBus
|
||||
+ "]");
|
||||
columnMappingList=new ColumnMappingList();
|
||||
|
||||
|
||||
+ dimensionTR + ", columnReference:" + referenceColumn
|
||||
+ ", eventBus:" + eventBus + "]");
|
||||
columnMappingList = new ColumnMappingList();
|
||||
mapping = new ArrayList<ColumnMappingData>();
|
||||
}
|
||||
|
||||
|
||||
protected void setup(){
|
||||
|
||||
protected void setup() {
|
||||
itemIdSourceValueArg = "SourceArg" + selectedColumn.getName();
|
||||
itemIdTargetValueArg = "TargetArg" + selectedColumn.getName();
|
||||
|
||||
|
||||
|
||||
vert = new VerticalLayoutContainer();
|
||||
vert.setScrollMode(ScrollMode.AUTO);
|
||||
vert.setAdjustForScroll(true);
|
||||
|
||||
|
||||
final HBoxLayoutContainer horiz = new HBoxLayoutContainer();
|
||||
|
||||
// Source Combo
|
||||
DimensionRowsProperties propsSource = GWT
|
||||
.create(DimensionRowsProperties.class);
|
||||
ListStore<DimensionRow> storeComboSourceValue = new ListStore<DimensionRow>(
|
||||
propsSource.rowId());
|
||||
|
||||
final ComboBox<DimensionRow> comboSourceValue = new ComboBox<DimensionRow>(
|
||||
storeComboSourceValue, propsSource.value());
|
||||
comboSourceValue.setItemId(itemIdSourceValueArg);
|
||||
|
||||
Log.debug("ComboSourceValue created");
|
||||
|
||||
final DimensionRowSelectionListener sourceValueSelectedListener = new DimensionRowSelectionListener() {
|
||||
|
||||
@Override
|
||||
public void selectedDimensionRow(DimensionRow dimensionRow) {
|
||||
Log.debug("Source DimensionRow selected: " + dimensionRow);
|
||||
comboSourceValue.setValue(dimensionRow, true);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void abortedDimensionRowSelection() {
|
||||
Log.debug("Source DimensionRow selection aborted");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void failedDimensionRowSelection(String reason, String detail) {
|
||||
Log.error("Source DimensionRow selection error: " + reason);
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
comboSourceValue.addTriggerClickHandler(new TriggerClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onTriggerClick(TriggerClickEvent event) {
|
||||
Log.debug("ComboSourceValue TriggerClickEvent");
|
||||
comboSourceValue.collapse();
|
||||
|
||||
CellData cellData = new CellData("", selectedColumn.getName(),
|
||||
selectedColumn.getColumnId(),
|
||||
selectedColumn.getLabel(), null, 0, 0);
|
||||
|
||||
DimensionRowSelectionDialog dimensionRowSelectionDialog = new DimensionRowSelectionDialog(
|
||||
selectedColumn, cellData, false, eventBus);
|
||||
dimensionRowSelectionDialog
|
||||
.addListener(sourceValueSelectedListener);
|
||||
dimensionRowSelectionDialog.show();
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
comboSourceValue.setEmptyText("Select a source...");
|
||||
comboSourceValue.setWidth(COMBOWIDTH);
|
||||
comboSourceValue.setEditable(false);
|
||||
comboSourceValue.setTriggerAction(TriggerAction.ALL);
|
||||
|
||||
//Target Combo
|
||||
DimensionRowsProperties propsTarget = GWT
|
||||
.create(DimensionRowsProperties.class);
|
||||
ListStore<DimensionRow> storeComboTargetValue = new ListStore<DimensionRow>(
|
||||
propsTarget.rowId());
|
||||
|
||||
final ComboBox<DimensionRow> comboTargetValue = new ComboBox<DimensionRow>(
|
||||
storeComboTargetValue, propsTarget.value());
|
||||
comboTargetValue.setItemId(itemIdTargetValueArg);
|
||||
|
||||
Log.debug("ComboTargetValue created");
|
||||
|
||||
final DimensionRowSelectionListener targetValueSelectedListener = new DimensionRowSelectionListener() {
|
||||
|
||||
@Override
|
||||
public void selectedDimensionRow(DimensionRow dimensionRow) {
|
||||
Log.debug("Target DimensionRow selected: " + dimensionRow);
|
||||
comboTargetValue.setValue(dimensionRow, true);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void abortedDimensionRowSelection() {
|
||||
Log.debug("Target DimensionRow selection aborted");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void failedDimensionRowSelection(String reason, String detail) {
|
||||
Log.error("Target DimensionRow selection error: " + reason);
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
comboTargetValue.addTriggerClickHandler(new TriggerClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onTriggerClick(TriggerClickEvent event) {
|
||||
Log.debug("ComboTargetValue TriggerClickEvent");
|
||||
comboTargetValue.collapse();
|
||||
|
||||
CellData cellData = new CellData("", referenceColumn.getName(),
|
||||
referenceColumn.getColumnId(),
|
||||
referenceColumn.getLabel(), null, 0, 0);
|
||||
|
||||
DimensionRowSelectionDialog dimensionRowSelectionDialog = new DimensionRowSelectionDialog(
|
||||
referenceColumn, cellData, true, eventBus);
|
||||
dimensionRowSelectionDialog
|
||||
.addListener(targetValueSelectedListener);
|
||||
dimensionRowSelectionDialog.show();
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
comboTargetValue.setEmptyText("Select a target...");
|
||||
comboTargetValue.setWidth(COMBOWIDTH);
|
||||
comboTargetValue.setEditable(false);
|
||||
comboTargetValue.setTriggerAction(TriggerAction.ALL);
|
||||
|
||||
|
||||
|
||||
|
||||
final TextField sourceValueArg = new TextField();
|
||||
sourceValueArg.setItemId(itemIdSourceValueArg);
|
||||
|
||||
|
||||
final TextField targetValueArg = new TextField();
|
||||
targetValueArg.setItemId(itemIdTargetValueArg);
|
||||
|
||||
final IconButton btnAdd = new IconButton();
|
||||
btnAdd.setItemId(itemIdBtnAdd);
|
||||
btnAdd.setIcon(ResourceBundle.INSTANCE.add());
|
||||
|
@ -110,7 +238,7 @@ public class ColumnMappingPanel extends FramedPanel implements
|
|||
|
||||
}
|
||||
});
|
||||
btnAdd.setVisible(false);
|
||||
btnAdd.setVisible(true);
|
||||
|
||||
final IconButton btnDel = new IconButton();
|
||||
btnDel.setItemId(itemIdBtnDel);
|
||||
|
@ -123,7 +251,7 @@ public class ColumnMappingPanel extends FramedPanel implements
|
|||
if (vert.getWidgetCount() == 0) {
|
||||
setup();
|
||||
} else {
|
||||
|
||||
|
||||
}
|
||||
thisPanel.forceLayout();
|
||||
vert.forceLayout();
|
||||
|
@ -133,32 +261,21 @@ public class ColumnMappingPanel extends FramedPanel implements
|
|||
btnDel.setVisible(false);
|
||||
|
||||
|
||||
|
||||
horiz.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
||||
horiz.setPack(BoxLayoutPack.START);
|
||||
|
||||
horiz.add(comboSourceValue, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||
horiz.add(comboTargetValue, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||
horiz.add(btnAdd, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||
horiz.add(btnDel, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||
|
||||
vert.add(horiz);
|
||||
add(vert);
|
||||
}
|
||||
|
||||
protected void addColumnMappingData(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void selectedDimensionRow(DimensionRow dimensionRow) {
|
||||
// TODO Auto-generated method stub
|
||||
protected void addColumnMappingData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void abortedDimensionRowSelection() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void failedDimensionRowSelection(String reason, String detail) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
<ReleaseNotes>
|
||||
<Changeset component="${groupId}.${artifactId}.1-3-0"
|
||||
date="2014-07-04">
|
||||
<Change>Added Column Mapping</Change>
|
||||
<Change>Fixed Replace</Change>
|
||||
</Changeset>
|
||||
<Changeset component="${groupId}.${artifactId}.1-2-0"
|
||||
date="2014-06-05">
|
||||
<Change>Added Replace Batch</Change>
|
||||
|
|
Loading…
Reference in New Issue