Class Templates


  • public final class Templates
    extends java.lang.Object
    A utility class with static methods for dealing with templates.
    Author:
    Alex Kalderimis
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​java.util.List<TemplateValue>> getValuesFromInput​(TemplateQuery template, TemplateResultInput input)
      Creates a map from input to be used later to populate the template.
      static java.util.Map<java.lang.String,​java.util.List<ConstraintInput>> parseConstraints​(javax.servlet.http.HttpServletRequest request)
      Given a HTTP request, parse out the template values.
      • Methods inherited from class java.lang.Object

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

      • parseConstraints

        public static java.util.Map<java.lang.String,​java.util.List<ConstraintInput>> parseConstraints​(javax.servlet.http.HttpServletRequest request)
                                                                                                      throws Templates.TemplateValueParseException
        Given a HTTP request, parse out the template values. A template value is expected to be encoded such as:
        
           constraintX=Gene
           opX=LOOKUP
           valueX=eve
           extraX=D.%20melanogaster
         
        where X is an integer from 1 - 25. The only element that may be omitted is the "extra" parameter where none is expected.
        Parameters:
        request - HTTP request by user
        Returns:
        map of constraints and values to be used to populate template.
        Throws:
        Templates.TemplateValueParseException - if the request parameters are bad.