atg.commerce.order.scheduled
Class DateProperty

java.lang.Object
  extended by atg.commerce.order.scheduled.ComplexScheduledOrderProperty
      extended by atg.commerce.order.scheduled.DateProperty
Direct Known Subclasses:
DateProperty

public class DateProperty
extends ComplexScheduledOrderProperty

This class represents the date(startDate,endDate) property in the scheduledOrder item descriptor. The date property will be a java.sql.Timestamp type. The property is mapped to the fields on the user interface which are specific for this property such as the year, month, date, hour, minute, AM or PM fields. It takes in those field values and construct a Timestamp object, and vice versa.

See Also:
ComplexScheduledOrderProperty

Field Summary
static java.lang.String CLASS_VERSION
           
 
Constructor Summary
DateProperty()
           
 
Method Summary
protected  java.sql.Timestamp createDate(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method creates a Timestamp date from the user inputs.
protected  void initializeAmPmInputField()
          This method initializes the user input values for the AMPM input.
protected  void initializeDayInputField()
          This method initializes the user input values for the date input.
protected  void initializeHourInputField()
          This method initializes the user input values for the hour input.
protected  void initializeMinuteInputField()
          This method initializes the user input values for the minute input.
protected  void initializeModeInputField()
          This method initializes the user input values for the MODE input.
protected  void initializeMonthInputField()
          This method initializes the user input values for the month input.
protected  void initializeSecondInputField()
          This method initializes the user input values for the second input.
protected  void initializeUserInputField(java.lang.String pUserInputFieldName)
          This method initializes the user input values for a particular user input.
 void initializeUserInputFields()
          This method initializes all the user inputs.
protected  void initializeYearInputField()
          This method initializes the user input values for the year input.
protected  void parseDayField(java.sql.Timestamp ts, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method parses the date property of a Timestamp value.
protected  void parseDEHourField(java.sql.Timestamp ts, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method parses the hour property of a Timestamp value when the user's locale is de_DE.
protected  void parseField(java.sql.Timestamp ts, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method parses a Timestamp value.
protected  void parseHourField(java.sql.Timestamp ts, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method parses the hour property of a Timestamp value.
protected  void parseMinuteField(java.sql.Timestamp ts, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method parses the minute property of a Timestamp value.
protected  void parseMonthField(java.sql.Timestamp ts, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method parses the month property of a Timestamp value.
protected  void parseNullField(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method parses a null Timestamp value in case that the user does not have a date property value.
protected  void parseOtherHourField(java.sql.Timestamp ts, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method parses the hour property of a Timestamp value when the user's locale is other than en_US and de_DE.
protected  void parseSecondField(java.sql.Timestamp ts, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method parses the second property of a Timestamp value.
protected  void parseUSHourField(java.sql.Timestamp ts, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method parses the hour property of a Timestamp value when the user's locale is en_US.
protected  void parseYearField(java.sql.Timestamp ts, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method parses the year property of a Timestamp value.
 void remapValueFromScheduledOrder(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method maps the date property that this class represents in the scheduleOrder repository to the user inputs.
 void remapValueFromUserInputFields(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method maps the user inputs to the date property that this class represents in the scheduledOrder repository.
protected  void setDayField(java.util.Calendar c, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method sets the day property for a Calendar date.
protected  void setDEHourField(java.util.Calendar c, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method sets the hour property for a Calendar date, when the user's locale is de_DE It is a helper method for createDate method.
protected  void setHourField(java.util.Calendar c, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method sets the hour property for a Calendar date, depending on the current user's locale It is a helper method for createDate method.
protected  void setMinuteField(java.util.Calendar c, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method sets the minute property for a Calendar date.
protected  void setMonthField(java.util.Calendar c, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method sets the month property for a Calendar date.
protected  void setOtherHourField(java.util.Calendar c, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method sets the hour property for a Calendar date, when the user's locale is other than en_US and de_DE It is a helper method for createDate method.
protected  void setSecondField(java.util.Calendar c, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method sets the second property for a Calendar date.
protected  void setUSHourField(java.util.Calendar c, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method sets the hour property for a Calendar date, when the user's locale is en_US It is a helper method for createDate method.
protected  void setYearField(java.util.Calendar c, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method sets the year property for a Calendar date.
protected  void verifyDayInputField(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method verifies the day input field.
protected  void verifyHourInputField(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method verifies the hour input field.
protected  void verifyMinuteInputField(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method verifies the minute input field.
protected  void verifyModeInputField(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method verifies the mode of the date property.
protected  void verifyMonthInputField(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method verifies the month input field.
protected  void verifySecondInputField(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method verifies the second input field.
 void verifyUserInputFields(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method verifies the values of the user input.
protected  void verifyYearInputField(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method verifies the year input field.
 
Methods inherited from class atg.commerce.order.scheduled.ComplexScheduledOrderProperty
getComplexScheduledOrderPropertyValue, getFormHandler, getScheduledOrderPropertyName, getUserInputField, getUserInputFieldNames, getUserInputFields, setFormHandler, setScheduledOrderPropertyName, setUserInputField, setUserInputFieldNames, setUserInputFields
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Constructor Detail

DateProperty

public DateProperty()
Method Detail

verifyUserInputFields

public void verifyUserInputFields(DynamoHttpServletRequest pRequest,
                                  DynamoHttpServletResponse pResponse)
This method verifies the values of the user input. It looks into each input field and checks the validity of each input field value.

Specified by:
verifyUserInputFields in class ComplexScheduledOrderProperty
Parameters:
pRequest - the servlet's request
pResponse - the servlet's response

verifyModeInputField

protected void verifyModeInputField(DynamoHttpServletRequest pRequest,
                                    DynamoHttpServletResponse pResponse)
This method verifies the mode of the date property. It can be either definite, meaning a specific date must be inputted, or indefinite, meaning it is for ever and no date needs to be inputted. Only the endDate is allowed to be in indefinite mode.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response

verifyYearInputField

protected void verifyYearInputField(DynamoHttpServletRequest pRequest,
                                    DynamoHttpServletResponse pResponse)
This method verifies the year input field. It first checks whether it is null or empty, throwing a Droplet exception if the case. It further checks whether the value if numerical, throwing a Droplet exception if the case.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response

verifyMonthInputField

protected void verifyMonthInputField(DynamoHttpServletRequest pRequest,
                                     DynamoHttpServletResponse pResponse)
This method verifies the month input field. It first checks whether it is null or empty, throwing a Droplet exception if the case. It further checks whether the value if numerical and within the proper range (1 to 12), throwing a Droplet exception if the case.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response

verifyDayInputField

protected void verifyDayInputField(DynamoHttpServletRequest pRequest,
                                   DynamoHttpServletResponse pResponse)
This method verifies the day input field. It first checks whether it is null or empty, throwing a Droplet exception if the case. It further checks whether the value if numerical and within the proper range (1 to 31), throwing a Droplet exception if the case.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response

verifyHourInputField

protected void verifyHourInputField(DynamoHttpServletRequest pRequest,
                                    DynamoHttpServletResponse pResponse)
This method verifies the hour input field. It is empty for the reason that user input might not include the hour input field. User could override it when the hour is used.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response

verifyMinuteInputField

protected void verifyMinuteInputField(DynamoHttpServletRequest pRequest,
                                      DynamoHttpServletResponse pResponse)
This method verifies the minute input field. It is empty for the reason that user input might not include the hour input field. User could override it when the minute is used.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response

verifySecondInputField

protected void verifySecondInputField(DynamoHttpServletRequest pRequest,
                                      DynamoHttpServletResponse pResponse)
This method verifies the second input field. It is empty for the reason that user input might not include the hour input field. User could override it when the second is used.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response

remapValueFromScheduledOrder

public void remapValueFromScheduledOrder(DynamoHttpServletRequest pRequest,
                                         DynamoHttpServletResponse pResponse)
This method maps the date property that this class represents in the scheduleOrder repository to the user inputs. It parses the value of this property which is a Timestamp.

Specified by:
remapValueFromScheduledOrder in class ComplexScheduledOrderProperty
Parameters:
pRequest - the servlet's request
pResponse - the servlet's response

parseNullField

protected void parseNullField(DynamoHttpServletRequest pRequest,
                              DynamoHttpServletResponse pResponse)
This method parses a null Timestamp value in case that the user does not have a date property value. It simply initilizes the user input values.


parseField

protected void parseField(java.sql.Timestamp ts,
                          DynamoHttpServletRequest pRequest,
                          DynamoHttpServletResponse pResponse)
This method parses a Timestamp value. It is called from remapValueFromScheduledOrder to remap the property value to the user inputs.

Parameters:
ts - a Timestamp value

parseYearField

protected void parseYearField(java.sql.Timestamp ts,
                              DynamoHttpServletRequest pRequest,
                              DynamoHttpServletResponse pResponse)
This method parses the year property of a Timestamp value. It is a helper method for ParseField method.

Parameters:
ts - a Timestamp value

parseMonthField

protected void parseMonthField(java.sql.Timestamp ts,
                               DynamoHttpServletRequest pRequest,
                               DynamoHttpServletResponse pResponse)
This method parses the month property of a Timestamp value. It is a helper method for ParseField method.

Parameters:
ts - a Timestamp value

parseDayField

protected void parseDayField(java.sql.Timestamp ts,
                             DynamoHttpServletRequest pRequest,
                             DynamoHttpServletResponse pResponse)
This method parses the date property of a Timestamp value. It is a helper method for ParseField method.

Parameters:
ts - a Timestamp value

parseHourField

protected void parseHourField(java.sql.Timestamp ts,
                              DynamoHttpServletRequest pRequest,
                              DynamoHttpServletResponse pResponse)
This method parses the hour property of a Timestamp value. Depending on the the user's current locale, it will call different parse methods. It is a helper method for ParseField method.

Parameters:
ts - a Timestamp value

parseUSHourField

protected void parseUSHourField(java.sql.Timestamp ts,
                                DynamoHttpServletRequest pRequest,
                                DynamoHttpServletResponse pResponse)
This method parses the hour property of a Timestamp value when the user's locale is en_US.

Parameters:
ts - a Timestamp value

parseDEHourField

protected void parseDEHourField(java.sql.Timestamp ts,
                                DynamoHttpServletRequest pRequest,
                                DynamoHttpServletResponse pResponse)
This method parses the hour property of a Timestamp value when the user's locale is de_DE.

Parameters:
ts - a Timestamp value

parseOtherHourField

protected void parseOtherHourField(java.sql.Timestamp ts,
                                   DynamoHttpServletRequest pRequest,
                                   DynamoHttpServletResponse pResponse)
This method parses the hour property of a Timestamp value when the user's locale is other than en_US and de_DE.

Parameters:
ts - a Timestamp value

parseMinuteField

protected void parseMinuteField(java.sql.Timestamp ts,
                                DynamoHttpServletRequest pRequest,
                                DynamoHttpServletResponse pResponse)
This method parses the minute property of a Timestamp value. It is a helper method for ParseField method.

Parameters:
ts - a Timestamp value

parseSecondField

protected void parseSecondField(java.sql.Timestamp ts,
                                DynamoHttpServletRequest pRequest,
                                DynamoHttpServletResponse pResponse)
This method parses the second property of a Timestamp value. It is a helper method for ParseField method.

Parameters:
ts - a Timestamp value

remapValueFromUserInputFields

public void remapValueFromUserInputFields(DynamoHttpServletRequest pRequest,
                                          DynamoHttpServletResponse pResponse)
This method maps the user inputs to the date property that this class represents in the scheduledOrder repository.

Specified by:
remapValueFromUserInputFields in class ComplexScheduledOrderProperty
Parameters:
pRequest - the servlet's request
pResponse - the servlet's response

createDate

protected java.sql.Timestamp createDate(DynamoHttpServletRequest pRequest,
                                        DynamoHttpServletResponse pResponse)
This method creates a Timestamp date from the user inputs. It first creates a blank date and then sets the corresponding property based on user's input.

Returns:
return a Timestamp value

setYearField

protected void setYearField(java.util.Calendar c,
                            DynamoHttpServletRequest pRequest,
                            DynamoHttpServletResponse pResponse)
This method sets the year property for a Calendar date. It is a helper method for createDate method.

Parameters:
c - a Calendar date

setMonthField

protected void setMonthField(java.util.Calendar c,
                             DynamoHttpServletRequest pRequest,
                             DynamoHttpServletResponse pResponse)
This method sets the month property for a Calendar date. It is a helper method for createDate method.

Parameters:
c - a Calendar date

setDayField

protected void setDayField(java.util.Calendar c,
                           DynamoHttpServletRequest pRequest,
                           DynamoHttpServletResponse pResponse)
This method sets the day property for a Calendar date. It is a helper method for createDate method.

Parameters:
c - a Calendar date

setHourField

protected void setHourField(java.util.Calendar c,
                            DynamoHttpServletRequest pRequest,
                            DynamoHttpServletResponse pResponse)
This method sets the hour property for a Calendar date, depending on the current user's locale It is a helper method for createDate method.

Parameters:
c - a Calendar date

setUSHourField

protected void setUSHourField(java.util.Calendar c,
                              DynamoHttpServletRequest pRequest,
                              DynamoHttpServletResponse pResponse)
This method sets the hour property for a Calendar date, when the user's locale is en_US It is a helper method for createDate method.

Parameters:
c - a Calendar date

setDEHourField

protected void setDEHourField(java.util.Calendar c,
                              DynamoHttpServletRequest pRequest,
                              DynamoHttpServletResponse pResponse)
This method sets the hour property for a Calendar date, when the user's locale is de_DE It is a helper method for createDate method.

Parameters:
c - a Calendar date

setOtherHourField

protected void setOtherHourField(java.util.Calendar c,
                                 DynamoHttpServletRequest pRequest,
                                 DynamoHttpServletResponse pResponse)
This method sets the hour property for a Calendar date, when the user's locale is other than en_US and de_DE It is a helper method for createDate method.

Parameters:
c - a Calendar date

setMinuteField

protected void setMinuteField(java.util.Calendar c,
                              DynamoHttpServletRequest pRequest,
                              DynamoHttpServletResponse pResponse)
This method sets the minute property for a Calendar date. It is a helper method for createDate method.

Parameters:
c - a Calendar date

setSecondField

protected void setSecondField(java.util.Calendar c,
                              DynamoHttpServletRequest pRequest,
                              DynamoHttpServletResponse pResponse)
This method sets the second property for a Calendar date. It is a helper method for createDate method.

Parameters:
c - a Calendar date

initializeUserInputFields

public void initializeUserInputFields()
This method initializes all the user inputs.

Specified by:
initializeUserInputFields in class ComplexScheduledOrderProperty

initializeUserInputField

protected void initializeUserInputField(java.lang.String pUserInputFieldName)
This method initializes the user input values for a particular user input.

Parameters:
pUserInputFieldName - the user input field name

initializeYearInputField

protected void initializeYearInputField()
This method initializes the user input values for the year input. Override it if different initilization requires


initializeMonthInputField

protected void initializeMonthInputField()
This method initializes the user input values for the month input. Override it if different initilization requires


initializeDayInputField

protected void initializeDayInputField()
This method initializes the user input values for the date input. Override it if different initilization requires


initializeHourInputField

protected void initializeHourInputField()
This method initializes the user input values for the hour input. Override it if different initilization requires


initializeMinuteInputField

protected void initializeMinuteInputField()
This method initializes the user input values for the minute input. Override it if different initilization requires


initializeSecondInputField

protected void initializeSecondInputField()
This method initializes the user input values for the second input. Override it if different initilization requires


initializeAmPmInputField

protected void initializeAmPmInputField()
This method initializes the user input values for the AMPM input. Override it if different initilization requires


initializeModeInputField

protected void initializeModeInputField()
This method initializes the user input values for the MODE input. The value can be definite or indefinite. For the StartDate, it must be definite; For the EndDate, it can be either. Definite means the user must specify the date; Indefinite means the user doesn't need to specify the date, the schedule order will have no endDate and kept being placed on its own schedule. The default is definite. Override it if different initilization requires