ddavisqa / google-refine

Automatically exported from code.google.com/p/google-refine
0 stars 0 forks source link

Request: setting Jetty user agent to something including 'Refine' #379

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
It'd be nice to be able to do some content negotiation based on who's asking.

Specifically right now, I'm producing XLS files with hyperlinks in them, which 
Refine isn't doing anything useful with (they appear as blank cells; arguably a 
bug). If I could detect an HTTP request reliably from Refine I could spit out 
non-hyperlinked data.

Original issue reported on code.google.com by paulm%pa...@gtempaccount.com on 11 May 2011 at 6:18

GoogleCodeExporter commented 8 years ago
that last line made my head spin a bit, Paul.  What are you trying to do again 
?  Put it in layman's terms for me, I'm an idiot.

Original comment by thadguidry on 11 May 2011 at 6:23

GoogleCodeExporter commented 8 years ago
It's possible to have links in XLS documents, so if you single-click a cell, 
it'll open in a web browser. To do this, enter a formula in the cell like,

=HYPERLINK("http://10.0.0.22:8000/gallery/:507";"view 507")

Refine doesn't show either http://10.0.0.22:8000/gallery/:507 or view 507 :(

Now, in my appserver's that's producing the XLS: if I could look at the HTTP 
headers and look at the user-agent string,

        if 'Java' in request.META.get('HTTP_USER_AGENT', ''):
            self.use_hyperlinks = False

Refine uses Jetty as its appserver and its user agent string is simply 
"Java/1.6.0_24"

Hope that makes more sense :)

Original comment by paulm%pa...@gtempaccount.com on 11 May 2011 at 6:46

GoogleCodeExporter commented 8 years ago
Just for extra clarification, where Refine is making HTTP requests for XLS is 
via the Create Project -> "or data file URL:"

Original comment by paulm%pa...@gtempaccount.com on 11 May 2011 at 6:50

GoogleCodeExporter commented 8 years ago
Hmm, Tom your thoughts on the data file URL method ?

As a related or separate issue, I THINK that the export function To Excel that 
uses POI should be OK for Hyperlink cells btw, but I am not sure if we even 
tested that, probably need to now also: 
http://poi.apache.org/apidocs/org/apache/poi/ss/formula/functions/Hyperlink.html

Original comment by thadguidry on 11 May 2011 at 7:41

GoogleCodeExporter commented 8 years ago
That seems like a reasonable request.  I suspect there are other cases where it 
would be useful to have the server's requests (when it's acting as a user 
agent/broker) be identifiable.

p.s. dropping links (or any content) on import is *definitely* a bug.  Please 
open a separate bug report for it.

Original comment by tfmorris on 11 May 2011 at 9:31