Package org.intermine.api.template
Class TemplateSummariser
- java.lang.Object
-
- org.intermine.api.template.TemplateSummariser
-
public class TemplateSummariser extends java.lang.Object
This class manages summaries of possible values for editable constraints for template queries.- Author:
- Matthew Wakeling
-
-
Field Summary
Fields Modifier and Type Field Description protected int
maxSummaryValues
protected ObjectStore
os
protected ObjectStoreWriter
osw
protected java.util.Map<TemplateQuery,java.util.HashMap<java.lang.String,java.util.List<java.lang.Object>>>
possibleValues
-
Constructor Summary
Constructors Constructor Description TemplateSummariser(ObjectStore os, ObjectStoreWriter osw, ObjectStoreSummary oss)
Construct a TemplateSummariser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.util.List<java.lang.Object>>
getPossibleValues(ApiTemplate templateQuery)
Returns a Map of the possible values for editable nodes on a template query.java.util.List<java.lang.Object>
getPossibleValues(ApiTemplate templateQuery, java.lang.String path)
Returns the possible values that a particular path in a template query can take, for dropdowns on template forms.boolean
isSummarised(ApiTemplate templateQuery)
Returns true if the given template has been summarised.void
summarise(ApiTemplate templateQuery)
Populates the possibleValues data for a given TemplateQuery from the os.
-
-
-
Field Detail
-
os
protected ObjectStore os
-
osw
protected ObjectStoreWriter osw
-
possibleValues
protected java.util.Map<TemplateQuery,java.util.HashMap<java.lang.String,java.util.List<java.lang.Object>>> possibleValues
-
maxSummaryValues
protected final int maxSummaryValues
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TemplateSummariser
public TemplateSummariser(ObjectStore os, ObjectStoreWriter osw, ObjectStoreSummary oss)
Construct a TemplateSummariser.- Parameters:
os
- ObjectStore containing production dataosw
- ObjectStoreWriter containing ProfileManager dataoss
- A summary of the ObjectStore - will be null
-
-
Method Detail
-
summarise
public void summarise(ApiTemplate templateQuery) throws ObjectStoreException
Populates the possibleValues data for a given TemplateQuery from the os.- Parameters:
templateQuery
- a TemplateQuery to summarise- Throws:
ObjectStoreException
- if something goes wrong
-
isSummarised
public boolean isSummarised(ApiTemplate templateQuery)
Returns true if the given template has been summarised.- Parameters:
templateQuery
- a TemplateQuery- Returns:
- a boolean
-
getPossibleValues
public java.util.List<java.lang.Object> getPossibleValues(ApiTemplate templateQuery, java.lang.String path)
Returns the possible values that a particular path in a template query can take, for dropdowns on template forms.- Parameters:
templateQuery
- a TemplateQuerypath
- the path that is being constrained- Returns:
- a List of possible values
-
getPossibleValues
public java.util.Map<java.lang.String,java.util.List<java.lang.Object>> getPossibleValues(ApiTemplate templateQuery)
Returns a Map of the possible values for editable nodes on a template query.- Parameters:
templateQuery
- a TemplateQuery- Returns:
- a Map from String path to List
-
-