ingo@1115: /*
ingo@1115: * Copyright (c) 2010 by Intevation GmbH
ingo@1115: *
ingo@1115: * This program is free software under the LGPL (>=v2.1)
ingo@1115: * Read the file LGPL.txt coming with the software for details
ingo@1115: * or visit http://www.gnu.org/licenses/ if it does not exist.
ingo@1115: */
ingo@1115:
tim@335: package de.intevation.gnv.state;
tim@335:
tim@335: import java.util.ArrayList;
tim@335: import java.util.Collection;
ingo@607: import java.util.Date;
ingo@607: import java.util.GregorianCalendar;
ingo@607: import java.util.Iterator;
ingo@470: import java.util.List;
tim@1096: import java.util.Locale;
tim@335:
tim@335: import org.apache.log4j.Logger;
ingo@607: import org.w3c.dom.Document;
ingo@607: import org.w3c.dom.Element;
ingo@607: import org.w3c.dom.Node;
tim@335:
sascha@1117: import de.intevation.artifacts.common.utils.XMLUtils;
tim@823: import de.intevation.artifacts.CallContext;
tim@823: import de.intevation.artifacts.CallMeta;
tim@823: import de.intevation.gnv.artifacts.ressource.RessourceFactory;
tim@823: import de.intevation.gnv.geobackend.base.Result;
tim@823: import de.intevation.gnv.geobackend.util.DateUtils;
tim@823: import de.intevation.gnv.state.describedata.DefaultMinMaxDescribeData;
tim@823: import de.intevation.gnv.state.describedata.DescribeData;
tim@823: import de.intevation.gnv.state.describedata.MinMaxDescribeData;
tim@823: import de.intevation.gnv.state.exception.StateException;
tim@823: import de.intevation.gnv.utils.InputValidator;
tim@823:
tim@335: /**
ingo@796: * This state handles input of a min and max value and validates the user input.
ingo@796: * The min value needs to be equal or smaller than the max value, otherwise the
ingo@796: * input results in an error.
ingo@796: *
sascha@780: * @author Tim Englich
sascha@780: * @author Ingo Weinzierl
tim@335: */
tim@335: public class MinMaxState extends StateBase {
tim@335:
tim@335: /**
tim@335: * the logger, used to log exceptions and additonaly information
tim@335: */
tim@335: private static Logger log = Logger.getLogger(MinMaxState.class);
tim@335:
tim@1096: /**
tim@1096: * Key to lookup the localized exceptionmessage in the ResourceFiles.
tim@1096: */
tim@1096: public static final String EXCEPTION_INVALID_MIN_MAX_INPUT =
tim@1096: "input.is.not.valid.minmax";
tim@1096:
tim@1096: /**
tim@335: * Constructor
tim@335: */
tim@335: public MinMaxState() {
tim@335: super();
tim@335: }
tim@335:
tim@335: /**
ingo@796: * The objects returned by the database are searched for two fields with
ingo@796: * 'MIN' and 'MAX' as names. These objects are stored and used to be
ingo@796: * displayed in the gui to give the user an orientation of the range he is
ingo@796: * able to insert.
tim@335: */
tim@335: @Override
ingo@607: protected List