PILLUTLAAVINASH / google-enterprise-connector-manager

Automatically exported from code.google.com/p/google-enterprise-connector-manager
0 stars 0 forks source link

Last Modified date that is sent to the GSA should be in YYYY-MM-DD (ISO 8601) format #76

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
GSA supports YYYY-MM-DD (ISO 8601) format for inmeta and daterange queries.
Connectors + Connector Manager should send the date to the GSA in the same
format. Currently the date is sent in RFC822 format 

Original issue reported on code.google.com by mobe...@gmail.com on 17 Apr 2008 at 1:27

GoogleCodeExporter commented 8 years ago
The problem isn't with the last modified date, which uses RFC 822, but with any 
other dates that appear in the 
metadata. The Connector Manager is formatting these other dates as ISO 8601 
timestamps ("yyyy-MM-
dd'T'HH:mm:ss.SSS'Z'") and it should be formatting them as ISO 8601 dates 
("yyyy-MM-dd").

As a quick hack, I changed DateValue.toString from "return toIso8601();" to 
"return toIso8601().substring(0, 
10);". Previously, a query such as

inmeta:modifydate:daterange:2007-01-01..2007-12-31

would fail, and with the change to DateValue (and reindexing the content), this 
query succeeds.

Original comment by johnl.vi...@gmail.com on 18 Apr 2008 at 12:49

GoogleCodeExporter commented 8 years ago

Original comment by mobe...@gmail.com on 18 Apr 2008 at 10:43

GoogleCodeExporter commented 8 years ago
Fixed in revision r867.

This set of changes addresses Connector Manager Issue 76 - fixing
inmeta:daterange queries over traversed content.  At this time, the 
GSA fails to evaluate daterange queries over date meta-data that is
formatted using the full ISO8601 representation.  However, daterange
queries do work over date meta-data that is formatted with an
abbreviated ISO8601 datestamp (year-month-day, without the
hours:mins:secs.millis).

The root of these changes is to push the abbreviated ISO8601 datestamp
representations into the feed.

Change Log:
----------

M  java/com/google/enterprise/connector/traversal/QueryTraverser.java
   - Log exception details at FINEST leve for 'Out of JVM Heap Space' exception.
     The failed parsing of ISO8601 dates eventually manifested as
     'Out of JVM Heap Space' exceptions.

M  java/com/google/enterprise/connector/spi/Value.java
   - Added SimpleDateFormats for shorter ISO8601-formatted timestamps,
     specifically, times down to the minute and dates only (year-month-day).
   - Added a new method, calendarToFeedXml(), that formats a Calendar
     object in the ISO8601 datestamp-only format that the GSA requires
     for inmeta:daterange queries to work.
   - When parsing an ISO8601 timestamp in iso8601ToDate(), try successively 
     shorter representations on parse failure.
   - When creating a String representation of a Calendar in calendarToIso8601(),
     choose the most appropriate ISO8601 SimpleDateFormater, based upon the
     Calendar.isSet(field) information.

M  java/com/google/enterprise/connector/spiimpl/DateValue.java
   - toFeedXml() now calls Value.calendarToFeedXml() rather than toString()
     when generating the DateValue representation for the Feed.

M  javatests/com/google/enterprise/connector/traversal/QueryTraverserTest.java
   - Include IllegalArgumentException details in an Assertion failure.

M  javatests/com/google/enterprise/connector/pusher/DocPusherTest.java
   - Change the expected values for ISO8601 Dates pushed to the feed to
     be just the shorter datestamp.

Original comment by Brett.Mi...@gmail.com on 2 Jul 2008 at 2:41

GoogleCodeExporter commented 8 years ago

Original comment by mgron...@gmail.com on 3 Jul 2008 at 2:21