FREEMAKER PAGES

47 views
Skip to first unread message

Pedro Moreo

unread,
Jul 9, 2018, 6:54:30 AM7/9/18
to VIVO Tech
Hello,

In other research area, we were trying to work with vivo standard front end.

According to that, we were reading the tutorial 

 https://wiki.duraspace.org/display/VIVODOC19x/Enriching+profile+pages+using+SPARQL+query+DataGetters 


but, we cannot find the files that we should modify neither what they are.

In addition, should we restart, rebuild or recompile VIVO after that kind of modifications?

thanks a lot.

Tim Worrall

unread,
Jul 11, 2018, 9:17:02 AM7/11/18
to vivo...@googlegroups.com
Pedro,

If you're trying to identify which Freemarker templates get loaded on a given page, use the Developer Panel. Go to the Site Admin page and click the the Activate Developer Panel link. An extra menu bar will appear below the banner. Click on that menu bar and you'll see the developer options. Select the "Insert HTML comments at start and end of templates" checkbox, then click Save Settings. After doing this, inspect the html source to see what templates are getting loaded. You'll see comments like this:
<!-- FM_BEGIN siteAdmin-advancedDataTools.ftl -->
. . .
<!-- FM_END siteAdmin-advancedDataTools.ftl -->
Tim

--
You received this message because you are subscribed to the Google Groups "VIVO Tech" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vivo-tech+...@googlegroups.com.
To post to this group, send email to vivo...@googlegroups.com.
Visit this group at https://groups.google.com/group/vivo-tech.
To view this discussion on the web visit https://groups.google.com/d/msgid/vivo-tech/3a9ab113-b82a-4f0e-943e-9dad7a7cf004%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pedro Moreo

unread,
Jul 11, 2018, 9:46:52 AM7/11/18
to VIVO Tech
Thanks Tim, 

we will try !

Huda J. Khan

unread,
Jul 11, 2018, 1:55:41 PM7/11/18
to vivo...@googlegroups.com

Hi Pedro,

Tim’s suggestion is a good way to start looking at which templates are being used in the pages you wish to modify. 

To answer the second question regarding rebuilding/redeploying, you need to redeploy the application if you’re using Steps 3-5 since there you need to define the data getter with the query you wish to execute and the association between the data getter and a particular class (in this case Academic Department).   

 

In step 6, Page Management allows for specifying the data getter query and associating the query with a particular template and page/URL for displaying results.  (The content type dropdown in the image should show “Sparql Query Results” for the sparql query data getters).  With Step 6, whether or not you need to redeploy depends on whether the freemarker template you wish to use to display your results is already deployed before you use Page Management to define the query and link the template to display the query results.   If you use Page Management but haven’t already deployed the template file you want to use, then you will have to redeploy after you have added the template, otherwise you should not have to.

 

For the example in Steps 3-5, you not only have to define the data getter query but also link it with a particular class, and that connection needs to be in an N3 file you have to define manually and is not something you can define using the current Page Management interface for defining Sparql Query pages. 

 

For the specific (or similar to) files in the example for Steps 3-5, you can look at the following:

a)       The RDF that defines connections between different classes and the “getResearchAreaDataGetter” (lines 15-21) as well as the query (lines 26-51) itself here: https://github.com/vivo-project/VIVO/blob/develop/home/src/main/resources/rdf/display/everytime/vivoOrganizationDataGetters.n3 . Query results are saved in a variable named “researchAreaResults” that are then made available to the templates linked to the class (in this case, organization).

b)      The page used to display organization info is here:

https://github.com/vivo-project/VIVO/blob/develop/webapp/src/main/webapp/templates/freemarker/body/individual/individual--foaf-organization.ftl

This incorporates https://github.com/vivo-project/VIVO/blob/develop/webapp/src/main/webapp/templates/freemarker/body/partials/individual/individual-affiliated-research-areas.ftl which references researchAreaResults and displays them. 

 

Freemarker template files are referenced just by name and not by full path in these examples.  If a matching template is found with that name, then that one is used. 

 

Tim and others who worked on the research areas example I linked to above, please feel free to correct any of this if need be.   vivoOrganizationDataGetters.n3 (linked above) has other examples of data getters as well.

 

Pedro, feel free to attend our developer call or reach out again and we can try to walk through more of this with you if need be.

 

Huda

 

From: vivo...@googlegroups.com <vivo...@googlegroups.com> On Behalf Of Pedro Moreo


Sent: Wednesday, July 11, 2018 9:47 AM
To: VIVO Tech <vivo...@googlegroups.com>

--

You received this message because you are subscribed to the Google Groups "VIVO Tech" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vivo-tech+...@googlegroups.com.
To post to this group, send email to vivo...@googlegroups.com.
Visit this group at https://groups.google.com/group/vivo-tech.

Pedro Moreo

unread,
Jul 12, 2018, 4:13:06 AM7/12/18
to VIVO Tech
Thanks a lot Huda,

here there is a lot of information to study. I will do it carefully!!


El lunes, 9 de julio de 2018, 12:54:30 (UTC+2), Pedro Moreo escribió:

Pedro Moreo

unread,
Oct 5, 2018, 5:30:06 AM10/5/18
to VIVO Tech
Thanks a lot to both of you, that was the error
Reply all
Reply to author
Forward
0 new messages