[InterMine Dev] Access to the `imtables` object in an aspects page

Yo Yehudi yoyehudi at gmail.com
Thu Jul 21 11:09:21 BST 2016


Hey Vivek,

Looks like there are a few ingredients needed for the IMTables recipe:

1. The URLs for the scripts and styles are specified under the
"head.js.results" and "head.css.results" section of the
global.web.properties file -
https://github.com/intermine/intermine/blob/dev/intermine/webapp/main/resources/webapp/WEB-INF/global.web.properties#L111-L112

2. in htmlHead.jsp there is a loop which outputs all required scripts
https://github.com/intermine/intermine/blob/dev/intermine/webapp/main/resources/webapp/htmlHead.jsp#L31-L33
- the highlighted lines are the lines for the report page, where it links
to all head.x.results items specified in the properties files.

So:

I just tried adding "|| pageName == 'aspect'" to line 31 of htmlHead, and
after a redeploy I can see that imtables is available on the aspect page. I
imagine this approach should work for any other page.

Small note: global.web.properties has several other non-imtables scripts in
the results section. I'm not honestly sure if they're all strictly
necessary for loading imtables or not (perhaps some advanced bits?). With
some experimentation it might be possible to load a more minimal subset of
the results scripts, by adding an entry to your global.web.properties,
perhaps something like

head.js.imtables.script = CDN/js/intermine/im-tables/2.0.0/imtables.js
head.css.imtables.style =
CDN/js/intermine/im-tables/2.0.0/main.sandboxed.css

and then a new section in htmlHead.jsp like this:

  <c:if test="${pageName == 'myAwesomePage' || pageName ==
'someOtherCoolPage'}">
    <im:headResources section="imtables"/>
  </c:if>

But if you took this approach you'd probably have to test carefully to
verify that the other head.js.results scripts are not needed!

Hope that helps and let me know if anything was unclear.

Yo Yehudi
InterMine

On 20 July 2016 at 23:27, Krishnakumar, Vivek <vkrishna at jcvi.org> wrote:

> Hello IM Devs,
>
> I am trying to understand how the `imtables` javascript object is
> initialized and made available in the scope of the current InterMine
> window. As far as I can see, it seems that the `imtables` js object is
> active on report and results pages.
>
> I was wondering how I can access the `imtables` Javascript object from any
> different page, such as aspects page (Example:
> /XYZmine/aspect.do?name=Genomics).
>
> Any input/pointers you can provide is appreciated!
>
> Thank you.
>
> Regards,
> Vivek
>
> _______________________________________________
> dev mailing list
> dev at lists.intermine.org
> https://lists.intermine.org/mailman/listinfo/dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.intermine.org/pipermail/dev/attachments/20160721/4a50eccb/attachment.html>


More information about the dev mailing list