Package org.intermine.web.logic.template
Class Templates
- java.lang.Object
-
- org.intermine.web.logic.template.Templates
-
public final class Templates extends java.lang.Object
A utility class with static methods for dealing with templates.- Author:
- Alex Kalderimis
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Templates.TemplateValueParseException
An exception that we throw when we can't parse a template.
-
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.
-
-
-
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:
where X is an integer from 1 - 25. The only element that may be omitted is the "extra" parameter where none is expected.constraintX=Gene opX=LOOKUP valueX=eve extraX=D.%20melanogaster
- 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.
-
getValuesFromInput
public static java.util.Map<java.lang.String,java.util.List<TemplateValue>> getValuesFromInput(TemplateQuery template, TemplateResultInput input) throws Templates.TemplateValueParseException
Creates a map from input to be used later to populate the template.- Parameters:
template
- templateinput
- values from URL- Returns:
- map from constraints to values
- Throws:
Templates.TemplateValueParseException
- if the input is bad.
-
-