org.intermine.web.logic.bag
Class BagHelper

java.lang.Object
  extended by org.intermine.web.logic.bag.BagHelper

public final class BagHelper
extends java.lang.Object

Helper methods for bags.


Field Summary
static java.lang.String BAG_NAME_PREFIX
          When generating new bag names, this is used as a prefix.
 
Method Summary
static InterMineBag createBagFromPathQuery(PathQuery pathQuery, java.lang.String bagName, java.lang.String bagDescription, java.lang.String bagType, Profile profile, ObjectStore os, BagQueryRunner bagQueryRunner)
          Create a bag for the given profile and bag name from a PathQuery.
static java.lang.String getIdList(InterMineBag bag, ObjectStore os, java.lang.String dbName, java.lang.String attrName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BAG_NAME_PREFIX

public static final java.lang.String BAG_NAME_PREFIX
When generating new bag names, this is used as a prefix.

See Also:
Constant Field Values
Method Detail

createBagFromPathQuery

public static InterMineBag createBagFromPathQuery(PathQuery pathQuery,
                                                  java.lang.String bagName,
                                                  java.lang.String bagDescription,
                                                  java.lang.String bagType,
                                                  Profile profile,
                                                  ObjectStore os,
                                                  BagQueryRunner bagQueryRunner)
                                           throws ObjectStoreException
Create a bag for the given profile and bag name from a PathQuery. The PathQuery must select only the id field from the type the bag is to be created from. The name will be made unique with "_n" if it already exists in the profile.

Parameters:
os - the production ObjectStore
bagQueryRunner - the bag query runner
profile - bag will be created in this profile
bagName - name of new bag
bagDescription - a description for the new bag
bagType - the class of object in the bag
pathQuery - the query to create the bag from
Returns:
the new bag, already saved
Throws:
ObjectStoreException - if persistence problem

getIdList

public static java.lang.String getIdList(InterMineBag bag,
                                         ObjectStore os,
                                         java.lang.String dbName,
                                         java.lang.String attrName)
Parameters:
bag - the bag
os - the object store
dbName - the database to link to
attrName - the attribute name (identifier, omimId, etc)
Returns:
the string of comma separated identifiers
See Also: