Updated ReplaceByExpression

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@113770 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-03-27 13:31:40 +00:00
parent 1398df9b7e
commit b75b17686c
9 changed files with 59 additions and 24 deletions

View File

@ -1,5 +1,5 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
jarsExcludedFromWebInfLib= jarsExcludedFromWebInfLib=
lastWarOutDir=/home/giancarlo/workspace/tabular-data-expression-widget/target/tabular-data-expression-widget-1.3.0-SNAPSHOT lastWarOutDir=/home/giancarlo/workspace2/tabular-data-expression-widget/target
warSrcDir=src/main/webapp warSrcDir=src/main/webapp
warSrcDirIsOutput=false warSrcDirIsOutput=false

View File

@ -4,6 +4,15 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="tabular-data-gwt-service-2.6.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/tabular-data-gwt-service/tabular-data-gwt-service">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="tabular-data-widget-common-event-1.6.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/tabular-data-widget-common-event/tabular-data-widget-common-event">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="tabular-data-monitor-widget-1.2.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/tabular-data-monitor-widget/tabular-data-monitor-widget">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/tabular-data-expression-widget/target/tabular-data-expression-widget-1.0.0-SNAPSHOT/WEB-INF/classes"/> <property name="java-output-path" value="/tabular-data-expression-widget/target/tabular-data-expression-widget-1.0.0-SNAPSHOT/WEB-INF/classes"/>
<property name="context-root" value="tabular-data-expression-widget"/> <property name="context-root" value="tabular-data-expression-widget"/>
</wb-module> </wb-module>

View File

@ -1,6 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="com.google.gdt.eclipse.suite.webapp"> <launchConfiguration type="com.google.gdt.eclipse.suite.webapp">
<stringAttribute key="com.google.gdt.eclipse.suiteMainTypeProcessor.PREVIOUSLY_SET_MAIN_TYPE_NAME" value="com.google.gwt.dev.DevMode"/> <stringAttribute key="com.google.gdt.eclipse.suiteMainTypeProcessor.PREVIOUSLY_SET_MAIN_TYPE_NAME" value="com.google.gwt.dev.DevMode"/>
<booleanAttribute key="com.google.gdt.eclipse.suiteWarArgumentProcessor.IS_WAR_FROM_PROJECT_PROPERTIES" value="true"/>
<listAttribute key="com.google.gwt.eclipse.core.ENTRY_POINT_MODULES">
<listEntry value="org.gcube.portlets.user.td.expressionwidget.ExpressionWidget"/>
</listAttribute>
<stringAttribute key="com.google.gwt.eclipse.core.URL" value="ExpressionWidget.html"/> <stringAttribute key="com.google.gwt.eclipse.core.URL" value="ExpressionWidget.html"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/tabular-data-expression-widget"/> <listEntry value="/tabular-data-expression-widget"/>
@ -10,7 +14,7 @@
</listAttribute> </listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.google.gdt.eclipse.maven.mavenClasspathProvider"/> <stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.google.gdt.eclipse.maven.mavenClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/> <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-remoteUI &quot;${gwt_remote_ui_server_port}:${unique_id}&quot; -startupUrl ExpressionWidget.html -logLevel INFO -codeServerPort 9997 -port 8888"/> <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-war /home/giancarlo/workspace2/tabular-data-expression-widget/target -remoteUI &quot;${gwt_remote_ui_server_port}:${unique_id}&quot; -startupUrl ExpressionWidget.html -logLevel INFO -codeServerPort 9997 -port 8888 org.gcube.portlets.user.td.expressionwidget.ExpressionWidget"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="tabular-data-expression-widget"/> <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="tabular-data-expression-widget"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx512m -Dgwt.nowarn.legacy.tools"/> <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx512m -Dgwt.nowarn.legacy.tools"/>
</launchConfiguration> </launchConfiguration>

14
pom.xml
View File

@ -119,13 +119,11 @@
<version>[1.0.2-SNAPSHOT,2.0.0-SNAPSHOT)</version> <version>[1.0.2-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.gcube.portal</groupId> <groupId>org.gcube.portal</groupId>
<artifactId>custom-portal-handler</artifactId> <artifactId>custom-portal-handler</artifactId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.gcube.applicationsupportlayer</groupId> <groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslcore</artifactId> <artifactId>aslcore</artifactId>
@ -144,7 +142,7 @@
<groupId>org.gcube.data.analysis.tabulardata</groupId> <groupId>org.gcube.data.analysis.tabulardata</groupId>
<artifactId>service-client-impl</artifactId> <artifactId>service-client-impl</artifactId>
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version> <version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- tabular-data-gwt-service --> <!-- tabular-data-gwt-service -->
@ -152,7 +150,7 @@
<groupId>org.gcube.portlets.user</groupId> <groupId>org.gcube.portlets.user</groupId>
<artifactId>tabular-data-gwt-service</artifactId> <artifactId>tabular-data-gwt-service</artifactId>
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version> <version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- tabular-data-widget-common-event --> <!-- tabular-data-widget-common-event -->
@ -160,7 +158,7 @@
<groupId>org.gcube.portlets.user</groupId> <groupId>org.gcube.portlets.user</groupId>
<artifactId>tabular-data-widget-common-event</artifactId> <artifactId>tabular-data-widget-common-event</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version> <version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- tabular-data-monitor-widget --> <!-- tabular-data-monitor-widget -->
@ -168,7 +166,7 @@
<groupId>org.gcube.portlets.user</groupId> <groupId>org.gcube.portlets.user</groupId>
<artifactId>tabular-data-monitor-widget</artifactId> <artifactId>tabular-data-monitor-widget</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version> <version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
@ -185,6 +183,8 @@
<artifactId>slf4j-api</artifactId> <artifactId>slf4j-api</artifactId>
</dependency> </dependency>
<!-- JUNIT --> <!-- JUNIT -->
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
@ -193,7 +193,6 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
@ -338,6 +337,7 @@
</goals> </goals>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>

View File

@ -33,8 +33,10 @@ public class ExpressionWidgetEntry implements EntryPoint {
Log.debug("ExpressionWidgetEntry"); Log.debug("ExpressionWidgetEntry");
startInDevMode(); startInDevMode();
//TabularResource: [ id=86, type=STANDARD, lastTable=[ id=1159, type=Generic]]
EventBus eventBus= new SimpleEventBus(); EventBus eventBus= new SimpleEventBus();
TRId trId=new TRId("154",TabResourceType.STANDARD, "1969"); TRId trId=new TRId("86",TabResourceType.STANDARD, "1159");
//String columnName="zwqvvx"; //String columnName="zwqvvx";
//Column Expression Dialog //Column Expression Dialog
@ -58,12 +60,12 @@ public class ExpressionWidgetEntry implements EntryPoint {
//HelpReplaceColumnByExpressionDialog //HelpReplaceColumnByExpressionDialog
//HelpReplaceColumnByExpressionDialog help= new HelpReplaceColumnByExpressionDialog(eventBus); //HelpReplaceColumnByExpressionDialog help= new HelpReplaceColumnByExpressionDialog(eventBus);
//help.show(); //help.show();
//Replace Expression Dialog //Replace Expression Dialog
ColumnMockUp columnMockUp=new ColumnMockUp(null, null, "TestMock", ColumnTypeCode.ATTRIBUTE, ColumnDataType.Text,""); ColumnMockUp columnMockUp=new ColumnMockUp(null, null, "TestMock", ColumnTypeCode.ATTRIBUTE, ColumnDataType.Text,"");
ReplaceExpressionDialog replaceExpressionDialog=new ReplaceExpressionDialog(columnMockUp,trId,eventBus); ReplaceExpressionDialog replaceExpressionDialog=new ReplaceExpressionDialog(columnMockUp,trId,eventBus);
replaceExpressionDialog.show(); replaceExpressionDialog.show();
Log.info("Hello!"); Log.info("Hello!");

View File

@ -33,7 +33,7 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
public class ReplaceExpressionDialog extends Window implements public class ReplaceExpressionDialog extends Window implements
HasExpressionWrapperNotificationListener { HasExpressionWrapperNotificationListener {
private static final String WIDTH = "880px"; private static final String WIDTH = "880px";
private static final String HEIGHT = "490px"; private static final String HEIGHT = "360px";
private ArrayList<ExpressionWrapperNotificationListener> listeners; private ArrayList<ExpressionWrapperNotificationListener> listeners;
private ColumnData column; private ColumnData column;
private ArrayList<ColumnData> columns; private ArrayList<ColumnData> columns;
@ -59,6 +59,7 @@ public class ReplaceExpressionDialog extends Window implements
EventBus eventBus) { EventBus eventBus) {
listeners=new ArrayList<ExpressionWrapperNotificationListener>(); listeners=new ArrayList<ExpressionWrapperNotificationListener>();
this.eventBus = eventBus; this.eventBus = eventBus;
this.trId=trId;
this.column = column; this.column = column;
type = ReplaceExpressionType.Replace; type = ReplaceExpressionType.Replace;
initWindow(); initWindow();
@ -82,6 +83,7 @@ public class ReplaceExpressionDialog extends Window implements
EventBus eventBus) { EventBus eventBus) {
listeners=new ArrayList<ExpressionWrapperNotificationListener>(); listeners=new ArrayList<ExpressionWrapperNotificationListener>();
this.eventBus = eventBus; this.eventBus = eventBus;
this.trId=trId;
column = new ColumnData(); column = new ColumnData();
column.setColumnId(columnMockUp.getColumnId()); column.setColumnId(columnMockUp.getColumnId());
column.setLabel(columnMockUp.getLabel()); column.setLabel(columnMockUp.getLabel());

View File

@ -50,10 +50,10 @@ public class ReplaceExpressionPanel extends FramedPanel {
+ "|(\\s*LINESTRING\\s*\\((\\s*(-)?\\d+(\\.\\d+)?\\s+(-)?\\d+(\\.\\d+)?\\s*,)+\\s*((-)?\\d+(\\.\\d+)?\\s+(-)?\\d+(\\.\\d+)?\\s*)\\)\\s*$)"; + "|(\\s*LINESTRING\\s*\\((\\s*(-)?\\d+(\\.\\d+)?\\s+(-)?\\d+(\\.\\d+)?\\s*,)+\\s*((-)?\\d+(\\.\\d+)?\\s+(-)?\\d+(\\.\\d+)?\\s*)\\)\\s*$)";
private static final String WIDTH = "868px"; private static final String WIDTH = "868px";
private static final String HEIGHT = "454px"; private static final String HEIGHT = "324px";
private static final String HEIGHT_REDUCE = "368px"; private static final String HEIGHT_REDUCE = "238px";
private static final String PARENT_HEIGHT = "490px"; private static final String PARENT_HEIGHT = "360px";
private static final String PARENT_HEIGHT_REDUCE = "404px"; private static final String PARENT_HEIGHT_REDUCE = "274px";
private static final String REPLACEWIDTH = "832px"; private static final String REPLACEWIDTH = "832px";
private static final String REPLACEHEIGHT = "120px"; private static final String REPLACEHEIGHT = "120px";
@ -70,6 +70,7 @@ public class ReplaceExpressionPanel extends FramedPanel {
private TextButton btnApply; private TextButton btnApply;
private TextButton btnClose; private TextButton btnClose;
private TextField columnLabel;
private TextField columnType; private TextField columnType;
private TextField dataType; private TextField dataType;
@ -81,6 +82,8 @@ public class ReplaceExpressionPanel extends FramedPanel {
private ReplaceExpressionType type; private ReplaceExpressionType type;
public ReplaceExpressionPanel(ReplaceExpressionDialog parent, public ReplaceExpressionPanel(ReplaceExpressionDialog parent,
ColumnData column, ArrayList<ColumnData> columns, ColumnData column, ArrayList<ColumnData> columns,
ReplaceExpressionType type, EventBus eventBus) { ReplaceExpressionType type, EventBus eventBus) {
@ -143,6 +146,13 @@ public class ReplaceExpressionPanel extends FramedPanel {
VerticalLayoutContainer propertiesLayout = new VerticalLayoutContainer(); VerticalLayoutContainer propertiesLayout = new VerticalLayoutContainer();
properties.add(propertiesLayout); properties.add(propertiesLayout);
columnLabel = new TextField();
columnLabel.setToolTip("The label of column");
columnLabel.setReadOnly(true);
propertiesLayout.add(new FieldLabel(columnLabel, "Label"),
new VerticalLayoutData(1, -1));
columnType = new TextField(); columnType = new TextField();
columnType.setToolTip("The type of column"); columnType.setToolTip("The type of column");
columnType.setReadOnly(true); columnType.setReadOnly(true);
@ -276,6 +286,7 @@ public class ReplaceExpressionPanel extends FramedPanel {
case CODEDESCRIPTION: case CODEDESCRIPTION:
case CODENAME: case CODENAME:
case MEASURE: case MEASURE:
columnLabel.setValue(column.getLabel());
columnType.setValue(column.getTypeCode()); columnType.setValue(column.getTypeCode());
dataType.setValue(column.getDataTypeName()); dataType.setValue(column.getDataTypeName());
break; break;

View File

@ -29,6 +29,12 @@ import org.slf4j.LoggerFactory;
import com.google.gwt.user.server.rpc.RemoteServiceServlet; import com.google.gwt.user.server.rpc.RemoteServiceServlet;
/**
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ExpressionServiceImpl extends RemoteServiceServlet implements public class ExpressionServiceImpl extends RemoteServiceServlet implements
ExpressionService { ExpressionService {

View File

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<module rename-to='ExpressionWidget'> <module rename-to='ExpressionWidget'>
<inherits name='com.google.gwt.user.User' /> <inherits name='com.google.gwt.user.User' />
<inherits name="com.google.gwt.http.HTTP"/> <inherits name="com.google.gwt.http.HTTP" />
<!-- Other module inherits --> <!-- Other module inherits -->
<!-- <inherits name='com.extjs.gxt.ui.GXT' /> --> <!-- <inherits name='com.extjs.gxt.ui.GXT' /> -->
<inherits name='com.sencha.gxt.ui.GXT' /> <inherits name='com.sencha.gxt.ui.GXT' />
<inherits name='com.sencha.gxt.theme.blue.Blue' />
<inherits name="com.allen_sauer.gwt.log.gwt-log-TRACE" /> <inherits name="com.allen_sauer.gwt.log.gwt-log-TRACE" />
<!-- We need the JUnit module in the main module, --> <!-- We need the JUnit module in the main module, -->
<!-- otherwise eclipse complains (Google plugin bug?) --> <!-- otherwise eclipse complains (Google plugin bug?) -->
@ -22,21 +23,21 @@
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> --> <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Other module inherits --> <!-- Other module inherits -->
<inherits name='org.gcube.portlets.user.td.gwtservice.TDGWTService' /> <inherits name='org.gcube.portlets.user.td.gwtservice.TDGWTService' />
<inherits <inherits
name='org.gcube.portlets.user.td.widgetcommonevent.WidgetCommonEvent' /> name='org.gcube.portlets.user.td.widgetcommonevent.WidgetCommonEvent' />
<inherits name='org.gcube.portlets.user.td.monitorwidget.MonitorWidgetTD' /> <inherits name='org.gcube.portlets.user.td.monitorwidget.MonitorWidgetTD' />
<!-- Specify the app entry point class. --> <!-- Specify the app entry point class. -->
<!-- <entry-point <!-- <entry-point
class='org.gcube.portlets.user.td.expressionwidget.client.ExpressionWidgetEntry' /> --> 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' />
<source path='shared' /> <source path='shared' />
</module> </module>