Fixed TimeZone
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@115604 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
2fff4d09bb
commit
07dd4732f5
|
@ -29,7 +29,6 @@ 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.i18n.client.DateTimeFormat;
|
||||
import com.google.gwt.user.client.ui.HTML;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign;
|
||||
|
@ -66,7 +65,6 @@ public class ColumnExpressionPanel extends FramedPanel {
|
|||
private static final String WIDTH = "658px";
|
||||
private static final String HEIGHT = "364px";
|
||||
private static final String RULE_HEIGHT = "388px";
|
||||
private DateTimeFormat sdf = DateTimeFormat.getFormat("yyyy-MM-dd HH:mm");
|
||||
|
||||
private enum ColumnExpressionPanelType {
|
||||
ColumnFilter, RowDeleteByExpression, Template, RuleOnColumn;
|
||||
|
@ -443,7 +441,7 @@ public class ColumnExpressionPanel extends FramedPanel {
|
|||
columnMockUp.getColumnDataType());
|
||||
|
||||
RuleDescriptionData ruleDescriptionData = new RuleDescriptionData(
|
||||
0, ruleNameS, ruleDescriptionS, sdf.format(new Date()),
|
||||
0, ruleNameS, ruleDescriptionS, new Date(),
|
||||
null, null, RuleScopeType.COLUMN, exp, tdBaseColumnRule);
|
||||
return ruleDescriptionData;
|
||||
} else {
|
||||
|
|
|
@ -24,7 +24,6 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeC
|
|||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.event.logical.shared.SelectionEvent;
|
||||
import com.google.gwt.event.logical.shared.SelectionHandler;
|
||||
import com.google.gwt.i18n.client.DateTimeFormat;
|
||||
import com.google.gwt.user.client.ui.HTML;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign;
|
||||
|
@ -60,15 +59,13 @@ public class MultiColumnExpressionPanel extends FramedPanel {
|
|||
private static final String RULE_CONDITION_FIELD_WIDTH = "914px";
|
||||
|
||||
private static final String ROWS_DELETE_HEIGHT = "388px";
|
||||
private static final String RULE_HEIGHT= "312px";
|
||||
private static final String RULE_HEIGHT = "312px";
|
||||
|
||||
private static final String RULE_MULTI_CONDITION_WIDTH = "890px";
|
||||
private static final String RULE_MULTI_CONDITION_HEIGHT = "228px";
|
||||
|
||||
|
||||
private static final String RULE_DESCRIPTION_HEIGHT = "44px";
|
||||
|
||||
private DateTimeFormat sdf = DateTimeFormat.getFormat("yyyy-MM-dd HH:mm");
|
||||
|
||||
private enum MultiColumnExpressionPanelType {
|
||||
ColumnFilter, RowDeleteByExpression, Template, RuleOnTable;
|
||||
|
@ -169,9 +166,6 @@ public class MultiColumnExpressionPanel extends FramedPanel {
|
|||
retrieveColumns();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
protected void retrieveColumns() throws MultiColumnExpressionPanelException {
|
||||
if (initialRuleDescriptionData == null) {
|
||||
Log.error("No rules description data present!");
|
||||
|
@ -217,7 +211,6 @@ public class MultiColumnExpressionPanel extends FramedPanel {
|
|||
setBodyBorder(false);
|
||||
setHeaderVisible(false);
|
||||
|
||||
|
||||
FieldSet propertiesField = new FieldSet();
|
||||
propertiesField.setHeadingText("Properties");
|
||||
propertiesField.setCollapsible(false);
|
||||
|
@ -231,7 +224,8 @@ public class MultiColumnExpressionPanel extends FramedPanel {
|
|||
conditionsField.setCollapsible(false);
|
||||
conditionsField.setWidth(RULE_CONDITION_FIELD_WIDTH);
|
||||
|
||||
conditionWidget = new ConditionOnMultiColumnWidget(columns,RULE_MULTI_CONDITION_WIDTH,RULE_MULTI_CONDITION_HEIGHT);
|
||||
conditionWidget = new ConditionOnMultiColumnWidget(columns,
|
||||
RULE_MULTI_CONDITION_WIDTH, RULE_MULTI_CONDITION_HEIGHT);
|
||||
conditionsField.add(conditionWidget);
|
||||
|
||||
HBoxLayoutContainer flowButton = new HBoxLayoutContainer();
|
||||
|
@ -270,7 +264,7 @@ public class MultiColumnExpressionPanel extends FramedPanel {
|
|||
.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||
|
||||
VerticalLayoutContainer basicLayout = new VerticalLayoutContainer();
|
||||
//basicLayout.setAdjustForScroll(true);
|
||||
// basicLayout.setAdjustForScroll(true);
|
||||
|
||||
basicLayout.add(propertiesField, new VerticalLayoutData(1, -1,
|
||||
new Margins(1)));
|
||||
|
@ -294,7 +288,7 @@ public class MultiColumnExpressionPanel extends FramedPanel {
|
|||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Log.debug("Error in createOnRule(): "+e.getLocalizedMessage());
|
||||
Log.debug("Error in createOnRule(): " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -335,9 +329,8 @@ public class MultiColumnExpressionPanel extends FramedPanel {
|
|||
String ruleNameS = ruleName.getCurrentValue();
|
||||
String ruleDescriptionS = ruleDescription.getCurrentValue();
|
||||
RuleDescriptionData ruleDescriptionData = new RuleDescriptionData(
|
||||
0, ruleNameS, ruleDescriptionS,
|
||||
sdf.format(new Date()), null, null,
|
||||
RuleScopeType.TABLE, exp,
|
||||
0, ruleNameS, ruleDescriptionS, new Date(), null,
|
||||
null, RuleScopeType.TABLE, exp,
|
||||
initialRuleDescriptionData.getTdRuleType());
|
||||
return ruleDescriptionData;
|
||||
} else {
|
||||
|
@ -362,7 +355,6 @@ public class MultiColumnExpressionPanel extends FramedPanel {
|
|||
setBodyBorder(false);
|
||||
setHeaderVisible(false);
|
||||
|
||||
|
||||
HBoxLayoutContainer flowButton = new HBoxLayoutContainer();
|
||||
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
||||
flowButton.setPack(BoxLayoutPack.CENTER);
|
||||
|
@ -405,9 +397,8 @@ public class MultiColumnExpressionPanel extends FramedPanel {
|
|||
|
||||
flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||
|
||||
|
||||
VerticalLayoutContainer basicLayout = new VerticalLayoutContainer();
|
||||
//basicLayout.setAdjustForScroll(true);
|
||||
// basicLayout.setAdjustForScroll(true);
|
||||
// basicLayout.setScrollMode(ScrollMode.AUTO); Set In GXT 3.0.1
|
||||
|
||||
basicLayout.add(conditionsField, new VerticalLayoutData(-1, -1,
|
||||
|
@ -424,7 +415,6 @@ public class MultiColumnExpressionPanel extends FramedPanel {
|
|||
setBodyBorder(false);
|
||||
setHeaderVisible(false);
|
||||
|
||||
|
||||
HBoxLayoutContainer flowButton = new HBoxLayoutContainer();
|
||||
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
||||
flowButton.setPack(BoxLayoutPack.CENTER);
|
||||
|
@ -464,9 +454,8 @@ public class MultiColumnExpressionPanel extends FramedPanel {
|
|||
flowButton.add(btnApply, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||
flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||
|
||||
|
||||
VerticalLayoutContainer basicLayout = new VerticalLayoutContainer();
|
||||
//basicLayout.setAdjustForScroll(true);
|
||||
// basicLayout.setAdjustForScroll(true);
|
||||
basicLayout.add(conditionsField, new VerticalLayoutData(-1, -1,
|
||||
new Margins(0)));
|
||||
basicLayout.add(flowButton, new VerticalLayoutData(1, 36, new Margins(
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
package org.gcube.portlets.user.td.expressionwidget.client.properties;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
|
||||
|
||||
import com.google.gwt.editor.client.Editor.Path;
|
||||
import com.sencha.gxt.data.shared.LabelProvider;
|
||||
import com.sencha.gxt.core.client.ValueProvider;
|
||||
import com.sencha.gxt.data.shared.ModelKeyProvider;
|
||||
import com.sencha.gxt.data.shared.PropertyAccess;
|
||||
|
||||
|
@ -13,13 +15,16 @@ import com.sencha.gxt.data.shared.PropertyAccess;
|
|||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public interface TabResourceProperties extends
|
||||
PropertyAccess<TabResource> {
|
||||
public interface TabResourceProperties extends PropertyAccess<TabResource> {
|
||||
|
||||
@Path("id")
|
||||
ModelKeyProvider<TabResource> id();
|
||||
|
||||
@Path("name")
|
||||
LabelProvider<TabResource> label();
|
||||
ValueProvider<TabResource, String> name();
|
||||
ValueProvider<TabResource, String> tabResourceType();
|
||||
ValueProvider<TabResource, String> agency();
|
||||
ValueProvider<TabResource, Date> date();
|
||||
ValueProvider<TabResource, String> tableTypeName();
|
||||
ValueProvider<TabResource, String> ownerLogin();
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package org.gcube.portlets.user.td.expressionwidget.client.properties;
|
||||
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
|
||||
|
||||
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 TabResourcePropertiesCombo extends
|
||||
PropertyAccess<TabResource> {
|
||||
|
||||
@Path("id")
|
||||
ModelKeyProvider<TabResource> id();
|
||||
|
||||
@Path("name")
|
||||
LabelProvider<TabResource> label();
|
||||
|
||||
}
|
|
@ -1,7 +1,5 @@
|
|||
package org.gcube.portlets.user.td.expressionwidget.server.service.rule;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
|
@ -30,9 +28,6 @@ public class RuleDescriptionMap {
|
|||
private static final Logger logger = LoggerFactory
|
||||
.getLogger(RuleDescriptionMap.class);
|
||||
|
||||
private static SimpleDateFormat sdf = new SimpleDateFormat(
|
||||
"yyyy-MM-dd HH:mm");
|
||||
|
||||
private static final String SECURITY_EXCEPTION_RIGHTS = "Security exception, you don't have the required rights!";
|
||||
|
||||
public static RuleDescriptionData map(RuleDescription ruleDescription)
|
||||
|
@ -49,7 +44,6 @@ public class RuleDescriptionMap {
|
|||
throw new TDGWTServiceException("Rule description has scope null");
|
||||
}
|
||||
|
||||
|
||||
ruleDescriptionData = createRuleDescriptionData(ruleDescription);
|
||||
|
||||
return ruleDescriptionData;
|
||||
|
@ -72,12 +66,12 @@ public class RuleDescriptionMap {
|
|||
Contacts owner = new Contacts("", ruleDescription.getOwner(), false);
|
||||
ArrayList<Contacts> contacts = retrieveRuleShareInfo(ruleDescription);
|
||||
|
||||
String creationDate="";
|
||||
try{
|
||||
creationDate = sdf.format(ruleDescription.getCreationDate().getTime());
|
||||
} catch(IllegalArgumentException e){
|
||||
logger.error("Error in rule description, creation date is not valid!"+
|
||||
ruleDescription.getCreationDate());
|
||||
Date creationDate = null;
|
||||
try {
|
||||
creationDate = ruleDescription.getCreationDate().getTime();
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in rule description, creation date is not valid!"
|
||||
+ ruleDescription.getCreationDate());
|
||||
throw new TDGWTServiceException(
|
||||
"Error in rule description, creation date is not valid!");
|
||||
}
|
||||
|
@ -170,19 +164,8 @@ public class RuleDescriptionMap {
|
|||
"Error saving rule, rule column type is null!");
|
||||
}
|
||||
|
||||
Date cDate;
|
||||
try {
|
||||
cDate = sdf.parse(ruleDescriptionData.getCreationDate());
|
||||
} catch (ParseException e) {
|
||||
logger.error("Error saving rule, creation date is not valid: "
|
||||
+ ruleDescriptionData.getCreationDate());
|
||||
throw new TDGWTServiceException(
|
||||
"Error saving rule, creation date is not valid: "
|
||||
+ ruleDescriptionData.getCreationDate());
|
||||
}
|
||||
|
||||
GregorianCalendar creationDate = new GregorianCalendar();
|
||||
creationDate.setTime(cDate);
|
||||
creationDate.setTime(ruleDescriptionData.getCreationDate());
|
||||
|
||||
RuleDescription ruleDescription = new RuleDescription(
|
||||
ruleDescriptionData.getId(), ruleDescriptionData.getName(),
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.gcube.portlets.user.td.expressionwidget.shared.rule;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.rule.description.RuleDescriptionData;
|
||||
|
||||
import com.google.gwt.editor.client.Editor.Path;
|
||||
|
@ -23,7 +25,7 @@ public interface RuleDescriptionDataProperties extends
|
|||
|
||||
ValueProvider<RuleDescriptionData, String> scopeLabel();
|
||||
|
||||
ValueProvider<RuleDescriptionData, String> creationDate();
|
||||
ValueProvider<RuleDescriptionData, Date> creationDate();
|
||||
|
||||
ValueProvider<RuleDescriptionData, String> description();
|
||||
|
||||
|
|
Loading…
Reference in New Issue