|Download TeamPage version|
com.traction.sdk.Entryfor retrieving and creating
com.traction.sdk.DateTypes have been improved.
EntryClasshas the method
DateType getCustomDateType(String dateTypeName), which allows it to return any
DateTypeinstance for a requested name.
EntryClassalso now has new methods for setting and getting
com.traction.sdk.UTCDisplayDatevalues, even when protected methods that allows a custom date value to be applied to or retrieved from any
com.traction.sdk.edit.NewEntryor any arbitrary properties representing entry properties, even when the proeprties just mirror ordinary entry properties but where no
NewEntryobject is present. This can be useful, e.g., setting up or reading values in the context of some custom forms.
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
protected CustomStandardDateResult getCustomStandardDateImpl(GetProperty entryProperties, DateType dateType), which is the shared implementation for both of those methods.
CustomStandardDateResultis a new protected static class in
EntryClasswhich uses the enum
CustomStandardDateResultTypeto 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
EntryClassthat 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.
EntryClassthat can be overridden to implement the behaviors
Entry.getStandardDateTypehas been removed. This method's name and purpose were confusing.
DateType getDateType(Entry entry, String dateTypeName): for retrieving a
DateTypeas defined for a given
EntryClass, which may be an intrinsic type or one that the
EntryClasshas a chance to define via
DateType getDateType(String dateTypeName): similar to the method it overloads, when no
Entryis available. The default
EntryClass-dependent definition will be used for custom types, which means
EntryClassmethods for setting or getting meaning that this version doesn't offer an
EntryClassa chance to determine a special custom
DateType. This method should only be used in certain cases where a shared definition of a certain
DateTypeis applicable, such as a generic start date, end date, due date, or one otherwise known to be governed by the properties defined in an
EntryClassof 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
DateTypewhose implementation is entirely in terms of the
EntryClassmethods for setting and getting date values. This is mainly intended to be invoked by
com.traction.sdk.token.EntryFields and form data, these additional changes are also included in this release:
DateTypeinterface 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)
UTCDisplaydatealso has two new methods. both with default implementations:
public java.util.Calendar getAdjustedCalendar(): makes it easier to directly get an appropriate
Calendarobject representing the date value mapped into the requesting user's preferred time zone, in case, for example, custom transformations that operate on
Calendars need to be applied to date/time values.
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
UTCCalendarDateRangealso 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/time from the
getTodaysDate()method invoked on the
Contextfor the current request -- specifically, if the start date/time has passed, end date/time hasn't.
public boolean isComplete(Context context): tests whether the range covers a span that is considered "complete," also with respect to the current date/time from the
Context-- specifically, if the end date/time has passed.
public boolean isIncomplete(Context context): tests whether the range covers a span that is considered "incomplete," also with respect to the current date/time from the
Context-- specifically, if the end date/time hasn't passed.
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.
EntryFields have been added, mainly to support filtering based on some of those new
event_in_progress- the raw value is true/false depending upon whether the span for a given
Entryis considered "in progress," as per the test for the
isInProgressmethod. Supports filtering via a search expression like
event_complete- the raw value is true/false depending upon whether the span for a given
Entryis considered "complete," as per the
isCompletemethod. Supports filtering via a search expression like
event_incomplete- the raw value is true/false depending upon whether the span for a given
Entryis considered "incomplete," as per the test for the
isIncompletemethod. Supports filtering via a search expression like