Download TeamPage version |
com.traction.sdk.EntryClass
and com.traction.sdk.Entry
for retrieving and creating com.traction.sdk.DateType
s have been improved.EntryClass
has the method DateType getCustomDateType(String dateTypeName)
, which allows it to return any DateType
instance for a requested name.EntryClass
also now has new methods for setting and getting com.traction.sdk.UTCDisplayDate
values, even when protected methods that allows a custom date value to be applied to or retrieved from any com.traction.sdk.edit.NewEntry
or any arbitrary properties representing entry properties, even when the proeprties just mirror ordinary entry properties but where no Entry
or NewEntry
object is present. This can be useful, e.public void setCustomStandardDate(com.traction.sdk.props.GetPutProperty props, UTCDisplayDate date)
protected UTCDisplayDate getCustomStandardDate(GetProperty entryProperties, DateType dateType)
and protected UTCDisplayDate getCustomStandardDate(NewEntry entry, DateType dateType)
, which share an underlying implementation for the code that actually attempts to read and interpret the relevant entry properties in terms of the EntryClass
's configuration.protected CustomStandardDateResult getCustomStandardDateImpl(GetProperty entryProperties, DateType dateType)
, which is the shared implementation for both of those methods. CustomStandardDateResult
is a new protected static class in EntryClass
which uses the enum CustomStandardDateResultType
to indicate the status of a value retrieval, so that different implementations can handle those cases (particularly failures) differently.protected void setCustomStandardDateImpl(GetPutProperty entryProps, UTCDisplayDate date)
which is now used as the implementation for the previously existing protected void setCustomStandardDateImpl(GetPutProperty entryProps, UTCDisplayDate date)
method. In the unlikely event that you have a custom EntryClass
that overrides the old method that takes the NewEntry
, you will have to change them to override the new version instead, and recompile those in order to work with this version of TeamPage. For assistance with this migration, please file a new support request.EntryClass
that can be overridden to implement the behaviorsEntry.getStandardDateType
has been removed. This method's name and purpose were confusing.DateType getDateType(Entry entry, String dateTypeName)
: for retrieving a DateType
as defined for a given Entry
or EntryClass
, which may be an intrinsic type or one that the Entry
's EntryClass
has a chance to define via EntryClass
's new getCustomDateType
method.DateType getDateType(String dateTypeName)
: similar to the method it overloads, when no Entry
is available. The default EntryClass
-dependent definition will be used for custom types, which means EntryClass
methods for setting or getting meaning that this version doesn't offer an EntryClass
a chance to determine a special custom DateType
. This method should only be used in certain cases where a shared definition of a certain DateType
is applicable, such as a generic start date, end date, due date, or one otherwise known to be governed by the properties defined in an EntryClass
of interest that just doesn't happen to be available at the point where this method is being invoked.DateType createCustomDateTypeDefinedByEntryClass(String dateTypeName)
: for creating a new custom DateType
whose implementation is entirely in terms of the EntryClass
methods for setting and getting date values. This is mainly intended to be invoked by EntryClass
's default getCustomDateType
method.com.traction.sdk.token.EntryField
s and form data, these additional changes are also included in this release:DateType
interface for getting or setting date values in more contexts:UTCDisplayDate getDateFromNewEntry(NewEntry newEntry)
UTCDisplayDate getDateFromProperties(EntryClass entryClass, GetProperty props)
void applyToProperties(EntryClass entryClass, GetPutProperty props, UTCDisplayDate date)
UTCDisplaydate
also has two new methods. both with default implementations:public java.util.Calendar getAdjustedCalendar()
: makes it easier to directly get an appropriate Calendar
object representing the date value mapped into the requesting user's preferred time zone, in case, for example, custom transformations that operate on Calendar
s need to be applied to date/public void apply(EntryClass entryClass, GetPutProperty props)
: a convenience method that simply defers to the applyToProperties(EntryClass, GetPutProperty, DateType)
method for the date value's DateType
.UTCCalendarDateRange
also has some new helper methods for performing common tests for a range (all of which also have default implementations):public boolean isInProgress(Context context)
: tests whether the range covers a span that is considered "in progress" with respect to the date/getTodaysDate()
method invoked on the Context
for the current request -- specifically, if the start date/public boolean isComplete(Context context)
: tests whether the range covers a span that is considered "complete," also with respect to the current date/Context
-- specifically, if the end date/public boolean isIncomplete(Context context)
: tests whether the range covers a span that is considered "incomplete," also with respect to the current date/Context
-- specifically, if the end date/public boolean contains(UTCDisplayDate date)
: tests whether the given date value is contained by the range.public boolean contains(java.util.Date date)
: tests whether the given 'raw" Date value is contained by the range.EntryField
s have been added, mainly to support filtering based on some of those new UTCCalendarDateRange
methods:event_in_progress
- the raw value is true/Entry
is considered "in progress," as per the test for the isInProgress
method. Supports filtering via a search expression like f(event_in_progress:true)
.event_complete
- the raw value is true/Entry
is considered "complete," as per the isComplete
method. Supports filtering via a search expression like f(event_complete:true)
.event_incomplete
- the raw value is true/Entry
is considered "incomplete," as per the test for the isIncomplete
method. Supports filtering via a search expression like f(event_incomplete:true)
.teampage_logo.jpg