Class TableWidgetLdr


  • public class TableWidgetLdr
    extends WidgetLdr
    Author:
    Xavier Watkins, Daniela Butano
    • Constructor Detail

      • TableWidgetLdr

        public TableWidgetLdr​(WidgetConfig widgetConfig,
                              InterMineBag bag,
                              ObjectStore os,
                              java.lang.String ids)
                       throws java.io.UnsupportedEncodingException
        This class loads and formats the data for the count table widgets in the bag details page
        Parameters:
        widgetConfig - the configuration settings for this widget
        bag - bag for this widget
        os - the objectstore
        ids - intermine IDs, required if bag is NULL
        Throws:
        java.io.UnsupportedEncodingException - if can't encode url
    • Method Detail

      • getType

        public java.lang.String getType()
        Returns:
        the class name of the path this table widget loads.
      • setFlattenedResults

        public void setFlattenedResults()
                                 throws java.io.UnsupportedEncodingException
        builds, runs query. builds the results sets to be used to build widget
        Throws:
        java.io.UnsupportedEncodingException - if url can't be encoded
      • getFlattenedResults

        public java.util.List<java.util.List<java.lang.Object>> getFlattenedResults()
        get the flattened results
        Returns:
        the flattened results
      • getColumns

        public java.util.List<java.lang.String> getColumns()
        Get the columnNames
        Returns:
        the columnNames
      • getTitle

        public java.lang.String getTitle()
        Get the title
        Returns:
        the title
      • getDescription

        public java.lang.String getDescription()
        Get the description
        Returns:
        the description
      • getQuery

        public Query getQuery​(boolean calcTotal,
                              java.util.List<java.lang.String> keys)
        Parameters:
        calcTotal - if we are generating the query to calculate the widget totals
        keys - constraints to add to the query
        Returns:
        query representing data related to a table widget
      • pathWithNoConstraints

        protected java.lang.String pathWithNoConstraints​(java.lang.String path)
        Parameters:
        path - the path to parse
        Returns:
        a path with out any [] constraints
      • getWidgetTotal

        public int getWidgetTotal()
        Returns:
        the total number of objects analysed in this widget
      • getExportResults

        public java.util.List<java.util.List<java.lang.String>> getExportResults​(java.lang.String[] selected)
                                                                          throws java.lang.Exception
        Parameters:
        selected - selected records to export
        Returns:
        list of lists of records to export
        Throws:
        java.lang.Exception - if something goes horribly wrong
      • createPathQuery

        public PathQuery createPathQuery()
        Returns the pathquery based on the views set in config file and the bag constraint Executed when the user selects any item in the matches column in the enrichment widget.
        Returns:
        the query generated