PILLUTLAAVINASH / google-enterprise-connector-manager

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

Language passed to ConnectorType may be null #40

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. In the GSA admin console, create a new connector instance, which will
call getConfigForm.
2. Submit the configuration form, which will call validateConfig.
3. Click Edit on the new connector instance, which will call
getPopulatedConfigForm.

What is the expected output? What do you see instead?

I expected to see a language value in all three cases. Instead, the value
passed to getConfigForm and validateConfig is "en", but the value passed to
getPopulatedConfigForm is null.

What version of the product are you using? On what operating system?

Connector Manager revision 292 on Windows XP. I don't know the GSA version
for the hosted GSA at 8.6.49.37, and I can't access the version manager.

Please provide any additional information below.

It seems like the language is generally coming from Lang request parameter.
Only GetConfigForm.doGet falls back to using ServletUtil.DEFAULT_LANGUAGE
if the request parameter is not present. In one case that eventually calls
getPopulatedConfigForm, the GetConnectorConfigToEdit servlet, the language
is explicitly null. I came up with the following call sequences. In each
case, when I get to the point where the language is set, I noted how it is
set in parentheses.

1. getConfigForm:

ProductionManager.getConfigForm
    GetConfigForm.doGet (Lang, or DEFAULT_LANGUAGE)
    SetConnectorConfig.doGet (Lang)

2. validateConfig:

InstanceMap.setConfig
    InstanceMap.createNewConnector
        InstanceMap.updateConnector
    InstanceMap.updateConnector
        SpringInstantiator.setConnectorConfig
            ProductionManager.setConnectorConfig
                SetConnectorConfigHandler.<init> (Lang)
                UpdateConnector.doPost (Lang)

3. getPopulatedConfigForm:

SpringInstantiator.getConfigFormForConnector
    ProductionManager.getConfigFormForConnector
        GetConnectorConfigToEdit.handleDoGet
            GetConnectorConfigToEdit.processDoGet
                ConnectorManagerGetServlet.doGet (null)
        UpdateConnector.handleDoGet
            UpdateConnector.doGet (Lang)

Original issue reported on code.google.com by jl1615@gmail.com on 20 Apr 2007 at 7:54

GoogleCodeExporter commented 8 years ago
I believe this is fixed.  The getPopulatedConfigForm takes a Locale and it's
currently set to the Locale.getDefault() so it's no longer null.

I'm going to leave this open for now because something strange is going on in 
the
ConnectorManagerGetServlet.doGet().  It pulls the Lang parameter from the 
request but
it doesn't seem to pass it onto the processDoGet() method.  For some reason the 
lang
parameter is explicitly set to null.

Original comment by mgron...@gmail.com on 4 Oct 2007 at 6:12

GoogleCodeExporter commented 8 years ago
Also tracked as internal Bug 948047.

Original comment by mgron...@gmail.com on 7 Dec 2007 at 7:44

GoogleCodeExporter commented 8 years ago
Fixed r707 | mgronber | 2007-12-07 13:37:34 -0800 (Fri, 07 Dec 2007)

Description:

Fix for Bug 948047 and Issue 40.

For some reason the ConnectorManagerGetServlet.doGet() method was ignoring the 
given
lang and passing null down to the processDoGet() abstract method.  This class is
specialized by 3 other classes.  For 2 of those classes this didn't matter 
because
they didn't return any locale specific resources.  However, the
GetConnectorConfigToEdit servlet does need this information or else it uses the
default locale.  Since the Connector Manager is running in a different 
environment
than the GSA this leads to problems.

The GSA does send the Lang attribute with the request to 
getConnectorConfigToEdit, so
this fix allows that attribute to be passed down to the
ConnectorType.getPopulatedConfigForm() SPI method.

Affected Paths:
   M
//trunk/projects/connector-manager/source/java/com/google/enterprise/connector/s
ervlet/ConnectorManagerGetServlet.java

Original comment by mgron...@gmail.com on 7 Dec 2007 at 9:44

GoogleCodeExporter commented 8 years ago

Original comment by mgron...@gmail.com on 19 Dec 2007 at 4:43