Anyway to build local Google jsapi?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Anyway to build local Google jsapi?

朱涛
Dear colleagues,

I have built an InterMine app on my local server. It runs rather well and quickly when I setting up my own Content Delivery Network following the instructions in http://intermine.readthedocs.org/en/latest/webapp/performance/ . The only pity is that my InterMine app keep connecting with https://www.google.com/jsapi every time page freshes, which takes more than several thousand milliseconds! As in my country Google service was nearly unreachable, I hope to store Google jsapi on local servers just like the methods on building local CDN. Is it possible to do so? Hope to your help. Thank you!

_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Anyway to build local Google jsapi?

Justin Clark-Casey
I haven't looked at this area before, but I believe you can change this by overriding the head.js.all.L property.  If you look in the
intermine/webapp/main/resources/webapp/WEB-INF/global.web.properties file you'll see the entry

head.js.all.L = https://www.google.com/jsapi

where it looks like all head.js.all.* properties are being included in every webpage.  Rather than changing this file, you can override the setting by adding

head.js.all.L = <my-local-url>

to your <mine>/webapp/resources/web.properties file and then rebuilding the webapp and redeploying.

On a quick search the track.jsp page also contains a direct reference to jsapi which might be a bug as I would expect it to be already present via
head.js.all.L.  However, I think this page is only used for looking at user activity (?) so shouldn't be such a problem.

I don't know why this file isn't already being served out of the CDN or locally like the others.  Perhaps one of the other developers can shed some light on this.

--
Justin Clark-Casey, Synbiomine/InterMine Software Developer
http://synbiomine.org
http://twitter.com/justincc

On 28/09/15 15:22, 朱涛 wrote:

> Dear colleagues,
>
> I have built an InterMine app on my local server. It runs rather well and quickly when I setting up my own Content Delivery Network following the instructions
> in http://intermine.readthedocs.org/en/latest/webapp/performance/ <http://intermine.readthedocs.org/en/latest/webapp/performance/.> . The only pity is that
> my InterMine app keep connecting with https://www.google.com/jsapi every time page freshes, which takes more than several thousand milliseconds! As in my
> country Google service was nearly unreachable, I hope to store Google jsapi on local servers just like the methods on building local CDN. Is it possible to do
> so? Hope to your help. Thank you!
>
>
> _______________________________________________
> dev mailing list
> [hidden email]
> http://mail.intermine.org/cgi-bin/mailman/listinfo/dev
>

_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Anyway to build local Google jsapi?

Josh Heimbach
Justin is exactly right, you'll want to copy the script at www.google.com/jsapi to your CDN. Then edit:
<yourmine>/webapp/resources/web.properties
and add the line:
head.js.all.L = CDN/path/to/your/file/jsapi
If the path begins with "CDN" then Intermine will look for the script on your locally hosted CDN.

We'll look into the direct reference to the google script inside track.jsp. There's a good chance this can be configured to use the CDN as well.

Regards,
Josh


On 28/09/15 16:08, Justin Clark-Casey wrote:
I haven't looked at this area before, but I believe you can change this by overriding the head.js.all.L property.  If you look in the intermine/webapp/main/resources/webapp/WEB-INF/global.web.properties file you'll see the entry

head.js.all.L = https://www.google.com/jsapi

where it looks like all head.js.all.* properties are being included in every webpage.  Rather than changing this file, you can override the setting by adding

head.js.all.L = <my-local-url>

to your <mine>/webapp/resources/web.properties file and then rebuilding the webapp and redeploying.

On a quick search the track.jsp page also contains a direct reference to jsapi which might be a bug as I would expect it to be already present via head.js.all.L.  However, I think this page is only used for looking at user activity (?) so shouldn't be such a problem.

I don't know why this file isn't already being served out of the CDN or locally like the others.  Perhaps one of the other developers can shed some light on this.

--
Justin Clark-Casey, Synbiomine/InterMine Software Developer
http://synbiomine.org
http://twitter.com/justincc

On 28/09/15 15:22, 朱涛 wrote:
Dear colleagues,

I have built an InterMine app on my local server. It runs rather well and quickly when I setting up my own Content Delivery Network following the instructions
in http://intermine.readthedocs.org/en/latest/webapp/performance/ <http://intermine.readthedocs.org/en/latest/webapp/performance/.> . The only pity is that
my InterMine app keep connecting with https://www.google.com/jsapi every time page freshes, which takes more than several thousand milliseconds! As in my
country Google service was nearly unreachable, I hope to store Google jsapi on local servers just like the methods on building local CDN. Is it possible to do
so? Hope to your help. Thank you!


_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev


_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev


_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Anyway to build local Google jsapi?

Josh Heimbach
It looks like we spoke too soon. Yo, one of the developers here at Intermine, discovered that hosting your own copy of jsapi violates Google's Terms of Service:

https://developers.google.com/chart/interactive/faq?csw=1#offline


While the solution posted below might work, we can't legally recommend it. You'll need to continue referencing the file via Google to remain compliant.

According to Google's documention the jsapi loader is cached in the browser for up to an hour. Are you experiencing the problem every hour or every time you refresh the page within the hour?

Regards,
Josh

On 28/09/15 16:23, Josh Heimbach wrote:
Justin is exactly right, you'll want to copy the script at www.google.com/jsapi to your CDN. Then edit:
<yourmine>/webapp/resources/web.properties
and add the line:
head.js.all.L = CDN/path/to/your/file/jsapi
If the path begins with "CDN" then Intermine will look for the script on your locally hosted CDN.

We'll look into the direct reference to the google script inside track.jsp. There's a good chance this can be configured to use the CDN as well.

Regards,
Josh


On 28/09/15 16:08, Justin Clark-Casey wrote:
I haven't looked at this area before, but I believe you can change this by overriding the head.js.all.L property.  If you look in the intermine/webapp/main/resources/webapp/WEB-INF/global.web.properties file you'll see the entry

head.js.all.L = https://www.google.com/jsapi

where it looks like all head.js.all.* properties are being included in every webpage.  Rather than changing this file, you can override the setting by adding

head.js.all.L = <my-local-url>

to your <mine>/webapp/resources/web.properties file and then rebuilding the webapp and redeploying.

On a quick search the track.jsp page also contains a direct reference to jsapi which might be a bug as I would expect it to be already present via head.js.all.L.  However, I think this page is only used for looking at user activity (?) so shouldn't be such a problem.

I don't know why this file isn't already being served out of the CDN or locally like the others.  Perhaps one of the other developers can shed some light on this.

--
Justin Clark-Casey, Synbiomine/InterMine Software Developer
http://synbiomine.org
http://twitter.com/justincc

On 28/09/15 15:22, 朱涛 wrote:
Dear colleagues,

I have built an InterMine app on my local server. It runs rather well and quickly when I setting up my own Content Delivery Network following the instructions
in http://intermine.readthedocs.org/en/latest/webapp/performance/ <http://intermine.readthedocs.org/en/latest/webapp/performance/.> . The only pity is that
my InterMine app keep connecting with https://www.google.com/jsapi every time page freshes, which takes more than several thousand milliseconds! As in my
country Google service was nearly unreachable, I hope to store Google jsapi on local servers just like the methods on building local CDN. Is it possible to do
so? Hope to your help. Thank you!


_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev


_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev



_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Anyway to build local Google jsapi?

朱涛
I'm sorry I haven't do this detailed examination (whether it cached once an hour).  The method shown by Justin works well. Thank you for your help. 

I wander how important this Google jsapi is for regular use/runing of InterMine app. Hope it doesn't matter much?


Tao Zhu
Biotechnology Research Institute, Chinese Academy of Agricultural Sciences
Telephone: 86-10-82106127
 
Date: 2015-09-28 23:44
Subject: Re: [InterMine Dev] Anyway to build local Google jsapi?
It looks like we spoke too soon. Yo, one of the developers here at Intermine, discovered that hosting your own copy of jsapi violates Google's Terms of Service:

https://developers.google.com/chart/interactive/faq?csw=1#offline


While the solution posted below might work, we can't legally recommend it. You'll need to continue referencing the file via Google to remain compliant.

According to Google's documention the jsapi loader is cached in the browser for up to an hour. Are you experiencing the problem every hour or every time you refresh the page within the hour?

Regards,
Josh

On 28/09/15 16:23, Josh Heimbach wrote:
Justin is exactly right, you'll want to copy the script at www.google.com/jsapi to your CDN. Then edit:
<yourmine>/webapp/resources/web.properties
and add the line:
head.js.all.L = CDN/path/to/your/file/jsapi
If the path begins with "CDN" then Intermine will look for the script on your locally hosted CDN.

We'll look into the direct reference to the google script inside track.jsp. There's a good chance this can be configured to use the CDN as well.

Regards,
Josh


On 28/09/15 16:08, Justin Clark-Casey wrote:
I haven't looked at this area before, but I believe you can change this by overriding the head.js.all.L property.  If you look in the intermine/webapp/main/resources/webapp/WEB-INF/global.web.properties file you'll see the entry

head.js.all.L = https://www.google.com/jsapi

where it looks like all head.js.all.* properties are being included in every webpage.  Rather than changing this file, you can override the setting by adding

head.js.all.L = <my-local-url>

to your <mine>/webapp/resources/web.properties file and then rebuilding the webapp and redeploying.

On a quick search the track.jsp page also contains a direct reference to jsapi which might be a bug as I would expect it to be already present via head.js.all.L.  However, I think this page is only used for looking at user activity (?) so shouldn't be such a problem.

I don't know why this file isn't already being served out of the CDN or locally like the others.  Perhaps one of the other developers can shed some light on this.

--
Justin Clark-Casey, Synbiomine/InterMine Software Developer
http://synbiomine.org
http://twitter.com/justincc

On 28/09/15 15:22, 朱涛 wrote:
Dear colleagues,

I have built an InterMine app on my local server. It runs rather well and quickly when I setting up my own Content Delivery Network following the instructions
in http://intermine.readthedocs.org/en/latest/webapp/performance/ <http://intermine.readthedocs.org/en/latest/webapp/performance/.> . The only pity is that
my InterMine app keep connecting with https://www.google.com/jsapi every time page freshes, which takes more than several thousand milliseconds! As in my
country Google service was nearly unreachable, I hope to store Google jsapi on local servers just like the methods on building local CDN. Is it possible to do
so? Hope to your help. Thank you!


_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev


_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev



_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Anyway to build local Google jsapi?

Justin Clark-Casey
As jsapi is a charting library I'm guessing it might be used anyway that charts are used.  I know charts can be generated in the report tables (clicking the
view column summary icon for any column) and in displaying user usage information.

--
Justin Clark-Casey, Synbiomine/InterMine Software Developer
http://synbiomine.org
http://twitter.com/justincc

On 29/09/15 03:36, 朱涛 wrote:

> I'm sorry I haven't do this detailed examination (whether it cached once an hour).  The method shown by Justin works well. Thank you for your help.
>
> I wander how important this Google jsapi is for regular use/runing of InterMine app. Hope it doesn't matter much?
>
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------
> Tao Zhu
> Biotechnology Research Institute, Chinese Academy of Agricultural Sciences
> Telephone: 86-10-82106127
> E-mail: [hidden email]
>
>     *From:* Josh Heimbach <mailto:[hidden email]>
>     *Date:* 2015-09-28 23:44
>     *To:* dev <mailto:[hidden email]>
>     *Subject:* Re: [InterMine Dev] Anyway to build local Google jsapi?
>     It looks like we spoke too soon. Yo, one of the developers here at Intermine, discovered that hosting your own copy of jsapi violates Google's Terms of Service:
>
>     https://developers.google.com/chart/interactive/faq?csw=1#offline
>
>     While the solution posted below might work, we can't legally recommend it. You'll need to continue referencing the file via Google to remain compliant.
>
>     According to Google's documention the jsapi loader is cached in the browser for up to an hour. Are you experiencing the problem every hour or every time you
>     refresh the page within the hour?
>
>     Regards,
>     Josh
>
>     On 28/09/15 16:23, Josh Heimbach wrote:
>>     Justin is exactly right, you'll want to copy the script at www.google.com/jsapito your CDN. Then edit:
>>
>>         <yourmine>/webapp/resources/web.properties
>>
>>     and add the line:
>>
>>         head.js.all.L = CDN/path/to/your/file/jsapi
>>
>>     If the path begins with "CDN" then Intermine will look for the script on your locally hosted CDN.
>>
>>     We'll look into the direct reference to the google script inside track.jsp. There's a good chance this can be configured to use the CDN as well.
>>
>>     Regards,
>>     Josh
>>
>>
>>     On 28/09/15 16:08, Justin Clark-Casey wrote:
>>>     I haven't looked at this area before, but I believe you can change this by overriding the head.js.all.L property.  If you look in the
>>>     intermine/webapp/main/resources/webapp/WEB-INF/global.web.properties file you'll see the entry
>>>
>>>     head.js.all.L = https://www.google.com/jsapi
>>>
>>>     where it looks like all head.js.all.* properties are being included in every webpage.  Rather than changing this file, you can override the setting by
>>>     adding
>>>
>>>     head.js.all.L = <my-local-url>
>>>
>>>     to your <mine>/webapp/resources/web.properties file and then rebuilding the webapp and redeploying.
>>>
>>>     On a quick search the track.jsp page also contains a direct reference to jsapi which might be a bug as I would expect it to be already present via
>>>     head.js.all.L.  However, I think this page is only used for looking at user activity (?) so shouldn't be such a problem.
>>>
>>>     I don't know why this file isn't already being served out of the CDN or locally like the others.  Perhaps one of the other developers can shed some light
>>>     on this.
>>>
>>>     --
>>>     Justin Clark-Casey, Synbiomine/InterMine Software Developer
>>>     http://synbiomine.org
>>>     http://twitter.com/justincc
>>>
>>>     On 28/09/15 15:22, 朱涛 wrote:
>>>>     Dear colleagues,
>>>>
>>>>     I have built an InterMine app on my local server. It runs rather well and quickly when I setting up my own Content Delivery Network following the
>>>>     instructions
>>>>     in http://intermine.readthedocs.org/en/latest/webapp/performance/ <http://intermine.readthedocs.org/en/latest/webapp/performance/.> . The only pity is that
>>>>     my InterMine app keep connecting with https://www.google.com/jsapi every time page freshes, which takes more than several thousand milliseconds! As in my
>>>>     country Google service was nearly unreachable, I hope to store Google jsapi on local servers just like the methods on building local CDN. Is it possible
>>>>     to do
>>>>     so? Hope to your help. Thank you!
>>>>
>>>>
>>>>     _______________________________________________
>>>>     dev mailing list
>>>>     [hidden email]
>>>>     http://mail.intermine.org/cgi-bin/mailman/listinfo/dev
>>>>
>>>
>>>     _______________________________________________
>>>     dev mailing list
>>>     [hidden email]
>>>     http://mail.intermine.org/cgi-bin/mailman/listinfo/dev
>>
>
>
>
> _______________________________________________
> dev mailing list
> [hidden email]
> http://mail.intermine.org/cgi-bin/mailman/listinfo/dev
>

_______________________________________________
dev mailing list
[hidden email]
http://mail.intermine.org/cgi-bin/mailman/listinfo/dev