Package com.esri.gpt.framework.util

Examples of com.esri.gpt.framework.util.DateProxy


  String dateTo = this.getDateModifiedTo();
  if ("".equals(dateTo)) {
    return null;
  }
  try {
    DateProxy dateProxy = new DateProxy();
    dateProxy.setDate(dateTo);
    this.setDateModifiedTo(
        DEFAULT_TIME_FORMAT_OBJ.format(dateProxy.asToTimestamp()));
    return dateProxy.asToTimestamp();
  } catch (Exception e) {
    LOG.log(Level.WARNING, "to date = " + dateTo + "could not convert to"
        + " timestamp object", e);
  }
  return null;
View Full Code Here


  String dateFrom = this.getDateModifiedFrom();
  if("".equals(dateFrom)) {
    return null;
  }
  try {
    DateProxy dateProxy = new DateProxy();
    dateProxy.setDate(dateFrom);
    this.setDateModifiedFrom(
        DEFAULT_TIME_FORMAT_OBJ.format(dateProxy.asFromTimestamp()));
    return dateProxy.asToTimestamp();
  } catch (Exception e) {
    LOG.log(Level.WARNING, "from date = " + dateFrom + "could not convert to"
        + " timestamp object", e);
  }
  return null;
View Full Code Here

* Gets from date as date object.
* @return from date or <code>null</code> if date invalid
*/
public Date getFromDateAsDate() {
  Timestamp timestamp = null;
  DateProxy dp = new DateProxy();
  dp.setDate(getFromDate());
  if (dp.getIsValid()) {
    timestamp = dp.asFromTimestamp();
  }
  return timestamp;
}
View Full Code Here

   * @param inclusive <code>true</code> to make inclusive query
   * @return the value to query
   * @throws DiscoveryException if the supplied value cannot be converted
   */
  private String makeValueToQuery(String value, boolean isLowerBoundary, boolean isUpperBoundary, boolean inclusive) {
    DateProxy proxy = new DateProxy();
    proxy.setDate(value);
    if (!proxy.getIsValid()) {
      throw new IllegalArgumentException("Invalid Timestamp: " + value
          + ", use for yyyy-mm-dd hh:mm:ss.fff");
    }
    Timestamp tsValue = null;
    if (isLowerBoundary) {
      tsValue = inclusive ? proxy.asFromTimestamp() : proxy.asFromTimestampExcl();
    } else if (isUpperBoundary) {
      tsValue = inclusive ? proxy.asToTimestamp() : proxy.asToTimestampExcl();
    } else {
      tsValue = inclusive ? proxy.asFromTimestamp() : proxy.asFromTimestampExcl();
    }

    if (tsValue == null) {
      return null;
    }
View Full Code Here

   */
  public String formatValue(Parameter parameter, String value) {
    value = Val.chkStr(value);
    if (value.length() > 0) {
      if (parameter.getValidation().getValueType().equals(Validation.VALUETYPE_DATE)) {
        DateProxy dp = new DateProxy();
        dp.setDate(value);
        value = (dp.getDate());
      }
    }
    return value;
  }
View Full Code Here

    String sValue = parameter.getContent().getSingleValue().getValue();
    String sValueType = getValueType();
     
    // check a Date type
    if (sValueType.equals(Validation.VALUETYPE_DATE)) {
      DateProxy dp = new DateProxy();
      dp.setDate(sValue);
      if (!dp.getIsValid()) {
        errors.addInvalidParameter(section,parameter);
      }
     
    // check a Double type
    } else if (sValueType.equals(Validation.VALUETYPE_DOUBLE)) {
View Full Code Here

TOP

Related Classes of com.esri.gpt.framework.util.DateProxy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.