PILLUTLAAVINASH / google-enterprise-connector-manager

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

Inconsistent use of XML tags for Connector Schedule Information #178

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Call getConnectorInstanceList Servlet

What is the expected output?

Should only see one tag being used to contain the schedule information in
the XML response.

What do you see instead?

<ConnectorSchedules version="3">tca-01:100:300000:0-0</ConnectorSchedules>
<ConnectorSchedule version="1">tca-01:100:0-0</ConnectorSchedule>

Notice one element is using ConnectorSchedules (plural) and one is using
ConnectorSchedule (singular).  Should just be using one tag since the
version attribute can be used to differentiate.

Since "ConnectorSchedule" is only used in the import/export and this messed
up part of the Servlet I'm going to remove that tag and go with the
"ConnectorSchedules" tag.

Note, any code currently written that looks for this tag in the Servlet
response will have to be updated after this change.

Original issue reported on code.google.com by mgron...@gmail.com on 11 Aug 2009 at 9:31

GoogleCodeExporter commented 8 years ago
This was done for backward compatibility with old GSAs.
See CM Issue 79 and the change log for revision r1568

All current GSAs expect the ConnectorSchedule tag with the legacy schedule 
format.

Original comment by Brett.Mi...@gmail.com on 12 Aug 2009 at 12:14

GoogleCodeExporter commented 8 years ago
The GSA should be enhanced to look for the ConnectorSchedules element from 
getConnectorInstanceList.  
Even if it doesn't add GUI support for retryDelay and disabled, it should at 
least preserve them for the round-
trip.

I don't know if import/export needs to care about legacy schedules (other than 
being able to read older 
exported state).

Newer uses should definitely use the ConnectorSchedules element and pay 
attention to the version.

In what way is the servlet "messed up"?

Original comment by Brett.Mi...@gmail.com on 12 Aug 2009 at 12:24

GoogleCodeExporter commented 8 years ago
I did an annotation check on the constants and since XMLTAG_CONNECTOR_SCHEDULES 
was
introduced first in the code base I felt it was messed up in r401 for the 
Servlet to
use (and introduce) XMLTAG_CONNECTOR_SCHEDULE.  Sorry, water under the bridge.

Agree, the GSA should preserve the data and use the new format.  That's what I'm
working on right now.  I would like to just remove the 
XMLTAG_CONNECTOR_SCHEDULE from
the class to force anyone using it to get a compiler error rather than 
deprecate it.

The import/export is used on the GSA to preserve the internal connectors during 
a
version upgrade.  I'll look into patching this fix into a 2.0.0 release for the 
GSA
so I don't have to support older export state.  Also need to make sure export 
uses
the right schedule string.

Original comment by mgron...@gmail.com on 12 Aug 2009 at 1:19

GoogleCodeExporter commented 8 years ago
Fixed at r2209.

NOTE: This area still needs some work but I'm closing this issue for now.  Some 
areas
that could be addressed are:

1) Stop sending encoded schedule.  If we change the schedule format to 
iCalendar this
won't matter but it's not good to send the schedule in one format (encoded) and
receive updates in another format (expanded XML).

2) Remove the knowledge of schedule version from the FeedConnection interface.

------------------------------------------------------------------------
r2209 | mgronber | 2009-08-14 13:16:30 -0700 (Fri, 14 Aug 2009) | 18 lines
Changed paths:
   M
/trunk/projects/connector-manager/source/java/com/google/enterprise/connector/im
portexport/ImportExport.java
   M
/trunk/projects/connector-manager/source/java/com/google/enterprise/connector/se
rvlet/GetConnectorInstanceList.java
   M
/trunk/projects/connector-manager/source/java/com/google/enterprise/connector/se
rvlet/ServletUtil.java
   A
/trunk/projects/connector-manager/source/javatests/com/google/enterprise/connect
or/importexport
   A
/trunk/projects/connector-manager/source/javatests/com/google/enterprise/connect
or/importexport/ImportExportTest.java

For now just deprecating the bad tag since backward compatibility will be an
issue for a while.

Change Log:

M java/com/google/enterprise/connector/servlet/GetConnectorInstanceList.java: 
  - Added a local var for old tag rather than get compiler warnings
    related to using deprecated value.
  - Added new element tag for null schedule case.

M java/com/google/enterprise/connector/servlet/ServletUtil.java:
  - Deprecated the tag that should no longer be used.

M java/com/google/enterprise/connector/importexport/ImportExport.java:
  - Switched over to new tag since no-one seems to be using this feature right
    now.  If this causes migration problems related to old exports we can add an
    XLST transform to convert.

A Added tests.
------------------------------------------------------------------------

Original comment by mgron...@gmail.com on 14 Aug 2009 at 10:05

GoogleCodeExporter commented 8 years ago
Docs note: No SPI or documentation requirements related to this Issue.  It's 
internal
only.  ServletUtil is part of the connector-util.jar file so it it's used then
deprecation warnings appearing in the using code should not be ignored.

Original comment by mgron...@gmail.com on 14 Aug 2009 at 10:08

GoogleCodeExporter commented 8 years ago

Original comment by jla...@google.com on 9 Dec 2010 at 10:31