org.intermine.api.bag
Class BagQueryHelper

java.lang.Object
  extended by org.intermine.api.bag.BagQueryHelper

public class BagQueryHelper
extends java.lang.Object


Field Summary
static java.lang.String DEFAULT_MESSAGE
          Message associated with default bag query.
 
Constructor Summary
BagQueryHelper()
           
 
Method Summary
static Query createDefaultBagQuery(java.lang.String type, BagQueryConfig bagQueryConfig, Model model, java.util.Map classKeys, java.util.Collection input)
          Create a BagQuery that constrains the class key fields of the given type.
static BagQueryConfig readBagQueryConfig(Model model, java.io.InputStream is)
          Read the bag query configuration from the given stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MESSAGE

public static final java.lang.String DEFAULT_MESSAGE
Message associated with default bag query.

See Also:
Constant Field Values
Constructor Detail

BagQueryHelper

public BagQueryHelper()
Method Detail

createDefaultBagQuery

public static Query createDefaultBagQuery(java.lang.String type,
                                          BagQueryConfig bagQueryConfig,
                                          Model model,
                                          java.util.Map classKeys,
                                          java.util.Collection input)
                                   throws java.lang.ClassNotFoundException
Create a BagQuery that constrains the class key fields of the given type.

Parameters:
type - the class to query for
bagQueryConfig - The BagQueryConfig object used to get the extra class and field to constrain when making the query (eg. constrain Bioentiry.organism.name = "something")
classKeys - the class keys map
input - the input strings/identifiers
model - the Model to pass to the BagQuery constructor
Returns:
a BagQuery that queries for objects of class given of type where any of the class key fields match any of the input identifiers
Throws:
java.lang.ClassNotFoundException - if the type isn't in the model

readBagQueryConfig

public static BagQueryConfig readBagQueryConfig(Model model,
                                                java.io.InputStream is)
                                         throws java.lang.Exception
Read the bag query configuration from the given stream.

Parameters:
model - the Model to use to check the bag types
is - the InputStream
Returns:
the BagQueryConfig object for this webapp
Throws:
java.lang.Exception - if there is a problem parsing the bag-queries.xml