You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrp4j-dev@portals.apache.org by "Ricky Frost (JIRA)" <ws...@ws.apache.org> on 2004/11/12 18:47:23 UTC

[jira] Created: (WSRP4J-40) The consumer.driver.PortletDriverImpl doesn't forward the browser's userAgent (or locales) on the outbound request

The consumer.driver.PortletDriverImpl doesn't forward the browser's userAgent (or locales) on the outbound request
------------------------------------------------------------------------------------------------------------------

         Key: WSRP4J-40
         URL: http://nagoya.apache.org/jira/browse/WSRP4J-40
     Project: WSRP4J
        Type: Bug
  Components: Consumer  
    Versions: current (nightly)    
 Environment: Tomcat 4.1.30, Win XP, etc
    Reporter: Ricky Frost


I used the proxyportlet to replicate the problem. Requests built using the code above ends up having a compile time fixed string for the userAgent (and locales) in all outbound WSRP requests. That means the producer can not generate client specific markup because it doesn't have the client's data...

Here is the before and after of the first few lines of PortletDriverImpl.getMarkupParams:

Before:

MarkupParams markupParams = new MarkupParams();
ClientData clientData = new ClientData();

// lets just set this to the consumer agent for now
clientData.setUserAgent(producer.getRegistrationData().getConsumerAgent());
markupParams.setClientData(clientData);
markupParams.setSecureClientCommunication(false);
markupParams.setLocales(consumerEnv.getSupportedLocales());


After:

MarkupParams markupParams = new MarkupParams();
ClientData reqClientData = request.getClientData();
if( reqClientData != null )
    markupParams.setClientData( reqClientData );
else
{
    // fallback to the consumer agent only if the browser data isn't available
    ClientData clientData = new ClientData();
    clientData.setUserAgent(producer.getRegistrationData().getConsumerAgent());
    markupParams.setClientData(clientData);
}
markupParams.setSecureClientCommunication(false);
markupParams.setLocales( request.getLocales() );
markupParams.setMimeTypes(consumerEnv.getMimeTypes());


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (WSRP4J-40) The consumer.driver.PortletDriverImpl doesn't forward the browser's userAgent (or locales) on the outbound request

Posted by "Mikhail Melamud (JIRA)" <ws...@ws.apache.org>.
     [ http://nagoya.apache.org/jira/browse/WSRP4J-40?page=comments#action_55487 ]
     
Mikhail Melamud commented on WSRP4J-40:
---------------------------------------

I think, you're correctly identified the issue in current implementation. But here is the question:
should End-User's specified locales be used here without any correlation with Consumer configured supported locales? What if it is 2 completely different sets, should Consumer fail such request even before it comes to a Producer? Should a Consumer try to find best matches among supported locales and call
markupParams.setLocales() only for those found ones?

> The consumer.driver.PortletDriverImpl doesn't forward the browser's userAgent (or locales) on the outbound request
> ------------------------------------------------------------------------------------------------------------------
>
>          Key: WSRP4J-40
>          URL: http://nagoya.apache.org/jira/browse/WSRP4J-40
>      Project: WSRP4J
>         Type: Bug
>   Components: Consumer
>     Versions: current (nightly)
>  Environment: Tomcat 4.1.30, Win XP, etc
>     Reporter: Ricky Frost

>
> I used the proxyportlet to replicate the problem. Requests built using the code above ends up having a compile time fixed string for the userAgent (and locales) in all outbound WSRP requests. That means the producer can not generate client specific markup because it doesn't have the client's data...
> Here is the before and after of the first few lines of PortletDriverImpl.getMarkupParams:
> Before:
> MarkupParams markupParams = new MarkupParams();
> ClientData clientData = new ClientData();
> // lets just set this to the consumer agent for now
> clientData.setUserAgent(producer.getRegistrationData().getConsumerAgent());
> markupParams.setClientData(clientData);
> markupParams.setSecureClientCommunication(false);
> markupParams.setLocales(consumerEnv.getSupportedLocales());
> After:
> MarkupParams markupParams = new MarkupParams();
> ClientData reqClientData = request.getClientData();
> if( reqClientData != null )
>     markupParams.setClientData( reqClientData );
> else
> {
>     // fallback to the consumer agent only if the browser data isn't available
>     ClientData clientData = new ClientData();
>     clientData.setUserAgent(producer.getRegistrationData().getConsumerAgent());
>     markupParams.setClientData(clientData);
> }
> markupParams.setSecureClientCommunication(false);
> markupParams.setLocales( request.getLocales() );
> markupParams.setMimeTypes(consumerEnv.getMimeTypes());

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (WSRP4J-40) The consumer.driver.PortletDriverImpl doesn't forward the browser's userAgent (or locales) on the outbound request

Posted by "Ricky Frost (JIRA)" <ws...@ws.apache.org>.
     [ http://nagoya.apache.org/jira/browse/WSRP4J-40?page=comments#action_55499 ]
     
Ricky Frost commented on WSRP4J-40:
-----------------------------------

I thought about that too... Ask yourself this question:

What is the value of the consumer supporting french (for example) When the consumer is an Italian user of an Italian application/producer?

The consumer is in that case a simple (and expensive) http proxy of the producer application...

What does it mean that the consumer "supports" a locale? Isn't it just for the portlet descriptions? So what if the title is in french (or english). Isn't it better to get the markup in the most preferable one on the browser request? Why filter it on the consumer restrictions? The consumer won't "process" the markup in any way... In fact if templates are used, the consumer won't even touch it...

Do you see my point?

> The consumer.driver.PortletDriverImpl doesn't forward the browser's userAgent (or locales) on the outbound request
> ------------------------------------------------------------------------------------------------------------------
>
>          Key: WSRP4J-40
>          URL: http://nagoya.apache.org/jira/browse/WSRP4J-40
>      Project: WSRP4J
>         Type: Bug
>   Components: Consumer
>     Versions: current (nightly)
>  Environment: Tomcat 4.1.30, Win XP, etc
>     Reporter: Ricky Frost

>
> I used the proxyportlet to replicate the problem. Requests built using the code above ends up having a compile time fixed string for the userAgent (and locales) in all outbound WSRP requests. That means the producer can not generate client specific markup because it doesn't have the client's data...
> Here is the before and after of the first few lines of PortletDriverImpl.getMarkupParams:
> Before:
> MarkupParams markupParams = new MarkupParams();
> ClientData clientData = new ClientData();
> // lets just set this to the consumer agent for now
> clientData.setUserAgent(producer.getRegistrationData().getConsumerAgent());
> markupParams.setClientData(clientData);
> markupParams.setSecureClientCommunication(false);
> markupParams.setLocales(consumerEnv.getSupportedLocales());
> After:
> MarkupParams markupParams = new MarkupParams();
> ClientData reqClientData = request.getClientData();
> if( reqClientData != null )
>     markupParams.setClientData( reqClientData );
> else
> {
>     // fallback to the consumer agent only if the browser data isn't available
>     ClientData clientData = new ClientData();
>     clientData.setUserAgent(producer.getRegistrationData().getConsumerAgent());
>     markupParams.setClientData(clientData);
> }
> markupParams.setSecureClientCommunication(false);
> markupParams.setLocales( request.getLocales() );
> markupParams.setMimeTypes(consumerEnv.getMimeTypes());

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (WSRP4J-40) The consumer.driver.PortletDriverImpl doesn't forward the browser's userAgent (or locales) on the outbound request

Posted by "Ricky Frost (JIRA)" <ws...@ws.apache.org>.
     [ http://nagoya.apache.org/jira/browse/WSRP4J-40?page=comments#action_55501 ]
     
Ricky Frost commented on WSRP4J-40:
-----------------------------------

I meant to say: when the "client" is an Italian user...

> The consumer.driver.PortletDriverImpl doesn't forward the browser's userAgent (or locales) on the outbound request
> ------------------------------------------------------------------------------------------------------------------
>
>          Key: WSRP4J-40
>          URL: http://nagoya.apache.org/jira/browse/WSRP4J-40
>      Project: WSRP4J
>         Type: Bug
>   Components: Consumer
>     Versions: current (nightly)
>  Environment: Tomcat 4.1.30, Win XP, etc
>     Reporter: Ricky Frost

>
> I used the proxyportlet to replicate the problem. Requests built using the code above ends up having a compile time fixed string for the userAgent (and locales) in all outbound WSRP requests. That means the producer can not generate client specific markup because it doesn't have the client's data...
> Here is the before and after of the first few lines of PortletDriverImpl.getMarkupParams:
> Before:
> MarkupParams markupParams = new MarkupParams();
> ClientData clientData = new ClientData();
> // lets just set this to the consumer agent for now
> clientData.setUserAgent(producer.getRegistrationData().getConsumerAgent());
> markupParams.setClientData(clientData);
> markupParams.setSecureClientCommunication(false);
> markupParams.setLocales(consumerEnv.getSupportedLocales());
> After:
> MarkupParams markupParams = new MarkupParams();
> ClientData reqClientData = request.getClientData();
> if( reqClientData != null )
>     markupParams.setClientData( reqClientData );
> else
> {
>     // fallback to the consumer agent only if the browser data isn't available
>     ClientData clientData = new ClientData();
>     clientData.setUserAgent(producer.getRegistrationData().getConsumerAgent());
>     markupParams.setClientData(clientData);
> }
> markupParams.setSecureClientCommunication(false);
> markupParams.setLocales( request.getLocales() );
> markupParams.setMimeTypes(consumerEnv.getMimeTypes());

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira