Class TemplateResultLinkGenerator


  • public class TemplateResultLinkGenerator
    extends LinkGeneratorBase
    Class that implements generating links of TemplateResultService web service.
    Author:
    Jakub Kulaviak
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEFAULT_RESULT_SIZE
      Default value of size parameter
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getError()  
      java.lang.String getHighlightedLink​(java.lang.String baseUrl, TemplateQuery template)
      Returns html formatted link in which are highlighted parameters that are to be replaced.
      java.lang.String getHtmlLink​(java.lang.String baseUrl, TemplateQuery template)
      Generates TemplateResultService web service link.
      java.lang.String getLinkPath​(TemplateQuery template)
      Returns the path section of the link for this template.
      java.lang.String getLinkPath​(TemplateQuery template, java.lang.String format)
      Returns the path section of the link for this template.
      java.lang.String getLinkPath​(TemplateQuery template, java.lang.String format, boolean highlighted)
      Returns the path section of the link for this template.
      java.lang.String getMineResultsLink​(java.lang.String baseUrl, TemplateQuery tq)
      Get a link that takes the user to a results page in the originating mine.
      java.lang.String getMineResultsPath​(TemplateQuery tq, boolean highlighted)
      Get a link that takes the user to a results page in the originating mine.
      java.lang.String getTabLink​(java.lang.String baseUrl, TemplateQuery template)
      Returns link which gives results as lines, where values are tab separated.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_RESULT_SIZE

        public static final int DEFAULT_RESULT_SIZE
        Default value of size parameter
        See Also:
        Constant Field Values
    • Constructor Detail

      • TemplateResultLinkGenerator

        public TemplateResultLinkGenerator()
    • Method Detail

      • getMineResultsLink

        public java.lang.String getMineResultsLink​(java.lang.String baseUrl,
                                                   TemplateQuery tq)
        Get a link that takes the user to a results page in the originating mine.
        Parameters:
        baseUrl - The mine's base URL.
        tq - The template.
        Returns:
        A URL.
      • getMineResultsPath

        public java.lang.String getMineResultsPath​(TemplateQuery tq,
                                                   boolean highlighted)
        Get a link that takes the user to a results page in the originating mine.
        Parameters:
        tq - The template.
        highlighted - Whether or not to highlight certain parameters.
        Returns:
        The path section of a URL.
      • getHtmlLink

        public java.lang.String getHtmlLink​(java.lang.String baseUrl,
                                            TemplateQuery template)
        Generates TemplateResultService web service link.
        Parameters:
        baseUrl - base url that doesn't terminate with '/' , e.g. http://www.flymine.org/release-12.0
        template - template for which the link is generated
        Returns:
        generated link
      • getTabLink

        public java.lang.String getTabLink​(java.lang.String baseUrl,
                                           TemplateQuery template)
        Returns link which gives results as lines, where values are tab separated.
        Parameters:
        baseUrl - base url
        template - template
        Returns:
        a url
        See Also:
        #getLink(String, TemplateQuery)
      • getLinkPath

        public java.lang.String getLinkPath​(TemplateQuery template)
        Returns the path section of the link for this template. When passing just the template, the format defaults to tab.
        Parameters:
        template - The template to get the link for.
        Returns:
        A string such that baseUrl + returnValue = a webservice query for this template
      • getLinkPath

        public java.lang.String getLinkPath​(TemplateQuery template,
                                            java.lang.String format)
        Returns the path section of the link for this template. The format parameter is set to the value of the format argument.
        Parameters:
        template - The template to get the link for.
        format - The output format to use (xml, jsonobjects, count, etc)
        Returns:
        A string such that baseUrl + returnValue = a webservice query for this template
      • getLinkPath

        public java.lang.String getLinkPath​(TemplateQuery template,
                                            java.lang.String format,
                                            boolean highlighted)
        Returns the path section of the link for this template. The format parameter is set to the value of the format argument, and if the url is to be highlighted, then it will have the appropriate formatting.
        Parameters:
        template - The template to get the link for.
        format - The output format to use (xml, jsonobjects, count, etc)
        highlighted - Whether or not we are highlighting this url.
        Returns:
        A string such that baseUrl + returnValue = a webservice query for this template
      • getHighlightedLink

        public java.lang.String getHighlightedLink​(java.lang.String baseUrl,
                                                   TemplateQuery template)
        Returns html formatted link in which are highlighted parameters that are to be replaced. * @see #getLink(String, TemplateQuery)
        Parameters:
        baseUrl - base url
        template - template
        Returns:
        highlighted link
      • getError

        public java.lang.String getError()
        Returns:
        error if some happened