Time, DateTime and Duration properties are supported in the MDEX Engine. You define them in Developer Studio.

The Property editor provides three temporal property types:

In the example below, the Time property has been declared to be of the Time type, the TimeStamp property has been declared to be of the DateTime type, and the DeliveryDelay property has been declared to be of the Duration type:

Properties of type Time, DateTime, and Duration can be used for:

For information about temporal properties in Analytics queries, and time-specific operators in the Analytics API, see the MDEX Engine Analytics Guide.

Like all Oracle Commerce property types (Alpha, Floating Point, Integer, and so on), time and date values are handled during the data ingest process and in UI application code as strings, but are stored and manipulated as typed data in the Oracle Commerce MDEX Engine.

For non-Alpha property types, this raises the question of data manipulation in the Forge pipeline and appropriate presentation of typed data in the UI.

At data ingest time, inbound temporal data is unlikely to conform to the representations required by Oracle Commerce temporal property types. But time and date classes for performing needed conversions are readily available in the standard Java library (see java.text.DateFormat). These should be used (in the context of a JavaManipulator Forge component) to convert inbound data in the data ingest pipeline.

For example, the following code performs simple input conversion on source date strings of the form "August 26, 2009" to Oracle Commerce DateTime property format:

String sourceDate = … // String of form "August 26, 2009"
DateFormat dateFmt = DateFormat.getDateInstance(DateFormat.LONG);
Date date = dateFmt.parse(sourceDate);
Long dateLong = new Long(date.getTime());
String dateDateTimeValue = dateLong.toString();

Similarly, in most cases the integer representation of times and dates supported by the Oracle Commerce MDEX Engine is not suitable for application display. Again, the application should make use of standard library components (such as java.util.Date and java.util.GregorianCalendar) to convert Oracle Commerce dates for presentation.

For example, the following code performs a simple conversion of a DateTime value to a pretty-printable string:

String dateStr = … // Initialized to an Endeca DateTime value
long dateLong = Long.parseLong(dateStr);
Date date = new Date(dateLong);
String dateRenderString = date.toString();

Copyright © Legal Notices