org.intermine.web.struts
Class TemplateAction

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by org.intermine.web.struts.InterMineAction
          extended by org.intermine.web.struts.TemplateAction
Direct Known Subclasses:
TemplatesExportAction

public class TemplateAction
extends InterMineAction

Action to handle submit from the template page. setSavingQueries can be used to set whether or not queries run by this action are automatically saved in the user's query history. This property is true by default.


Field Summary
static java.lang.String SKIP_BUILDER_PARAMETER
          Name of skipBuilder parameter
static java.lang.String TEMPLATE_ACTION_PATH
          path of TemplateAction action
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
TemplateAction()
           
 
Method Summary
 org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Build a query based on the template and the input from the user.
protected  java.util.Map<java.lang.String,java.util.List<TemplateValue>> templateFormToTemplateValues(TemplateForm tf, TemplateQuery template)
          The method returns a map of TemplateValue for each editable constraint.
 
Methods inherited from class org.intermine.web.struts.InterMineAction
getWebProperties, recordError, recordError, recordError, recordMessage
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SKIP_BUILDER_PARAMETER

public static final java.lang.String SKIP_BUILDER_PARAMETER
Name of skipBuilder parameter

See Also:
Constant Field Values

TEMPLATE_ACTION_PATH

public static final java.lang.String TEMPLATE_ACTION_PATH
path of TemplateAction action

See Also:
Constant Field Values
Constructor Detail

TemplateAction

public TemplateAction()
Method Detail

execute

public org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping,
                                                      org.apache.struts.action.ActionForm form,
                                                      javax.servlet.http.HttpServletRequest request,
                                                      javax.servlet.http.HttpServletResponse response)
                                               throws java.lang.Exception
Build a query based on the template and the input from the user. There are some request parameters that, if present, effect the behaviour of the action. These are:
skipBuilder
If this attribute is specifed (with any value) then the action will forward directly to the object details page if the results contain just one object.
noSaveQuery
If this attribute is specifed (with any value) then the query is not automatically saved in the user's query history.

Overrides:
execute in class org.apache.struts.action.Action
Parameters:
mapping - The ActionMapping used to select this instance
form - The optional ActionForm bean for this request (if any)
request - The HTTP request we are processing
response - The HTTP response we are creating
Returns:
an ActionForward object defining where control goes next
Throws:
java.lang.Exception - if the application business logic throws an exception

templateFormToTemplateValues

protected java.util.Map<java.lang.String,java.util.List<TemplateValue>> templateFormToTemplateValues(TemplateForm tf,
                                                                                                     TemplateQuery template)
The method returns a map of TemplateValue for each editable constraint. The map is obtained matching the values retrieved from the request through the TemplateForm with the editable constraint defined in the current template

Parameters:
tf - the actionform containing the value from the requst
template - the current template
Returns:
Map