atg.commerce.order.scheduled
Class PeriodicScheduleProperty

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

public class PeriodicScheduleProperty
extends ScheduleProperty

This class represents the schedule property in the scheduledOrder repository. The schedule property will be a Periodic Schedule. The property is mapped to the user fields on the User Interface which are for Periodic Schedule such as the Period Type and Period value.

See Also:
ScheduleProperty

Field Summary
static java.lang.String CLASS_VERSION
           
static long MONTH_MSECS
          The month can't be represented by milliseconds since different months has different lengths Need special treatment
static java.lang.String[] PERIOD_TYPES
          A list of possible values that the property PERIOD_TYPE can take
 
Fields inherited from class atg.commerce.order.scheduled.ScheduleProperty
sResourceBundle
 
Constructor Summary
PeriodicScheduleProperty()
           
 
Method Summary
protected  Schedule createScheduleFromUserInput(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method creates the Schedule object from the user inputs.
 java.lang.String getReadableScheduleString(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse, Schedule pSchedule)
          This method returns a human-readable schedule String.
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 remapNullScheduleToUserInputFields(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method maps to the user inputs when no schedule exists.
protected  void remapPeriodicMonthScheduleToUserInputFields(atg.service.scheduler.PeriodicMonthSchedule pSchedule)
          This method maps the PeriodicMonthSchedule to the user inputs
protected  void remapPeriodicScheduleToUserInputFields(PeriodicSchedule pSchedule)
          This method maps the PeriodicSchedule to the user inputs
protected  void remapScheduleStringToUserInput(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse, Schedule pSchedule)
          This method remaps the human-readable schedule string to the user input
protected  void remapScheduleToUserInputFields(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse, Schedule pSchedule)
          This method maps the Schedule Object to the user inputs.
protected  void verifyPeriod(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method verifies the period user input value.
protected  void verifyPeriodType(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method verifies the period type user input value.
 void verifyUserInputFields(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method verifies the values of the user input.
 
Methods inherited from class atg.commerce.order.scheduled.ScheduleProperty
getComplexScheduledOrderPropertyValue, remapValueFromScheduledOrder, remapValueFromUserInputFields
 
Methods inherited from class atg.commerce.order.scheduled.ComplexScheduledOrderProperty
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

PERIOD_TYPES

public static final java.lang.String[] PERIOD_TYPES
A list of possible values that the property PERIOD_TYPE can take


MONTH_MSECS

public static final long MONTH_MSECS
The month can't be represented by milliseconds since different months has different lengths Need special treatment

See Also:
Constant Field Values
Constructor Detail

PeriodicScheduleProperty

public PeriodicScheduleProperty()
Method Detail

verifyUserInputFields

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

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

verifyPeriodType

protected void verifyPeriodType(DynamoHttpServletRequest pRequest,
                                DynamoHttpServletResponse pResponse)
This method verifies the period type user input value. If it is null, empty or doesn't match the pre-defined period type, an exception will be thrown.

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

verifyPeriod

protected void verifyPeriod(DynamoHttpServletRequest pRequest,
                            DynamoHttpServletResponse pResponse)
This method verifies the period user input value. If it is null, empty or non-numerical, an exception will be thrown.

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

createScheduleFromUserInput

protected Schedule createScheduleFromUserInput(DynamoHttpServletRequest pRequest,
                                               DynamoHttpServletResponse pResponse)
This method creates the Schedule object from the user inputs. It first checks the period type, if it is monthly type, it will create a PeriodicMonthSchedule object; Otherwise, it will create a PeriodicSchedule object.

Specified by:
createScheduleFromUserInput in class ScheduleProperty
Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
A Schedule object
See Also:
PeriodicSchedule, PeriodicMonthSchedule

remapScheduleToUserInputFields

protected void remapScheduleToUserInputFields(DynamoHttpServletRequest pRequest,
                                              DynamoHttpServletResponse pResponse,
                                              Schedule pSchedule)
This method maps the Schedule Object to the user inputs.

Specified by:
remapScheduleToUserInputFields in class ScheduleProperty
Parameters:
pSchedule - the Schedule Object
pRequest - the servlet's request
pResponse - the servlet's response

remapScheduleStringToUserInput

protected void remapScheduleStringToUserInput(DynamoHttpServletRequest pRequest,
                                              DynamoHttpServletResponse pResponse,
                                              Schedule pSchedule)
This method remaps the human-readable schedule string to the user input

Parameters:
pSchedule - the Schedule Object

remapNullScheduleToUserInputFields

protected void remapNullScheduleToUserInputFields(DynamoHttpServletRequest pRequest,
                                                  DynamoHttpServletResponse pResponse)
This method maps to the user inputs when no schedule exists. It simply initializes the user inputs.

Specified by:
remapNullScheduleToUserInputFields in class ScheduleProperty
Parameters:
pRequest - the servlet's request
pResponse - the servlet's response

remapPeriodicMonthScheduleToUserInputFields

protected void remapPeriodicMonthScheduleToUserInputFields(atg.service.scheduler.PeriodicMonthSchedule pSchedule)
This method maps the PeriodicMonthSchedule to the user inputs

Parameters:
pSchedule - the PeriodicMonthSchedule object

remapPeriodicScheduleToUserInputFields

protected void remapPeriodicScheduleToUserInputFields(PeriodicSchedule pSchedule)
This method maps the PeriodicSchedule to the user inputs

Parameters:
pSchedule - the PeriodicSchedule object

getReadableScheduleString

public java.lang.String getReadableScheduleString(DynamoHttpServletRequest pRequest,
                                                  DynamoHttpServletResponse pResponse,
                                                  Schedule pSchedule)
This method returns a human-readable schedule String.

Specified by:
getReadableScheduleString in class ScheduleProperty
Parameters:
pSchedule - the schedule object
Returns:
a human-readable schedule string

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