|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.droplet.EmptyFormHandler atg.droplet.GenericFormHandler atg.droplet.DateEditor
public class DateEditor
This class allows for the manipulation within a form of a java.util.Date property in another component.
A component created with this class should be request scoped. Therefore everytime a page with a form that uses this component will always have the current time. If you want the component to have the time at the beginning of the session, then make the component session scoped.
An example of creating a date and setting it in the java.util.Date.property follows:
<input type="text" priority=100 bean="DateEditor.Year"> <input type="text" priority=100 bean="DateEditor.Month"> <input type="text" priority=100 bean="DateEditor.Day"> <input type="text" priority=100 bean="DateEditor.Hours"> <input type="text" priority=100 bean="DateEditor.Minutes"> <input type="hidden" value="" bean="DateEditor.submit">Note the above example assumes these date manipulation fields are within a form that calls another bean. The hidden input is to call the submit method of the DateEditor bean to ensure that the desired java.util.Date property is updated.
Another example that allows the manipulation of the current value of the java.util.Date.property follows:
<setvalue bean="DateEditor.Date" value="bean:NewsRepositoryFormHandler.value.goLiveDate"> <input type="text" priority=100 bean="DateEditor.Year"> <input type="text" priority=100 bean="DateEditor.Month"> <input type="text" priority=100 bean="DateEditor.Day"> <input type="text" priority=100 bean="DateEditor.Hours"> <input type="text" priority=100 bean="DateEditor.Minutes"> <input type="hidden" value="" bean="DateEditor.submit">NOTE: Do NOT set the properties Year, Month, Day, Hours, Minutes directly in the .properties field or using the Dynamo Developer Workbench. Do this only if you want the DateEditor always to have these values. Currently whenever the DateEditor is created it always has the current date and time.
GenericFormHandler
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Fields inherited from class atg.droplet.GenericFormHandler |
---|
PARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDS |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
DateEditor()
Constructs a DateEditor object with all the fields set to the current time. |
Method Summary | |
---|---|
boolean |
checkDate(java.util.Date pDate,
java.lang.String pResourceBundleName,
java.util.ResourceBundle pResourceBundle)
Checks that the date is within the required limits. |
java.lang.String |
getAmPm()
Returns "AM" or "PM" depending on time. |
java.util.Date |
getDate()
Returns the date expressed by all the integer component fields. |
java.lang.String |
getDatePropertyPathName()
Returns the absolute path name of the Date property. |
int |
getDay()
Returns property Day. |
java.util.Date |
getEarliestAcceptableDate()
Returns property EarliestAcceptableDate |
int |
getHours()
Returns property Hours. |
boolean |
getIsDateSet()
Gets property IsDateSet |
java.util.Date |
getLatestAcceptableDate()
Returns property LatestAcceptableDate. |
int |
getMinutes()
Returns property Minutes |
int |
getMonth()
Returns property Month. |
int |
getSeconds()
Returns property Seconds |
int |
getYear()
Returns the property Year. |
boolean |
handleSubmit(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Handles the submit transaction of a form. |
boolean |
isPM()
Returns true if the time is PM. |
boolean |
isUsingAmPm()
Returns property UsingAmPm. |
boolean |
isUsingZeroBasedMonth()
Returns property UsingZeroBasedMonth. |
static void |
main(java.lang.String[] args)
Test method. |
void |
setAmPm(java.lang.String pAmPm)
Sets whether the time is AM or PM. |
void |
setDate(java.util.Date pDate)
Sets property Date. |
void |
setDatePropertyPathName(java.lang.String pDatePropertyPathName)
Sets property DatePropertyPathName. |
void |
setDay(int pDay)
Sets property Day. |
void |
setEarliestAcceptableDate(java.util.Date pEarliestAcceptableDate)
Sets property EarliestAcceptableDate |
void |
setHours(int pHours)
Sets property Hours. |
void |
setLatestAcceptableDate(java.util.Date pLatestAcceptableDate)
Sets property LatestAcceptableDate. |
void |
setMinutes(int pMinutes)
Sets property Minutes. |
void |
setMonth(int pMonth)
Sets property Month. |
void |
setPm(boolean pPM)
Sets the time to PM if pPM is true, otherwise sets the time to AM. |
void |
setSeconds(int pSeconds)
Sets property Seconds. |
void |
setUsingAmPm(boolean pUsingAmPm)
Sets property UsingAmPm. |
void |
setUsingZeroBasedMonth(boolean pUsingZeroBasedMonth)
Sets property UsingZeroBasedMonth. |
void |
setYear(int pYear)
Sets property Year. |
Methods inherited from class atg.droplet.EmptyFormHandler |
---|
afterGet, beforeGet |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public DateEditor()
Method Detail |
---|
public void setDatePropertyPathName(java.lang.String pDatePropertyPathName)
WARNING: Do not put the DatePropertyPathName in the JHTML file since this can allow it to be set from a client, thus exposing a security risk.
pDatePropertyPathName
- absolute path name of the Date propertypublic java.lang.String getDatePropertyPathName()
public void setDate(java.util.Date pDate)
pDate
- specific instant in time, with millisecond precisionpublic java.util.Date getDate()
public boolean getIsDateSet()
public void setYear(int pYear)
pYear
- year valuepublic int getYear()
public void setMonth(int pMonth)
pMonth
- month value between 0-11 if UsingZeroBasedMonth is true,
otherwise between 1-12public int getMonth()
public void setDay(int pDay)
pDay
- day value between 1-31, of course depending upon
the monthpublic int getDay()
public void setHours(int pHours)
pHours
- hour value between 0-23 if the UsingAmPm property
is false, 1-12 otherwisepublic int getHours()
public void setMinutes(int pMinutes)
pMinutes
- minutes value between 0-59public int getMinutes()
public void setSeconds(int pSeconds)
pSeconds
- seconds value between 0-59public int getSeconds()
public void setEarliestAcceptableDate(java.util.Date pEarliestAcceptableDate)
pEarliestAcceptableDate
- earliest acceptable date in millisecondspublic java.util.Date getEarliestAcceptableDate()
public void setUsingZeroBasedMonth(boolean pUsingZeroBasedMonth)
pUsingZeroBasedMonth
- true if the Month property range is
0-11, false if it is 1-12public boolean isUsingZeroBasedMonth()
public void setLatestAcceptableDate(java.util.Date pLatestAcceptableDate)
pLatestAcceptableDate
- latest acceptable date in millisecondspublic java.util.Date getLatestAcceptableDate()
public void setUsingAmPm(boolean pUsingAmPm)
pUsingAmPm
- true if the Hours property should be
interpreted with the AmPm propertypublic boolean isUsingAmPm()
public void setAmPm(java.lang.String pAmPm)
pAmPm
- String object that is either "AM" or "PM"public java.lang.String getAmPm()
public void setPm(boolean pPM)
pPM
- true if "PM"; false otherwisepublic boolean isPM()
public boolean checkDate(java.util.Date pDate, java.lang.String pResourceBundleName, java.util.ResourceBundle pResourceBundle)
pDate
- date to check in millisecondspResourceBundleName
- name of the message resource bundlepResourceBundle
- message resource bundle object
public boolean handleSubmit(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
pRequest
- request object to be processedpResponse
- response object for this request
public static void main(java.lang.String[] args)
args
- array of String arguments from the console
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |