Minor Updated
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@91799 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
6e9ef3b4ae
commit
a38018ff3a
|
@ -30,6 +30,7 @@
|
||||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="output" path="target/tabular-data-expression-widget-1.0.0-SNAPSHOT/WEB-INF/classes"/>
|
<classpathentry kind="output" path="target/tabular-data-expression-widget-1.0.0-SNAPSHOT/WEB-INF/classes"/>
|
||||||
|
|
51
pom.xml
51
pom.xml
|
@ -14,15 +14,15 @@
|
||||||
<groupId>org.gcube.portlets.user</groupId>
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
<artifactId>tabular-data-expression-widget</artifactId>
|
<artifactId>tabular-data-expression-widget</artifactId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
|
||||||
|
|
||||||
<name>tabular-data-expression-widget</name>
|
<name>tabular-data-expression-widget</name>
|
||||||
<description>tabular-data-expression-widget allows to create expression on tabular resource</description>
|
<description>tabular-data-expression-widget allows to create expression on tabular resource</description>
|
||||||
|
|
||||||
<scm>
|
<scm>
|
||||||
<url>https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget</url>
|
<url>https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget</url>
|
||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
<developer>
|
<developer>
|
||||||
<name>Giancarlo Panichi</name>
|
<name>Giancarlo Panichi</name>
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
</roles>
|
</roles>
|
||||||
</developer>
|
</developer>
|
||||||
</developers>
|
</developers>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<distroDirectory>${project.basedir}/distro</distroDirectory>
|
<distroDirectory>${project.basedir}/distro</distroDirectory>
|
||||||
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
|
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
<templatesDirectory>templates</templatesDirectory>
|
<templatesDirectory>templates</templatesDirectory>
|
||||||
<distroDirectory>distro</distroDirectory>
|
<distroDirectory>distro</distroDirectory>
|
||||||
<configDirectory>config</configDirectory>
|
<configDirectory>config</configDirectory>
|
||||||
|
|
||||||
<!-- Convenience property to set the GWT version -->
|
<!-- Convenience property to set the GWT version -->
|
||||||
<gwtVersion>2.5.1</gwtVersion>
|
<gwtVersion>2.5.1</gwtVersion>
|
||||||
<!-- To make this work on gwt-run you need to set up global env vars. on
|
<!-- To make this work on gwt-run you need to set up global env vars. on
|
||||||
|
@ -53,9 +53,9 @@
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
<profile>
|
<profile>
|
||||||
<id>localRun</id>
|
<id>localRun</id>
|
||||||
|
@ -74,8 +74,8 @@
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</profile>
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.gwt</groupId>
|
<groupId>com.google.gwt</groupId>
|
||||||
|
@ -85,8 +85,8 @@
|
||||||
<groupId>com.google.gwt</groupId>
|
<groupId>com.google.gwt</groupId>
|
||||||
<artifactId>gwt-user</artifactId>
|
<artifactId>gwt-user</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.validation</groupId>
|
<groupId>javax.validation</groupId>
|
||||||
<artifactId>validation-api</artifactId>
|
<artifactId>validation-api</artifactId>
|
||||||
|
@ -107,8 +107,18 @@
|
||||||
<version>3.0.1</version>
|
<version>3.0.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.applicationsupportlayer</groupId>
|
||||||
|
<artifactId>aslcore</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.portal</groupId>
|
||||||
|
<artifactId>custom-portal-handler</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<!-- tabular-data-gwt-service -->
|
<!-- tabular-data-gwt-service -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.portlets.user</groupId>
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
|
@ -137,7 +147,7 @@
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
<!-- <scope>compile</scope> -->
|
<!-- <scope>compile</scope> -->
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- JUNIT -->
|
<!-- JUNIT -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
|
@ -145,8 +155,8 @@
|
||||||
<version>4.8.1</version>
|
<version>4.8.1</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
||||||
|
@ -163,8 +173,8 @@
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
||||||
|
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
@ -182,7 +192,7 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<!-- GWT Maven Plugin -->
|
<!-- GWT Maven Plugin -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
@ -201,7 +211,7 @@
|
||||||
<module>org.gcube.portlets.user.td.expressionwidget.ExpressionWidget</module>
|
<module>org.gcube.portlets.user.td.expressionwidget.ExpressionWidget</module>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<!-- Maven -->
|
<!-- Maven -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-resources-plugin</artifactId>
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
@ -305,4 +315,5 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
<packaging>war</packaging>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
<!-- Specify the app entry point class. -->
|
<!-- Specify the app entry point class. -->
|
||||||
<!-- <entry-point class='org.gcube.portlets.user.td.expressionwidget.client.ExpressionWidgetEntry' /> -->
|
<entry-point class='org.gcube.portlets.user.td.expressionwidget.client.ExpressionWidgetEntry' />
|
||||||
|
|
||||||
<!-- Specify the paths for translatable code -->
|
<!-- Specify the paths for translatable code -->
|
||||||
<source path='client' />
|
<source path='client' />
|
||||||
|
|
|
@ -7,14 +7,12 @@ import org.gcube.portlets.user.td.widgetcommonevent.client.type.ExpressionType;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expression;
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expression;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_ExpressionContainer;
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_ExpressionContainer;
|
||||||
|
|
||||||
import com.google.web.bindery.event.shared.EventBus;
|
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
|
import com.google.web.bindery.event.shared.EventBus;
|
||||||
import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign;
|
import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign;
|
||||||
import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;
|
import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;
|
||||||
import com.sencha.gxt.core.client.util.Margins;
|
import com.sencha.gxt.core.client.util.Margins;
|
||||||
import com.sencha.gxt.widget.core.client.FramedPanel;
|
import com.sencha.gxt.widget.core.client.FramedPanel;
|
||||||
import com.sencha.gxt.widget.core.client.button.CellButtonBase;
|
|
||||||
import com.sencha.gxt.widget.core.client.button.TextButton;
|
import com.sencha.gxt.widget.core.client.button.TextButton;
|
||||||
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
|
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.BoxLayoutContainer.BoxLayoutPack;
|
||||||
|
@ -35,61 +33,79 @@ import com.sencha.gxt.widget.core.client.form.TextField;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ColumnExpressionPanel extends FramedPanel {
|
public class ColumnExpressionPanel extends FramedPanel {
|
||||||
|
private enum ColumnExpressionPanelType {
|
||||||
|
ColumnFilter, ColumnRule;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected ColumnExpressionPanelType type;
|
||||||
protected String WIDTH = "640px";
|
protected String WIDTH = "640px";
|
||||||
protected String HEIGHT = "520px";
|
protected String HEIGHT = "520px";
|
||||||
protected EventBus eventBus;
|
protected EventBus eventBus;
|
||||||
|
|
||||||
protected ColumnExpressionDialog parent;
|
protected ColumnExpressionDialog parentRuleDialog;
|
||||||
|
protected FilterColumnDialog parentFilterDialog;
|
||||||
|
|
||||||
protected ColumnData column;
|
protected ColumnData column;
|
||||||
protected ConditionWidget conditionWidget;
|
protected ConditionWidget conditionWidget;
|
||||||
|
|
||||||
|
|
||||||
|
private TextButton btnApply;
|
||||||
|
private TextButton btnSearch;
|
||||||
|
private TextButton btnSave;
|
||||||
|
private TextButton btnClose;
|
||||||
|
|
||||||
|
public ColumnExpressionPanel(FilterColumnDialog parentFilterDialog, ColumnData column) {
|
||||||
|
type = ColumnExpressionPanelType.ColumnFilter;
|
||||||
|
this.parentFilterDialog=parentFilterDialog;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param trId
|
* @param trId
|
||||||
* @param columnName
|
* @param columnName
|
||||||
*/
|
*/
|
||||||
public ColumnExpressionPanel(ColumnExpressionDialog parent, ColumnData column, EventBus eventBus) {
|
public ColumnExpressionPanel(ColumnExpressionDialog parent,
|
||||||
this.parent=parent;
|
ColumnData column, EventBus eventBus) {
|
||||||
|
type = ColumnExpressionPanelType.ColumnRule;
|
||||||
|
this.parentRuleDialog = parent;
|
||||||
this.column = column;
|
this.column = column;
|
||||||
this.eventBus=eventBus;
|
this.eventBus = eventBus;
|
||||||
Log.debug(column.toString());
|
Log.debug(column.toString());
|
||||||
|
|
||||||
create();
|
create();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void create() {
|
protected void create() {
|
||||||
setBodyBorder(false);
|
setBodyBorder(false);
|
||||||
setHeaderVisible(false);
|
setHeaderVisible(false);
|
||||||
|
|
||||||
VerticalLayoutContainer basicLayout = new VerticalLayoutContainer();
|
VerticalLayoutContainer basicLayout = new VerticalLayoutContainer();
|
||||||
basicLayout.setScrollMode(ScrollMode.AUTO);
|
basicLayout.setScrollMode(ScrollMode.AUTO);
|
||||||
basicLayout.setAdjustForScroll(true);
|
basicLayout.setAdjustForScroll(true);
|
||||||
|
|
||||||
FieldSet properties = new FieldSet();
|
|
||||||
properties.setHeadingText("Properties");
|
|
||||||
properties.setCollapsible(false);
|
|
||||||
|
|
||||||
VerticalLayoutContainer propertiesLayout = new VerticalLayoutContainer();
|
|
||||||
properties.add(propertiesLayout);
|
|
||||||
|
|
||||||
TextField columnType = new TextField();
|
FieldSet properties=null;
|
||||||
columnType.setToolTip("The type of column");
|
if (type == ColumnExpressionPanelType.ColumnRule) {
|
||||||
columnType.setReadOnly(true);
|
properties = new FieldSet();
|
||||||
columnType.setValue(column.getTypeCode());
|
properties.setHeadingText("Properties");
|
||||||
propertiesLayout.add(new FieldLabel(columnType, "Column Type"),
|
properties.setCollapsible(false);
|
||||||
new VerticalLayoutData(1, -1));
|
|
||||||
|
|
||||||
|
VerticalLayoutContainer propertiesLayout = new VerticalLayoutContainer();
|
||||||
TextField dataType = new TextField();
|
properties.add(propertiesLayout);
|
||||||
dataType.setToolTip("The data type");
|
|
||||||
dataType.setReadOnly(true);
|
|
||||||
dataType.setValue(column.getDataTypeName());
|
|
||||||
propertiesLayout.add(new FieldLabel(dataType, "Data Type"),
|
|
||||||
new VerticalLayoutData(1, -1));
|
|
||||||
|
|
||||||
|
TextField columnType = new TextField();
|
||||||
|
columnType.setToolTip("The type of column");
|
||||||
|
columnType.setReadOnly(true);
|
||||||
|
columnType.setValue(column.getTypeCode());
|
||||||
|
propertiesLayout.add(new FieldLabel(columnType, "Column Type"),
|
||||||
|
new VerticalLayoutData(1, -1));
|
||||||
|
|
||||||
|
TextField dataType = new TextField();
|
||||||
|
dataType.setToolTip("The data type");
|
||||||
|
dataType.setReadOnly(true);
|
||||||
|
dataType.setValue(column.getDataTypeName());
|
||||||
|
propertiesLayout.add(new FieldLabel(dataType, "Data Type"),
|
||||||
|
new VerticalLayoutData(1, -1));
|
||||||
|
|
||||||
|
}
|
||||||
FieldSet conditions = new FieldSet();
|
FieldSet conditions = new FieldSet();
|
||||||
conditions.setHeadingText("Conditions");
|
conditions.setHeadingText("Conditions");
|
||||||
conditions.setCollapsible(false);
|
conditions.setCollapsible(false);
|
||||||
|
@ -101,114 +117,134 @@ public class ColumnExpressionPanel extends FramedPanel {
|
||||||
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
||||||
flowButton.setPack(BoxLayoutPack.CENTER);
|
flowButton.setPack(BoxLayoutPack.CENTER);
|
||||||
|
|
||||||
TextButton btnApply = new TextButton("Apply");
|
btnApply = new TextButton("Apply");
|
||||||
btnApply.setIcon(ExpressionResources.INSTANCE.apply());
|
btnApply.setIcon(ExpressionResources.INSTANCE.apply());
|
||||||
btnApply.setIconAlign(IconAlign.RIGHT);
|
btnApply.setIconAlign(IconAlign.RIGHT);
|
||||||
btnApply.setTitle("Apply rule");
|
btnApply.setTitle("Apply rule");
|
||||||
btnApply.addSelectHandler(new SelectHandler() {
|
btnApply.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
public void onSelect(SelectEvent event) {
|
public void onSelect(SelectEvent event) {
|
||||||
Log.debug("Pressed Apply");
|
Log.debug("Pressed Apply");
|
||||||
applyRule();
|
applyRule();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
TextButton btnSearch = new TextButton("Search");
|
btnSearch = new TextButton("Search");
|
||||||
btnSearch.setIcon(ExpressionResources.INSTANCE.search());
|
btnSearch.setIcon(ExpressionResources.INSTANCE.search());
|
||||||
btnSearch.setIconAlign(IconAlign.RIGHT);
|
btnSearch.setIconAlign(IconAlign.RIGHT);
|
||||||
btnSearch.setTitle("Search rule");
|
btnSearch.setTitle("Search rule");
|
||||||
btnSearch.addSelectHandler(new SelectHandler() {
|
btnSearch.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
public void onSelect(SelectEvent event) {
|
public void onSelect(SelectEvent event) {
|
||||||
Log.debug("Pressed Search");
|
Log.debug("Pressed Search");
|
||||||
searchRule();
|
searchRule();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
btnSave = new TextButton("Save");
|
||||||
|
|
||||||
TextButton btnSave = new TextButton("Save");
|
|
||||||
btnSave.setIcon(ExpressionResources.INSTANCE.save());
|
btnSave.setIcon(ExpressionResources.INSTANCE.save());
|
||||||
btnSave.setIconAlign(IconAlign.RIGHT);
|
btnSave.setIconAlign(IconAlign.RIGHT);
|
||||||
btnSave.setTitle("Save rule");
|
btnSave.setTitle("Save rule");
|
||||||
btnSave.addSelectHandler(new SelectHandler() {
|
btnSave.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
public void onSelect(SelectEvent event) {
|
public void onSelect(SelectEvent event) {
|
||||||
Log.debug("Pressed Save");
|
Log.debug("Pressed Save");
|
||||||
saveRule();
|
saveRule();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
CellButtonBase<?> btnClose = new TextButton("Close");
|
btnClose = new TextButton("Close");
|
||||||
btnClose.setIcon(ExpressionResources.INSTANCE.close());
|
btnClose.setIcon(ExpressionResources.INSTANCE.close());
|
||||||
btnClose.setIconAlign(IconAlign.RIGHT);
|
btnClose.setIconAlign(IconAlign.RIGHT);
|
||||||
btnClose.setTitle("Cancel rule");
|
btnClose.setTitle("Cancel rule");
|
||||||
btnClose.addSelectHandler(new SelectHandler() {
|
btnClose.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
public void onSelect(SelectEvent event) {
|
public void onSelect(SelectEvent event) {
|
||||||
Log.debug("Pressed Close");
|
Log.debug("Pressed Close");
|
||||||
close();
|
close();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
flowButton.add(btnApply, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
flowButton.add(btnApply, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||||
flowButton.add(btnSave, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
flowButton.add(btnSave, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||||
flowButton.add(btnSearch, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
flowButton.add(btnSearch, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||||
flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||||
|
|
||||||
basicLayout.add(properties, new VerticalLayoutData(-1, -1, new Margins(
|
if (type == ColumnExpressionPanelType.ColumnRule) {
|
||||||
1)));
|
basicLayout.add(properties, new VerticalLayoutData(-1, -1,
|
||||||
|
new Margins(1)));
|
||||||
|
}
|
||||||
basicLayout.add(conditions, new VerticalLayoutData(-1, -1, new Margins(
|
basicLayout.add(conditions, new VerticalLayoutData(-1, -1, new Margins(
|
||||||
1)));
|
1)));
|
||||||
basicLayout.add(flowButton, new VerticalLayoutData(-1, -1, new Margins(5,2,5,
|
basicLayout.add(flowButton, new VerticalLayoutData(-1, -1, new Margins(
|
||||||
2)));
|
5, 2, 5, 2)));
|
||||||
|
|
||||||
add(basicLayout);
|
add(basicLayout);
|
||||||
show();
|
show();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void applyRule() {
|
protected void applyRule() {
|
||||||
C_Expression exp=conditionWidget.getExpression();
|
C_Expression exp = conditionWidget.getExpression();
|
||||||
parent.setExpression(exp);
|
if (type == ColumnExpressionPanelType.ColumnRule) {
|
||||||
ExpressionEvent expressionEvent= new ExpressionEvent(ExpressionType.CREATECOLUMNEXPRESSION);
|
parentRuleDialog.setExpression(exp);
|
||||||
C_ExpressionContainer container=new C_ExpressionContainer();
|
ExpressionEvent expressionEvent = new ExpressionEvent(
|
||||||
container.setId(C_ExpressionContainer.Contains.C_Expression);
|
ExpressionType.CREATECOLUMNEXPRESSION);
|
||||||
container.setExp(exp);
|
C_ExpressionContainer container = new C_ExpressionContainer();
|
||||||
expressionEvent.setC_ExpressionContainer(container);
|
container.setId(C_ExpressionContainer.Contains.C_Expression);
|
||||||
expressionEvent.setTrId(column.getTrId());
|
container.setExp(exp);
|
||||||
expressionEvent.setColumnId(column.getColumnId());
|
expressionEvent.setC_ExpressionContainer(container);
|
||||||
expressionEvent.setColumnName(column.getName());
|
expressionEvent.setTrId(column.getTrId());
|
||||||
Log.debug(expressionEvent.toString());
|
expressionEvent.setColumnId(column.getColumnId());
|
||||||
parent.hide();
|
expressionEvent.setColumnName(column.getName());
|
||||||
eventBus.fireEvent(expressionEvent);
|
Log.debug(expressionEvent.toString());
|
||||||
|
parentRuleDialog.hide();
|
||||||
|
eventBus.fireEvent(expressionEvent);
|
||||||
|
} else {
|
||||||
|
parentFilterDialog.setExpression(exp);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void saveRule() {
|
protected void saveRule() {
|
||||||
//Expression exp=conditionWidget.getExpression();
|
|
||||||
//parent.setExpression(exp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void searchRule(){
|
protected void searchRule() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void close() {
|
protected void close() {
|
||||||
ExpressionEvent expressionEvent= new ExpressionEvent(ExpressionType.EXPRESSIONNULL);
|
if (type == ColumnExpressionPanelType.ColumnRule) {
|
||||||
Log.debug(expressionEvent.toString());
|
ExpressionEvent expressionEvent = new ExpressionEvent(
|
||||||
parent.hide();
|
ExpressionType.EXPRESSIONNULL);
|
||||||
eventBus.fireEvent(expressionEvent);
|
Log.debug(expressionEvent.toString());
|
||||||
|
parentRuleDialog.hide();
|
||||||
|
eventBus.fireEvent(expressionEvent);
|
||||||
|
} else {
|
||||||
|
parentFilterDialog.close();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TextButton getBtnApply() {
|
||||||
|
return btnApply;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TextButton getBtnSearch() {
|
||||||
|
return btnSearch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TextButton getBtnSave() {
|
||||||
|
return btnSave;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TextButton getBtnClose() {
|
||||||
|
return btnClose;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,124 @@
|
||||||
|
package org.gcube.portlets.user.td.expressionwidget.client;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.td.expressionwidget.client.resource.ExpressionResources;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expression;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeCode;
|
||||||
|
|
||||||
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
|
import com.google.gwt.user.client.ui.HTML;
|
||||||
|
import com.google.web.bindery.event.shared.EventBus;
|
||||||
|
import com.sencha.gxt.widget.core.client.Window;
|
||||||
|
|
||||||
|
public class FilterColumnDialog extends Window {
|
||||||
|
protected String WIDTH = "650px";
|
||||||
|
protected String HEIGHT = "426px";
|
||||||
|
protected ColumnExpressionPanel columnExpressionPanel;
|
||||||
|
protected C_Expression exp = null;
|
||||||
|
protected ColumnData column = null;
|
||||||
|
protected TRId trId;
|
||||||
|
protected String columnName = null;
|
||||||
|
protected EventBus eventBus;
|
||||||
|
|
||||||
|
public FilterColumnDialog(String columnId,
|
||||||
|
ColumnTypeCode columnTypeCode, ColumnDataType dataTypeName,
|
||||||
|
EventBus eventBus) {
|
||||||
|
initWindow();
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
column = new ColumnData();
|
||||||
|
column.setColumnId(columnId);
|
||||||
|
column.setDataTypeName(dataTypeName.toString());
|
||||||
|
column.setTypeCode(columnTypeCode.toString());
|
||||||
|
create();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterColumnDialog(TRId trId, String columnName,
|
||||||
|
EventBus eventBus) {
|
||||||
|
initWindow();
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
this.trId = trId;
|
||||||
|
this.columnName = columnName;
|
||||||
|
load(trId, columnName);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void initWindow(){
|
||||||
|
setWidth(WIDTH);
|
||||||
|
setHeight(HEIGHT);
|
||||||
|
setBodyBorder(false);
|
||||||
|
setResizable(false);
|
||||||
|
setHeadingText("New Rule");
|
||||||
|
setClosable(false);
|
||||||
|
getHeader().setIcon(ExpressionResources.INSTANCE.rule());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void create() {
|
||||||
|
if (column.getTypeCode()
|
||||||
|
.compareTo(ColumnTypeCode.ANNOTATION.toString()) == 0
|
||||||
|
|| column.getTypeCode().compareTo(
|
||||||
|
ColumnTypeCode.ATTRIBUTE.toString()) == 0
|
||||||
|
|| column.getTypeCode().compareTo(
|
||||||
|
ColumnTypeCode.CODE.toString()) == 0
|
||||||
|
|| column.getTypeCode().compareTo(
|
||||||
|
ColumnTypeCode.CODEDESCRIPTION.toString()) == 0
|
||||||
|
|| column.getTypeCode().compareTo(
|
||||||
|
ColumnTypeCode.CODENAME.toString()) == 0
|
||||||
|
|| column.getTypeCode().compareTo(
|
||||||
|
ColumnTypeCode.MEASURE.toString()) == 0) {
|
||||||
|
columnExpressionPanel = new ColumnExpressionPanel(this, column);
|
||||||
|
add(columnExpressionPanel);
|
||||||
|
} else {
|
||||||
|
HTML errorMessage = new HTML(
|
||||||
|
"This type of column is not supported for now!");
|
||||||
|
add(errorMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public C_Expression getExpression() {
|
||||||
|
return exp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setExpression(C_Expression exp) {
|
||||||
|
Log.debug("New Expression set:" + exp.toString());
|
||||||
|
this.exp = exp;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void close(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected void load(TRId trId, String columnName) {
|
||||||
|
TDGWTServiceAsync.INSTANCE.getColumn(trId, columnName,
|
||||||
|
new AsyncCallback<ColumnData>() {
|
||||||
|
|
||||||
|
public void onFailure(Throwable caught) {
|
||||||
|
Log.error("Error retrieving column: "
|
||||||
|
+ caught.getMessage());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onSuccess(ColumnData result) {
|
||||||
|
Log.debug("Retrived column: " + result);
|
||||||
|
column = result;
|
||||||
|
create();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -6,6 +6,7 @@ package org.gcube.portlets.user.td.expressionwidget.client.rpc;
|
||||||
|
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.expressionwidget.shared.expression.ExpressionServiceException;
|
import org.gcube.portlets.user.td.expressionwidget.shared.expression.ExpressionServiceException;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expression;
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expression;
|
||||||
|
|
||||||
import com.google.gwt.user.client.rpc.RemoteService;
|
import com.google.gwt.user.client.rpc.RemoteService;
|
||||||
|
@ -29,7 +30,7 @@ import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
|
||||||
@RemoteServiceRelativePath("ExpressionService")
|
@RemoteServiceRelativePath("ExpressionService")
|
||||||
public interface ExpressionService extends RemoteService {
|
public interface ExpressionService extends RemoteService {
|
||||||
|
|
||||||
public Void submitExpression(C_Expression expression) throws ExpressionServiceException;
|
public void submitColumnFilter(ColumnData column, C_Expression expression) throws ExpressionServiceException;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
*/
|
*/
|
||||||
package org.gcube.portlets.user.td.expressionwidget.client.rpc;
|
package org.gcube.portlets.user.td.expressionwidget.client.rpc;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expression;
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expression;
|
||||||
|
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
|
@ -20,6 +21,6 @@ public interface ExpressionServiceAsync {
|
||||||
public static ExpressionServiceAsync INSTANCE = (ExpressionServiceAsync) GWT
|
public static ExpressionServiceAsync INSTANCE = (ExpressionServiceAsync) GWT
|
||||||
.create(ExpressionService.class);
|
.create(ExpressionService.class);
|
||||||
|
|
||||||
void submitExpression(C_Expression expression,AsyncCallback<Void> callback);
|
void submitColumnFilter(ColumnData column, C_Expression expression,AsyncCallback<Void> callback);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,90 @@
|
||||||
|
package org.gcube.portlets.user.td.expressionwidget.server;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
|
import org.gcube.application.framework.core.session.ASLSession;
|
||||||
|
import org.gcube.data.analysis.tabulardata.commons.utils.AuthorizationProvider;
|
||||||
|
import org.gcube.data.analysis.tabulardata.commons.utils.AuthorizationToken;
|
||||||
|
import org.gcube.data.analysis.tabulardata.commons.webservice.types.operations.OperationDefinition;
|
||||||
|
import org.gcube.data.analysis.tabulardata.commons.webservice.types.operations.OperationExecution;
|
||||||
|
import org.gcube.data.analysis.tabulardata.service.TabularDataService;
|
||||||
|
import org.gcube.data.analysis.tabulardata.service.impl.TabularDataServiceFactory;
|
||||||
|
import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionService;
|
||||||
|
import org.gcube.portlets.user.td.expressionwidget.shared.expression.ExpressionServiceException;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.server.SessionUtil;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.server.trservice.OperationDefinitionMap;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.server.trservice.OperationsId;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expression;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
|
||||||
|
|
||||||
|
public class ExpressionServiceImpl extends RemoteServiceServlet implements
|
||||||
|
ExpressionService {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -5707400086333186368L;
|
||||||
|
protected static Logger logger = LoggerFactory
|
||||||
|
.getLogger(ExpressionServiceImpl.class);
|
||||||
|
|
||||||
|
protected static SimpleDateFormat sdf = new SimpleDateFormat(
|
||||||
|
"yyyy/MM/dd HH:mm");
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void submitColumnFilter(ColumnData column, C_Expression expression)
|
||||||
|
throws ExpressionServiceException {
|
||||||
|
|
||||||
|
try {
|
||||||
|
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||||
|
|
||||||
|
ASLSession aslSession = SessionUtil.getAslSession(session);
|
||||||
|
|
||||||
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
|
aslSession.getUsername()));
|
||||||
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
|
||||||
|
List<OperationDefinition> capabilities = service.getCapabilities();
|
||||||
|
|
||||||
|
OperationDefinition importSDMXCodelistOperation = OperationDefinitionMap.map(
|
||||||
|
OperationsId.FilterByExpression.toString(), capabilities);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Map<String, Object> parameterInstance=null;// = retrieveOperationParameters(sdmxImportSession);
|
||||||
|
|
||||||
|
OperationExecution invocation = new OperationExecution(
|
||||||
|
importSDMXCodelistOperation.getOperationId(),
|
||||||
|
parameterInstance);
|
||||||
|
|
||||||
|
|
||||||
|
logger.debug("OperationInvocation: \n" + invocation.toString());
|
||||||
|
//Task trTask = service.execute(invocation, serviceTR.getId());
|
||||||
|
//logger.debug("Start Task on service: TaskId " + trTask.getId());
|
||||||
|
//SessionUtil.setSDMXImportTask(session, trTask);
|
||||||
|
return;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new ExpressionServiceException("Error in Client Library Request: "
|
||||||
|
+ e.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
<!-- Specify the app entry point class. -->
|
<!-- Specify the app entry point class. -->
|
||||||
<!-- <entry-point class='org.gcube.portlets.user.td.expressionwidget.client.ExpressionWidgetEntry' /> -->
|
<entry-point class='org.gcube.portlets.user.td.expressionwidget.client.ExpressionWidgetEntry' />
|
||||||
|
|
||||||
<!-- Specify the paths for translatable code -->
|
<!-- Specify the paths for translatable code -->
|
||||||
<source path='client' />
|
<source path='client' />
|
||||||
|
|
Loading…
Reference in New Issue