Added Expression GWT Model

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@90198 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-01-17 17:58:22 +00:00
parent 9156171a38
commit c341184d25
35 changed files with 979 additions and 4 deletions

17
ExpressionWidget.launch Normal file
View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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"/>
<booleanAttribute key="com.google.gdt.eclipse.suiteWarArgumentProcessor.IS_WAR_FROM_PROJECT_PROPERTIES" value="true"/>
<stringAttribute key="com.google.gwt.eclipse.core.URL" value="ExpressionWidget.html"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/tabular-data-expression-widget"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<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.PROGRAM_ARGUMENTS" value="-remoteUI &quot;${gwt_remote_ui_server_port}:${unique_id}&quot; -startupUrl ExpressionWidget.html -logLevel INFO -codeServerPort 9997 -port 8888 -war /home/giancarlo/workspace/tabular-data-expression-widget/target/tabular-data-expression-widget-1.0.0-SNAPSHOT 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.VM_ARGUMENTS" value="-Xmx512m -Dgwt.nowarn.legacy.tools"/>
</launchConfiguration>

29
config/profile.xml Normal file
View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<Resource>
<ID></ID>
<Type>Service</Type>
<Profile>
<Description>tabular-data-expression-widget allows to create expression on column of table</Description>
<Class>PortletsUser</Class>
<Name>tabular-data-expression-widget</Name>
<Version>1.0.0</Version>
<Packages>
<Software>
<Description>tabular-data-expression-widget allows to create expression on column of table</Description>
<Name>tabular-data-expression-widget</Name>
<Version>1.0.0-SNAPSHOT</Version>
<MavenCoordinates>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>tabular-data-expression-widget</artifactId>
<version>1.0.0-SNAPSHOT</version>
</MavenCoordinates>
<Type>library</Type>
<Files>
<File>tabular-data-expression-widget-1.0.0-SNAPSHOT.war</File>
</Files>
</Software>
</Packages>
</Profile>
</Resource>

0
distro/INSTALL Normal file
View File

6
distro/LICENSE Normal file
View File

@ -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.

1
distro/MAINTAINERS Normal file
View File

@ -0,0 +1 @@
Giancarlo Panichi (giancarlo.panichi@isti.cnr.it), CNR Pisa, Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo"

40
distro/README Normal file
View File

@ -0,0 +1,40 @@
The gCube System - tabular-data-expression-widget
------------------------------------------------------------
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. 1.0.0-SNAPSHOT (2013-10-18)
Description
-----------
tabular-data-expression-widget allows to create expression on column of table
Download information
--------------------
Source code URL: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget
Documentation
-------------
tabular-data-expression-widget allows to create expression on column of table
Licensing
---------
This software is licensed under the terms you may find in the file named "LICENSE" in this directory.

6
distro/changelog.xml Normal file
View File

@ -0,0 +1,6 @@
<ReleaseNotes>
<Changeset component="org.gcube.portlets.user.tabular-data-expression-widget.1-0-0"
date="2013-12-18">
<Change>First Release</Change>
</Changeset>
</ReleaseNotes>

1
distro/svnpath.txt Normal file
View File

@ -0,0 +1 @@
https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget

View File

@ -30,8 +30,9 @@ public class ColumnExpressionPanel extends FramedPanel {
* @param columnTypeCode
* @param dataTypeName
*/
public ColumnExpressionPanel(String columnTypeCode, String dataTypeName) {
public ColumnExpressionPanel(String columnId, String columnTypeCode, String dataTypeName) {
column=new ColumnData();
column.setColumnId(columnId);
column.setDataTypeName(dataTypeName);
column.setTypeCode(columnTypeCode);
create();
@ -59,9 +60,12 @@ public class ColumnExpressionPanel extends FramedPanel {
basicLayout.setScrollMode(ScrollMode.AUTO);
basicLayout.setAdjustForScroll(true);
TextField tf= new TextField();
basicLayout.add(new FieldLabel(tf, "Prova"), new VerticalLayoutData(1, -1));
ConditionWidget conditionWidget =new ConditionWidget(column.getColumnId(), column.getTypeCode(), column.getDataTypeName());
basicLayout.add(conditionWidget);
add(basicLayout);

View File

@ -0,0 +1,94 @@
package org.gcube.portlets.user.td.expressionwidget.client;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.logical.shared.SelectionEvent;
import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
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.LabelProvider;
import com.sencha.gxt.data.shared.ListStore;
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.form.ComboBox;
import com.sencha.gxt.widget.core.client.info.Info;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
import org.gcube.data.analysis.tabulardata.expression.Operator;
import org.gcube.portlets.user.td.expressionwidget.client.operation.Operation;
import org.gcube.portlets.user.td.expressionwidget.client.operation.OperationProperties;
import org.gcube.portlets.user.td.expressionwidget.client.operation.OperationsStore;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ConditionWidget extends SimpleContainer {
protected Operator op;
protected ComboBox<Operation> comboOp=null;
ConditionWidget(String columnPlaceHolderId,String columnTypeCode, String dataTypeName){
VerticalLayoutContainer v=new VerticalLayoutContainer();
v.setScrollMode(ScrollMode.AUTO);
v.setAdjustForScroll(true);
OperationProperties props = GWT.create(OperationProperties.class);
ListStore<Operation> storeOp = new ListStore<Operation>(props.name());
storeOp.addAll(OperationsStore.getAll(dataTypeName));
Log.trace("Store created");
comboOp = new ComboBox<Operation>(storeOp,
props.label());
Log.trace("ComboOperation created");
addHandlersForEventObservation(comboOp, props.label());
comboOp.setEmptyText("Select a operation...");
comboOp.setWidth(150);
comboOp.setTypeAhead(true);
comboOp.setTriggerAction(TriggerAction.ALL);
v.add(comboOp,new VerticalLayoutData(-1, -1, new Margins(0)));
add(v);
}
private <T> void addHandlersForEventObservation(ComboBox<T> combo,
final LabelProvider<T> labelProvider) {
combo.addValueChangeHandler(new ValueChangeHandler<T>() {
public void onValueChange(ValueChangeEvent<T> event) {
Info.display(
"Value Changed",
"New value: "
+ (event.getValue() == null ? "nothing"
: labelProvider.getLabel(event
.getValue()) + "!"));
}
});
combo.addSelectionHandler(new SelectionHandler<T>() {
public void onSelection(SelectionEvent<T> event) {
Info.display(
"State Selected",
"You selected "
+ (event.getSelectedItem() == null ? "nothing"
: labelProvider.getLabel(event
.getSelectedItem()) + "!"));
}
});
}
}

View File

@ -15,9 +15,10 @@ public class ExpressionWidgetEntry implements EntryPoint {
//For example Tabular Resource 1 and table 1
trId.setId("1");
trId.setTableId("1");
/*RemoveColumnDialog dialog=new RemoveColumnDialog(trId);
dialog.show();
ChangeLabelColumnDialog changeLabel=new ChangeLabelColumnDialog(trId);
ColumnExpressionPanel expressionPanel=new ColumnExpressionPanel("0", "Attribute", "Integer");
expressionPanel.show();
/*ChangeLabelColumnDialog changeLabel=new ChangeLabelColumnDialog(trId);
changeLabel.show();
ChangeToAnnotationColumnDialog changeToAnnotation=new ChangeToAnnotationColumnDialog(trId);
changeToAnnotation.show();*/

View File

@ -0,0 +1,58 @@
package org.gcube.portlets.user.td.expressionwidget.client.operation;
import org.gcube.portlets.user.td.expressionwidget.share.model.OperatorType;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class Operation {
String name;
OperatorType operatorType;
String label;
public Operation(String name, String label, OperatorType operatorType){
this.name=name;
this.label=label;
this.operatorType=operatorType;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public OperatorType getOperatorType() {
return operatorType;
}
public void setOperatorType(OperatorType operatorType) {
this.operatorType = operatorType;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
@Override
public String toString() {
return "Operation [name=" + name + ", operatorType=" + operatorType
+ ", label=" + label + "]";
}
}

View File

@ -0,0 +1,21 @@
package org.gcube.portlets.user.td.expressionwidget.client.operation;
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"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface OperationProperties extends PropertyAccess<Operation> {
@Path("name")
ModelKeyProvider<Operation> name();
LabelProvider<Operation> label();
}

View File

@ -0,0 +1,86 @@
package org.gcube.portlets.user.td.expressionwidget.client.operation;
import java.util.ArrayList;
import org.gcube.portlets.user.td.expressionwidget.share.model.OperatorType;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class OperationsStore {
static ArrayList<Operation> operations;
static ArrayList<Operation> operationsNumeric = new ArrayList<Operation>() {
private static final long serialVersionUID = -6559885743626876431L;
{
add(new Operation("EQUALS","Equals",OperatorType.EQUALS));
add(new Operation("GREATER","Greater",OperatorType.GREATER));
add(new Operation("GREATER_OR_EQUALS","Greater or equals",OperatorType.GREATER_OR_EQUALS));
add(new Operation("LESSER","Lesser",OperatorType.LESSER));
add(new Operation("LESSER_OR_EQUALS","Lesser or equals",OperatorType.LESSER_OR_EQUALS));
add(new Operation("NOT_EQUALS","Not equals",OperatorType.NOT_EQUALS));
add(new Operation("NOT_GREATER","Not greater",OperatorType.NOT_GREATER));
add(new Operation("NOT_LESSER","Not lesser",OperatorType.NOT_LESSER));
add(new Operation("IS_NULL","Is null",OperatorType.IS_NULL));
add(new Operation("IS_NOT_NULL","Is not null",OperatorType.IS_NOT_NULL));
add(new Operation("BETWEEN","Between",OperatorType.BETWEEN));
add(new Operation("IN","In",OperatorType.IN));
}};
static ArrayList<Operation> operationsText = new ArrayList<Operation>() {
private static final long serialVersionUID = -6559885743626876431L;
{
add(new Operation("BEGIN_WITH","Begin with",OperatorType.BEGINS_WITH));
add(new Operation("CONTAINS","Contains",OperatorType.CONTAINS));
add(new Operation("ENDS_WITH","End with",OperatorType.ENDS_WITH));
add(new Operation("MATCH","Match",OperatorType.MATCH_REGEX));
add(new Operation("NOT_BEGIN_WITH","Not begin with",OperatorType.BEGINS_WITH));
add(new Operation("NOT_CONTAINS","Not contains",OperatorType.CONTAINS));
add(new Operation("NOT_ENDS_WITH","Not end with",OperatorType.ENDS_WITH));
add(new Operation("NOT_MATCH","Not match",OperatorType.MATCH_REGEX));
add(new Operation("IS_NULL","Is null",OperatorType.IS_NULL));
add(new Operation("IS_NOT_NULL","Is not null",OperatorType.IS_NOT_NULL));
add(new Operation("BETWEEN","Between",OperatorType.BETWEEN));
add(new Operation("IN","In",OperatorType.IN));
}};
public static ArrayList<Operation> getAll(String dataTypeName){
if(dataTypeName.compareTo("Boolean")==0){
operations=operationsNumeric;
} else {
if(dataTypeName.compareTo("Date")==0){
operations=operationsNumeric;
} else {
if(dataTypeName.compareTo("Integer")==0){
operations=operationsNumeric;
} else {
if(dataTypeName.compareTo("Geometry")==0){
operations=operationsNumeric;
} else {
if(dataTypeName.compareTo("Numeric")==0){
operations=operationsNumeric;
} else {
if(dataTypeName.compareTo("Text")==0){
operations=operationsText;
} else {
operations=operationsText;
}
}
}
}
}
}
return operations;
}
}

View File

@ -0,0 +1,12 @@
package org.gcube.portlets.user.td.expressionwidget.share.model;
import java.io.Serializable;
public class Expression implements Serializable{
private static final long serialVersionUID = 7818512507606450235L;
}

View File

@ -0,0 +1,29 @@
package org.gcube.portlets.user.td.expressionwidget.share.model;
public enum OperatorType {
// Arithmetic
ADDITION, SUBTRACTION, MULTIPLICATION, DIVISION, MODULUS,
// COMPARISON
EQUALS, GREATER, LESSER,
GREATER_OR_EQUALS, LESSER_OR_EQUALS,
NOT_EQUALS, NOT_GREATER, NOT_LESSER,
// LOGICAL
ALL, AND, ANY, BETWEEN, EXISTS, IN, LIKE, NOT, OR, IS_NULL, UNIQUE, IS_NOT_NULL,
// STRING
BEGINS_WITH, ENDS_WITH, CONTAINS, MATCH_REGEX,
NO_BEGINS_WITH, NO_ENDS_WITH, NO_CONTAINS, NO_MATCH_REGEX,
// COMPLEX
SELECT_IN
}

View File

@ -0,0 +1,30 @@
package org.gcube.portlets.user.td.expressionwidget.share.model.composite.comparable;
import org.gcube.portlets.user.td.expressionwidget.share.model.Expression;
import org.gcube.portlets.user.td.expressionwidget.share.model.OperatorType;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class Equals extends Expression {
private static final long serialVersionUID = 3154667914317692836L;
Expression leftArgument;
Expression rightArgument;
public Equals(Expression leftArgument, Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
}
public OperatorType getOperator() {
return OperatorType.EQUALS;
}
public String getReturnedDataType() {
return "Boolean";
}
}

View File

@ -0,0 +1,30 @@
package org.gcube.portlets.user.td.expressionwidget.share.model.composite.comparable;
import org.gcube.portlets.user.td.expressionwidget.share.model.Expression;
import org.gcube.portlets.user.td.expressionwidget.share.model.OperatorType;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class GreaterOrEquals extends Expression {
private static final long serialVersionUID = -5441076239992740424L;
protected Expression leftArgument;
protected Expression rightArgument;
public GreaterOrEquals(Expression leftArgument, Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
}
public OperatorType getOperator() {
return OperatorType.GREATER_OR_EQUALS;
}
public String getReturnedDataType() {
return "Boolean";
}
}

View File

@ -0,0 +1,30 @@
package org.gcube.portlets.user.td.expressionwidget.share.model.composite.comparable;
import org.gcube.portlets.user.td.expressionwidget.share.model.Expression;
import org.gcube.portlets.user.td.expressionwidget.share.model.OperatorType;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class GreaterThan extends Expression {
private static final long serialVersionUID = -8878360512708863164L;
protected Expression leftArgument;
protected Expression rightArgument;
public GreaterThan(Expression leftArgument, Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
}
public OperatorType getOperator() {
return OperatorType.GREATER;
}
public String getReturnedDataType() {
return "Boolean";
}
}

View File

@ -0,0 +1,29 @@
package org.gcube.portlets.user.td.expressionwidget.share.model.composite.comparable;
import org.gcube.portlets.user.td.expressionwidget.share.model.Expression;
import org.gcube.portlets.user.td.expressionwidget.share.model.OperatorType;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class LessOrEquals extends Expression {
private static final long serialVersionUID = 7693397481316523615L;
Expression leftArgument;
Expression rightArgument;
public LessOrEquals(Expression leftArgument, Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
}
public OperatorType getOperator() {
return OperatorType.LESSER_OR_EQUALS;
}
public String getReturnedDataType() {
return "Boolean";
}
}

View File

@ -0,0 +1,30 @@
package org.gcube.portlets.user.td.expressionwidget.share.model.composite.comparable;
import org.gcube.portlets.user.td.expressionwidget.share.model.Expression;
import org.gcube.portlets.user.td.expressionwidget.share.model.OperatorType;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class LessThan extends Expression {
private static final long serialVersionUID = 6420164520127827750L;
Expression leftArgument;
Expression rightArgument;
public LessThan(Expression leftArgument, Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
}
public OperatorType getOperator() {
return OperatorType.LESSER;
}
public String getReturnedDataType() {
return "Boolean";
}
}

View File

@ -0,0 +1,29 @@
package org.gcube.portlets.user.td.expressionwidget.share.model.composite.comparable;
import org.gcube.portlets.user.td.expressionwidget.share.model.Expression;
import org.gcube.portlets.user.td.expressionwidget.share.model.OperatorType;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class NotEquals extends Expression {
private static final long serialVersionUID = 7587723477959909679L;
Expression leftArgument;
Expression rightArgument;
public NotEquals(Expression leftArgument, Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
}
public OperatorType getOperator() {
return OperatorType.NOT_EQUALS;
}
public String getReturnedDataType() {
return "Boolean";
}
}

View File

@ -0,0 +1,29 @@
package org.gcube.portlets.user.td.expressionwidget.share.model.composite.comparable;
import org.gcube.portlets.user.td.expressionwidget.share.model.Expression;
import org.gcube.portlets.user.td.expressionwidget.share.model.OperatorType;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class NotGreater extends Expression {
private static final long serialVersionUID = 6783019184437499833L;
Expression leftArgument;
Expression rightArgument;
public NotGreater(Expression leftArgument, Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
}
public OperatorType getOperator() {
return OperatorType.NOT_GREATER;
}
public String getReturnedDataType() {
return "Boolean";
}
}

View File

@ -0,0 +1,29 @@
package org.gcube.portlets.user.td.expressionwidget.share.model.composite.comparable;
import org.gcube.portlets.user.td.expressionwidget.share.model.Expression;
import org.gcube.portlets.user.td.expressionwidget.share.model.OperatorType;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class NotLess extends Expression {
private static final long serialVersionUID = 4497500830326659077L;
Expression leftArgument;
Expression rightArgument;
public NotLess(Expression leftArgument, Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
}
public OperatorType getOperator() {
return OperatorType.NOT_LESSER;
}
public String getReturnedDataType() {
return "Boolean";
}
}

View File

@ -0,0 +1,30 @@
package org.gcube.portlets.user.td.expressionwidget.share.model.composite.text;
import org.gcube.portlets.user.td.expressionwidget.share.model.Expression;
import org.gcube.portlets.user.td.expressionwidget.share.model.OperatorType;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class TextBeginsWith extends Expression {
private static final long serialVersionUID = 222662008523199480L;
protected Expression leftArgument;
protected Expression rightArgument;
public TextBeginsWith(Expression leftArgument, Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
}
public OperatorType getOperator() {
return OperatorType.BEGINS_WITH;
}
public String getReturnedDataType() {
return "Boolean";
}
}

View File

@ -0,0 +1,29 @@
package org.gcube.portlets.user.td.expressionwidget.share.model.composite.text;
import org.gcube.portlets.user.td.expressionwidget.share.model.Expression;
import org.gcube.portlets.user.td.expressionwidget.share.model.OperatorType;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class TextContains extends Expression {
private static final long serialVersionUID = 7951499429397693592L;
protected Expression leftArgument;
protected Expression rightArgument;
public TextContains(Expression leftArgument, Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
}
public OperatorType getOperator() {
return OperatorType.CONTAINS;
}
public String getReturnedDataType() {
return "Boolean";
}
}

View File

@ -0,0 +1,30 @@
package org.gcube.portlets.user.td.expressionwidget.share.model.composite.text;
import org.gcube.portlets.user.td.expressionwidget.share.model.Expression;
import org.gcube.portlets.user.td.expressionwidget.share.model.OperatorType;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class TextEndsWith extends Expression {
private static final long serialVersionUID = -5149428840566398839L;
protected Expression leftArgument;
protected Expression rightArgument;
public TextEndsWith(Expression leftArgument, Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
}
public OperatorType getOperator() {
return OperatorType.ENDS_WITH;
}
public String getReturnedDataType() {
return "Boolean";
}
}

View File

@ -0,0 +1,31 @@
package org.gcube.portlets.user.td.expressionwidget.share.model.composite.text;
import org.gcube.portlets.user.td.expressionwidget.share.model.Expression;
import org.gcube.portlets.user.td.expressionwidget.share.model.OperatorType;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class TextMatchSQLRegexp extends Expression {
private static final long serialVersionUID = -4097780009381262681L;
protected Expression leftArgument;
protected Expression rightArgument;
public TextMatchSQLRegexp(Expression leftArgument, Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
}
public OperatorType getOperator() {
return OperatorType.MATCH_REGEX;
}
public String getReturnedDataType() {
return "Boolean";
}
}

View File

@ -0,0 +1,35 @@
package org.gcube.portlets.user.td.expressionwidget.share.model.logical;
import java.util.Arrays;
import java.util.List;
import org.gcube.portlets.user.td.expressionwidget.share.model.Expression;
import org.gcube.portlets.user.td.expressionwidget.share.model.OperatorType;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class And extends Expression {
private static final long serialVersionUID = -4462616033767138280L;
protected List<Expression> arguments;
public And(Expression... arguments) {
this.arguments = Arrays.asList(arguments);
}
public And(List<Expression> arguments) {
this.arguments = arguments;
}
public OperatorType getOperator() {
return OperatorType.AND;
}
public String getReturnedDataType() {
return "Boolean";
}
}

View File

@ -0,0 +1,31 @@
package org.gcube.portlets.user.td.expressionwidget.share.model.logical;
import org.gcube.portlets.user.td.expressionwidget.share.model.Expression;
import org.gcube.portlets.user.td.expressionwidget.share.model.OperatorType;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class Between extends Expression {
private static final long serialVersionUID = 5367101215792568854L;
protected Expression leftArgument;
protected Expression rightArgument;
public Between(Expression leftArgument, Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
}
public OperatorType getOperator() {
return OperatorType.BETWEEN;
}
public String getReturnedDataType() {
return "Boolean";
}
}

View File

@ -0,0 +1,29 @@
package org.gcube.portlets.user.td.expressionwidget.share.model.logical;
import org.gcube.portlets.user.td.expressionwidget.share.model.Expression;
import org.gcube.portlets.user.td.expressionwidget.share.model.OperatorType;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class IsNotNull extends Expression {
private static final long serialVersionUID = 8930488371061116376L;
protected Expression argument;
public IsNotNull(Expression argument) {
this.argument=argument;
}
public OperatorType getOperator() {
return OperatorType.IS_NOT_NULL;
}
public String getReturnedDataType() {
return "Boolean";
}
}

View File

@ -0,0 +1,28 @@
package org.gcube.portlets.user.td.expressionwidget.share.model.logical;
import org.gcube.portlets.user.td.expressionwidget.share.model.Expression;
import org.gcube.portlets.user.td.expressionwidget.share.model.OperatorType;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class IsNull extends Expression {
private static final long serialVersionUID = -7845762664802353175L;
protected Expression argument;
public IsNull(Expression argument) {
this.argument=argument;
}
public OperatorType getOperator() {
return OperatorType.IS_NULL;
}
public String getReturnedDataType() {
return "Boolean";
}
}

View File

@ -0,0 +1,27 @@
package org.gcube.portlets.user.td.expressionwidget.share.model.logical;
import org.gcube.portlets.user.td.expressionwidget.share.model.Expression;
import org.gcube.portlets.user.td.expressionwidget.share.model.OperatorType;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class Not extends Expression {
private static final long serialVersionUID = 9206533042761278382L;
protected Expression argument;
public Not(Expression argument) {
this.argument = argument;
}
public OperatorType getOperator() {
return OperatorType.NOT;
}
public String getReturnedDataType() {
return "Boolean";
}
}

View File

@ -0,0 +1,35 @@
package org.gcube.portlets.user.td.expressionwidget.share.model.logical;
import java.util.Arrays;
import java.util.List;
import org.gcube.portlets.user.td.expressionwidget.share.model.Expression;
import org.gcube.portlets.user.td.expressionwidget.share.model.OperatorType;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class Or extends Expression {
private static final long serialVersionUID = 1855717717443945397L;
protected List<Expression> arguments;
public Or(Expression... arguments) {
this.arguments = Arrays.asList(arguments);
}
public Or(List<Expression> arguments) {
this.arguments = arguments;
}
public OperatorType getOperator() {
return OperatorType.OR;
}
public String getReturnedDataType() {
return "Boolean";
}
}

View File

@ -0,0 +1,29 @@
package org.gcube.portlets.user.td.expressionwidget.share.model.logical;
import org.gcube.portlets.user.td.expressionwidget.share.model.Expression;
import org.gcube.portlets.user.td.expressionwidget.share.model.OperatorType;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ValueIsIn extends Expression {
private static final long serialVersionUID = 739569588958197726L;
protected Expression leftArgument;
protected Expression rightArgument;
public ValueIsIn(Expression leftArgument, Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
}
public OperatorType getOperator() {
return OperatorType.IN;
}
public String getReturnedDataType() {
return "Boolean";
}
}