GettingStartedWebappExercises > Answers
Configuring your webapp with properties files
- On the Pathway report page, create link to the KEGG page for that pathway.
- Add an entry to web.properties
- The imageName is KEGG_logo_mini.gif and the image is already in the correct location
- Set Pathway.name field to autocomplete on the template form and in the QueryBuilder.
- Add a KEGG pathway displayer to the gene report page.
- Add a pathway table widget to the gene list analysis page.
- In the QueryBuilder, when you click on the SUMMARY button next to the Pathway class, nothing happens. Update the properties file so that Pathway.identifier and Pathway.name are added to the view list when you click on the SUMMARY button. (Hint: webconfig-model.xml)
- When the Pathway.identifier and Pathway.name fields appear on the results page, the fields are not links. Make those fields links to their report page. (Hint: class_keys.properties)
- Update the examples displayed in the search box in the top menu bar with an example gene identifier, list name and template keyword. (Hint: web.properties)
- Update the example identifiers added by the "click to see an example" link on the list upload page. (Hint: web.properties)
Working as the SuperUser
- Build a template to find gene from a pathway (Pathway --> Genes)
- Build a query
- Click on the QueryBuilder tab on the top menu bar
- Select the pathway class and click the select button.
- Add columns to the query output (the blue boxes)
- In the Model Browser section (top left), click on the dark blue SHOW button next to the Pathway fields identifier and name.
- In the Model Browser section (top left), click on the blue SUMMARY button next to the genes collection.
- Add a filter to the query
- In the Model Browser section (top left), click on the brown CONSTRAIN button next to the Pathway.name field.
- This will open the constraint form in a panel on the right of the screen.
- Enter a Pathway (eg. Carbon fixation) and click on the 'Add to query' button.
- Change to template-building mode
- Verify that you are logged in as the SuperUser (admin mode)
- Click the button "Start building a template query" that appears below the output section
- Update the template's name, title and description and then click the 'Update settings' button.
- Make the constraint editable
- When in template building mode, constraints listed at the top-right gain an extra icon - a little padlock. The closed padlock means that the constraint is locked and not editable in a template query.
- Click the padlock, which will bring up the settings for that constraint.
- Check the editable checkbox and click the 'Add to query' button
- Save the template
- Scroll down to the bottom of the page to the 'Building a new template query' section
- You'll see a preview of your template
- Click on the 'Save template' button below the preview to save your template.
- Build a query
- Build a template to find a pathway from a gene (Gene --> Pathways)
- Build a template that shows genes and their assigned KEGG pathways for a specified GO term. (GO term --> Pathways) Try:
- using a wildcard, eg. "*cell activation"
- changing the sort order
- adding another constraint
- Tag a template so that it would be viewable under the templates tab to all users of your webapp.
- Verify that you are logged in as the super user
- Navigate to the Templates page in the MyMine? section of the webapp.
- Click on the “MyMine?” tab in the top menu bar
- Click on the “Saved Templates” link in the submenu bar (the green bar directly below the tabs)
- This page lists all of the templates you have saved.
- Add the “im:public” tag to a template.
1.The second column is the name of the template. Underneath the template are all of the tags for each template. 2.Click on the “Add tags” link under the name of a template. 3.Click on the “New tag” link. 4.Type in the tag name, im:public. 5.Click the “Add” button. 6.Click the “Log out” button in the top right corner of the webpage 7.Click on the “Templates” tab in the top menu bar. 8.Verify that your template appears in the list.
- Add the one of the templates you created to the front page.
- Verify that you are logged in as the super user
- Navigate to the Templates page in the MyMine? section of the webapp.
1.Click on the “MyMine?” tab in the top menu bar 2.Click on the “Saved Templates” link in the submenu bar (the green bar directly below the tabs) 3.This page lists all of the templates you have saved.
- Add the “im:frontpage” tag to a template.
1.The second column is the name of the template. Underneath the template are all of the tags for each template. 2.Click on the “Add tags” link under the name of a template. 3.Click on the “New tag” link. 4.Type in the tag name, im:frontpage. 5.Click the “Add” button. 6.Click on the “Home” tab in the top menu bar 7.Verify that your template appears on the home page.
- Create a list and add it to front page.
- Create a list
1.There are several ways to create a list, this is just one method. 2.Navigate to the list upload page by clicking on the “Lists” tab and then clicking on the “Upload” link in the submenu bar (the black bar immediately below the tabs). 3.Copy and paste a list of identifiers into the list upload form. Try these: gene.36435, OAT, TR, PFF1155w, PF13_0100, MAL1P1.20 4.Click the “Create List” button at the bottom of the form 5.Enter a list name on the list confirmation form. 6.Click on save list. You will be redirected to the list analysis page for the list you just created.
- Tag list with “im:frontpage”
1.Navigate back to MyMine? by clicking on the MyMine? tab in the top menu bar 2.Click on the “Lists” link in the submenu bar (the green bar directly below the tabs) 3.This page displays all lists you've created. The second column in the table are the list names. 4.Click on the “Add tags” link beneath the name of a list. 5.Click on the dropdown and select the tag “im:frontpage”. If that tag is not present in the dropdown, click on the “New tag” link and enter “im:frontpage” in the form field. 6.Click the “Add” button. 7.To make the list viewable to all users (not just the super user), repeat the above steps for the “im:public” tag.
- Add the Protein.features collection to the "Summary" section of the Protein report page .
- Navigate to a protein report page.
1.There are several ways to do this, eg. Do a quick search using an identifier like P62368. 2.Scroll down to the bottom section of the page, “Further Information by Category”.
- Tag the features collection with the “im:summary” tag.
1.Click on the “expand all” link next to the “Further Information by Category“ title on the gray bar. 2.Click on the “Add tags” link to the right of the features collection. 3.Select “im:summary” from the dropdown. If “im:summary” is not listed in the dropdown, click on the New tag link and enter “im:summary” in the form field. 4.Click the “Add” button.
- Refresh the page to view your changes.
- Configuring your webapp with properties files
NOTE: After you update a properties file, you have to re-release your webapp for the changes to take effect.
10.1 In the QueryBuilder, when you click on the SUMMARY button next to the Pathway class, nothing happens. Update the properties file so that Pathway.identifier and Pathway.name are added to the view list when you click on the SUMMARY button. (Hint: webconfig-model.xml)
- Add an entry to malariamine/webapp/resources/webapp/WEB-INF/webconfig-model.xml
1.Open webconfig-model.xml in a text editor 2.Add the following to that file:
<class className="org.flymine.model.genomic.Pathway">
<fields>
<fieldconfig fieldExpr="identifier" /> <fieldconfig fieldExpr="name" />
</fields>
</class>
3.Be sure you add the entry between the <webconfig> tags, like so:
<webconfig>
<class className="org.flymine.model.genomic.Pathway">
<fields>
<fieldconfig fieldExpr="identifier" /> <fieldconfig fieldExpr="name" />
</fields>
</class>
<!-- other configuration entries --> </webconfig>
- Re-release your webapp
# in malariamine/webapp ant default remove-webapp release-webapp
- Verify your changes in the QueryBuilder.
1.Click on the QueryBuilder tab, select Pathway from the list of classes. 2.Click on the SUMMARY button next to the Pathway class. 3.Check that Pathway.identifier and Pathway.name have been added to your query.
10.2 When the Pathway.identifier field appears on the results page, it's not a link. Make those fields links to their report page. (Hint: update class_keys.properties)
- Add the Pathway class to the class_keys.properties file. Set "identifier" as the key for that class.
# in malariamine /dbmodel/resources/class_keys.properties Pathway = identifier
- Re-release your webapp by running this command:
# malariamine/webapp ant default remove-webapp release-webapp
10.3 Update the examples displayed in the search box in the top menu bar with an example gene identifier, list name and template keyword (hint: update web.properties)
- Update entries in malariamine/webapp/resources/web.properties
Change the values for these three entries in web.properties:
# quicksearch examples quickSearch.identifiers = e.g example identifier quickSearch.templates = e.g. example template name quickSearch.lists = e.g. example list name
- Re-release your webapp
# in malariamine/webapp ant default remove-webapp release-webapp
- Verify your changes
Check that the new values you added to the properties file are displayed in the Quicksearch
10.4 Update the example identifiers added by the "click to see an example" link on the list upload page
- Update the list upload example in malariamine/webapp/resources/web.properties
# list upload example gene.36435, OAT, TR, PFF1155w, PF13_0100, MAL1P1.20
- Re-release your webapp
# in malariamine/webapp ant default remove-webapp release-webapp
- Verify your changes
Check that when you click on “click to see an example” link on list upload page, your new example identifiers are added to the list upload form.
10.5 On the Protein report page, create a link to the UniProt page for that protein
- Add properties to web.properties
attributelink.uniProt.Protein.*.primaryIdentifier.url= http://www.uniprot.org/entry/<<attributeValue>> attributelink.uniProt.Protein.*.primaryIdentifier.text=uniprot: <<attributeValue>> attributelink.uniProt.Protein.*.primaryIdentifier.imageName=uniprot_logo_link.jpeg
- Re-release your webapp
- Verify your changes by viewing the link on a protein report page
10.6 On the Pathway report page, create link to the KEGG page for that pathway
- Add properties to web.properties
attributelink.KEGG.Pathway.*.identifier.url= http://www.genome.jp/dbget-bin/show_pathway?pfa<<attributeValue>> attributelink.KEGG.Pathway.*.identifier.text=KEGG: <<attributeValue>> attributelink.KEGG.Pathway.*.identifier.imageName=KEGG_logo_mini.gif
- Add to pathway entry in webconfig-model
<class className="org.flymine.model.genomic.Pathway">
<fields>
<fieldconfig fieldExpr="identifier" /> <fieldconfig fieldExpr="name" />
</fields> <!-- add to use linkouts --> <longdisplayers>
<displayer src="attributeLinkDisplayer.tile"/>
</longdisplayers>
</class>
- Re-release your webapp
- Verify your changes by viewing the link on a pathway report page
- Set Pathway.name field to autocomplete on the template form and in the QueryBuilder.
- Add this entry to malariamine/dbmodel/resources/objectstoresummary.config.properties:
org.flymine.model.genomic.Pathway.autocomplete = name
- Run post-process to add autocomplete index to database:
# in malariamine/postprocess ant -v -Daction=create-autocomplete-index
- Add this entry to malariamine/dbmodel/resources/objectstoresummary.config.properties:
Widgets
<bagtabledisplayer id="kegg" title="Pathway Information (KEGG)"
pathStrings="Gene.pathways" description="Most common pathways for this list." typeClass="org.flymine.model.genomic.Gene" displayFields="identifier,name" exportField="primaryIdentifier" externalLink=" http://www.genome.jp/dbget-bin/www_bget?pathway+pfa" externalLinkLabel="KEGG" />
- Pathway displayer
- link to kegg, eg http://www.genome.jp/kegg-bin/show_pathway?pfa00030+PF13_0143
- create JSP file, keggDisplayer.jsp
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <!-- keggDisplayer.jsp --> <c:if test="${!empty object.pathways}"> <h3>Pathways</h3> <ul> <c:forEach items="${object.pathways}" var="item"> <li><a href="http://www.genome.jp/kegg-bin/show_pathway?pfa${item.identifier}+${object.primaryIdentifier}" target="_new">${item.identifier}</a></li> </c:forEach> </ul> </c:if> <!-- keggDisplayer.jsp --> - update Gene entry in webconfig file
- create JSP file, keggDisplayer.jsp
- link to kegg, eg http://www.genome.jp/kegg-bin/show_pathway?pfa00030+PF13_0143
