Package org.intermine.api.template
Class ApiTemplate
- java.lang.Object
-
- org.intermine.pathquery.PathQuery
-
- org.intermine.template.TemplateQuery
-
- org.intermine.api.template.ApiTemplate
-
- All Implemented Interfaces:
java.lang.Cloneable
,Taggable
,WebSearchable
public class ApiTemplate extends TemplateQuery implements WebSearchable
This class extends TemplateQuery to provide the features needed by the API - Lucene indexing and database serialisation.- Author:
- Alex Kalderimis
-
-
Field Summary
Fields Modifier and Type Field Description protected SavedTemplateQuery
savedTemplateQuery
SavedTemplateQuery object in the UserProfile database, so we can update summaries.-
Fields inherited from class org.intermine.template.TemplateQuery
comment, constraintDescriptions, constraintSwitchOffAbility, editableConstraints, edited, name
-
Fields inherited from class org.intermine.pathquery.PathQuery
MAX_CODE, MAX_CONSTRAINTS, MIN_CODE, SPACE_SPLITTER, USERPROFILE_VERSION
-
-
Constructor Summary
Constructors Constructor Description ApiTemplate(java.lang.String name, java.lang.String title, java.lang.String comment, PathQuery query)
ApiTemplate(TemplateQuery template)
Construct a new API template that has all the same properties as the TemplateQuery passed into the constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addObserver(WebSearchWatcher wsw)
Add this observer to the list of interested parties.ApiTemplate
clone()
Clone this ApiQueryboolean
equals(java.lang.Object other)
void
fireEvent(OriginatingEvent e)
Notify all your observers of this event which originates at this web searchable.protected java.util.Map<java.lang.String,java.lang.Object>
getHeadAttributes()
SavedTemplateQuery
getSavedTemplateQuery()
Gets the saved template query object.java.lang.String
getTagType()
Poly-Morphic Constant.int
hashCode()
void
removeObserver(WebSearchWatcher wsw)
Remove this observer from the list of interested parties.void
setAPI(InterMineAPI im)
Only used on export so we can get the tags related to this template.void
setDescription(java.lang.String description)
Sets the description for this PathQuery.void
setName(java.lang.String name)
Sets the query short name.void
setProfile(Profile profile)
Only used on export so we can get the tags related to this template.void
setSavedTemplateQuery(SavedTemplateQuery savedTemplateQuery)
Sets the saved template query object.void
setTitle(java.lang.String title)
Sets the name of the query.-
Methods inherited from class org.intermine.template.TemplateQuery
clearConstraints, cloneWithoutEditableConstraints, getComment, getCommonJsonConstraintPrefix, getConstraintDescription, getConstraintDescriptions, getConstraintLogicForEditableConstraints, getConstraintSwitchOffAbility, getEditableConstraints, getEditableConstraints, getEditablePaths, getModifiableEditableConstraints, getName, getQueryToExecute, getRelevantConstraints, getSwitchOffAbility, getTitle, isEditable, isEdited, isOptional, isRequired, removeConstraint, replaceConstraint, setComment, setConstraintDescription, setEditable, setEditableConstraints, setEdited, setSwitchOffAbility, toJSON, toString, toXml, validateLookupConstraints
-
Methods inherited from class org.intermine.pathquery.PathQuery
addConstraint, addConstraint, addConstraints, addConstraints, addJsonProperty, addOrderBy, addOrderBy, addOrderBys, addOrderBys, addOrderBySpaceSeparated, addView, addViews, addViews, addViewSpaceSeparated, checkPathFormat, clearDescriptions, clearOrderBy, clearOuterJoinStatus, clearView, constraintToJson, deVerify, fixUpForJoinStyle, formatKVPair, getBagNames, getCandidateLoops, getColumnHeaders, getConstraintCodes, getConstraintForCode, getConstraintGroups, getConstraintLogic, getConstraintLogicForGroup, getConstraints, getConstraintsForPath, getDescription, getDescription, getDescriptions, getExistingLoops, getGeneratedPathDescription, getGroupedConstraintLogic, getJson, getLogicExpression, getModel, getOrderBy, getOuterJoinGroup, getOuterJoinGroups, getOuterJoinStatus, getOuterJoinStatus, getOuterMap, getRootClass, getSubclasses, getView, isEmpty, isPathCompletelyInner, isValid, makePath, removeAllIrrelevant, removeAllUnder, removeOrderBy, removeSubclassAndFixUp, removeView, setConstraintLogic, setDescription, setOuterJoinStatus, sortConstraints, toJson, toJson, toJson, toJson, toXml, typeConstraintToJson, valueConstraintToJson, verifyQuery
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.intermine.api.search.WebSearchable
getDescription, getTitle
-
-
-
-
Field Detail
-
savedTemplateQuery
protected SavedTemplateQuery savedTemplateQuery
SavedTemplateQuery object in the UserProfile database, so we can update summaries.
-
-
Constructor Detail
-
ApiTemplate
public ApiTemplate(java.lang.String name, java.lang.String title, java.lang.String comment, PathQuery query)
- Parameters:
name
- name of templatetitle
- title of templatecomment
- commentquery
- query
-
ApiTemplate
public ApiTemplate(TemplateQuery template)
Construct a new API template that has all the same properties as the TemplateQuery passed into the constructor.- Parameters:
template
- The prototypical template to be like.
-
-
Method Detail
-
clone
public ApiTemplate clone()
Clone this ApiQuery- Overrides:
clone
in classTemplateQuery
- Returns:
- template
-
setSavedTemplateQuery
public void setSavedTemplateQuery(SavedTemplateQuery savedTemplateQuery)
Sets the saved template query object.- Parameters:
savedTemplateQuery
- the database object
-
getSavedTemplateQuery
public SavedTemplateQuery getSavedTemplateQuery()
Gets the saved template query object.- Returns:
- a SavedTemplateQuery object that represents this TemplateQuery in the userprofile database
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classTemplateQuery
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classTemplateQuery
-
addObserver
public void addObserver(WebSearchWatcher wsw)
Description copied from interface:WebSearchable
Add this observer to the list of interested parties. The observer should be notified of every change event this web searchable object has cause to issue.- Specified by:
addObserver
in interfaceWebSearchable
- Parameters:
wsw
- The observer.
-
removeObserver
public void removeObserver(WebSearchWatcher wsw)
Description copied from interface:WebSearchable
Remove this observer from the list of interested parties. The observer should not be notified of any subsequent events this web searchable object has cause to generate.- Specified by:
removeObserver
in interfaceWebSearchable
- Parameters:
wsw
- The observer.
-
getTagType
public java.lang.String getTagType()
Description copied from interface:Taggable
Poly-Morphic Constant.- Specified by:
getTagType
in interfaceTaggable
- Returns:
- The appropriate tag-type for this kind of object.
-
fireEvent
public void fireEvent(OriginatingEvent e)
Description copied from interface:WebSearchable
Notify all your observers of this event which originates at this web searchable.- Specified by:
fireEvent
in interfaceWebSearchable
- Parameters:
e
- The event that has just occurred.
-
setTitle
public void setTitle(java.lang.String title)
Description copied from class:PathQuery
Sets the name of the query.
-
setName
public void setName(java.lang.String name)
Description copied from class:TemplateQuery
Sets the query short name.- Overrides:
setName
in classTemplateQuery
- Parameters:
name
- the template name
-
setDescription
public void setDescription(java.lang.String description)
Description copied from class:PathQuery
Sets the description for this PathQuery.- Overrides:
setDescription
in classPathQuery
- Parameters:
description
- the new description, or null for none
-
setAPI
public void setAPI(InterMineAPI im)
Only used on export so we can get the tags related to this template.- Parameters:
im
- InterMine API
-
setProfile
public void setProfile(Profile profile)
Only used on export so we can get the tags related to this template.- Parameters:
profile
- user who owns this template
-
getHeadAttributes
protected java.util.Map<java.lang.String,java.lang.Object> getHeadAttributes()
- Overrides:
getHeadAttributes
in classTemplateQuery
- Returns:
- the attributes that should go in the head of a JSON object.
-
-