Package org.intermine.web.logic.widget
Class Widget
- java.lang.Object
-
- org.intermine.web.logic.widget.Widget
-
- Direct Known Subclasses:
EnrichmentWidget
,GraphWidget
,HTMLWidget
,TableWidget
public abstract class Widget extends java.lang.Object
A representation of a query using a list tool. It combines the description of the calculation/query to be performed (the config), the list over which to perform it (the bag), the database to query within (the os) and the results of the query. TODO: split intoRequest
andResult
classes.- Author:
- "Xavier Watkins", Daniela Butano
-
-
Field Summary
Fields Modifier and Type Field Description protected InterMineBag
bag
protected WidgetConfig
config
protected java.lang.String
ids
protected int
notAnalysed
protected ObjectStore
os
protected int
poplationCount
-
Constructor Summary
Constructors Constructor Description Widget(WidgetConfig config)
The constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected PathQuery
createPathQueryView(ObjectStore os, WidgetConfig config)
Create a pathquery having a view composed by all items set in the view attribute in the config filejava.lang.String
getConfigId()
Get the ID of the corresponding WidgetConfigabstract java.util.List<java.util.List<java.lang.String>>
getExportResults(java.lang.String[] selected)
abstract boolean
getHasResults()
int
getNotAnalysed()
abstract PathQuery
getPathQuery()
Return the PathQuery generated dynamically by the attribute views in the configuration fileint
getPopulationCount()
abstract java.util.List<java.util.List<java.lang.Object>>
getResults()
Return the result that represents the data from this widget.java.lang.String
getTitle()
Get the widget titleabstract void
process()
Process the data and create the widgetvoid
setNotAnalysed(int notAnalysed)
void
setPopulationCount(int poplationCount)
-
-
-
Field Detail
-
config
protected WidgetConfig config
-
bag
protected InterMineBag bag
-
ids
protected java.lang.String ids
-
os
protected ObjectStore os
-
notAnalysed
protected int notAnalysed
-
poplationCount
protected int poplationCount
-
-
Constructor Detail
-
Widget
public Widget(WidgetConfig config)
The constructor- Parameters:
config
- the WidgetConfig
-
-
Method Detail
-
process
public abstract void process() throws java.lang.Exception
Process the data and create the widget- Throws:
java.lang.Exception
- if one of the classes in the widget isn't found
-
getNotAnalysed
public int getNotAnalysed()
- Returns:
- the number of objects not analysed in this widget
-
setNotAnalysed
public void setNotAnalysed(int notAnalysed)
- Parameters:
notAnalysed
- the number of objects not analysed in this widget
-
getPopulationCount
public int getPopulationCount()
- Returns:
- the number of objects in the database annotated with ANY GO term
-
setPopulationCount
public void setPopulationCount(int poplationCount)
- Parameters:
poplationCount
- the number of objects in the population
-
getExportResults
public abstract java.util.List<java.util.List<java.lang.String>> getExportResults(java.lang.String[] selected) throws java.lang.Exception
- Parameters:
selected
- the list of checked items from the form- Returns:
- the checked items in export format
- Throws:
java.lang.Exception
- something has gone wrong. oh no.
-
getHasResults
public abstract boolean getHasResults()
- Returns:
- the hasResults
-
getConfigId
public java.lang.String getConfigId()
Get the ID of the corresponding WidgetConfig- Returns:
- the WidgetConfig ID
-
getTitle
public java.lang.String getTitle()
Get the widget title- Returns:
- the title
-
getResults
public abstract java.util.List<java.util.List<java.lang.Object>> getResults() throws java.lang.Exception
Return the result that represents the data from this widget. Each row is represented as a list of Object- Returns:
- a list representing the rows containing a list of objects
- Throws:
java.lang.Exception
- if something goes wrong.
-
getPathQuery
public abstract PathQuery getPathQuery()
Return the PathQuery generated dynamically by the attribute views in the configuration file- Returns:
- the pathquery
-
createPathQueryView
protected PathQuery createPathQueryView(ObjectStore os, WidgetConfig config)
Create a pathquery having a view composed by all items set in the view attribute in the config file- Parameters:
os
- the object storeconfig
- the widget configuration- Returns:
- the path query created
-
-