Package org.intermine.web.logic.bag
Class BagHelper
- java.lang.Object
-
- org.intermine.web.logic.bag.BagHelper
-
public final class BagHelper extends java.lang.Object
Helper methods for bags.- Author:
- Kim Rutherford
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BAG_NAME_PREFIX
When generating new bag names, this is used as a prefix.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static InterMineBag
createBagFromPathQuery(PathQuery query, java.lang.String bagName, java.lang.String bagDescription, java.lang.String pathString, Profile profile, InterMineAPI im)
Create a bag for the given profile and bag name from a PathQuery.static java.lang.String
getAttributesFromBag(InterMineBag bag, ObjectStore os, java.lang.String dbName, java.lang.String attrName)
Used by esyn toolstatic java.lang.String
getAttributesFromBag(InterMineBag bag, ObjectStore os, java.lang.String dbName, java.lang.String attrName, java.lang.String delimiter)
-
-
-
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 query, java.lang.String bagName, java.lang.String bagDescription, java.lang.String pathString, Profile profile, InterMineAPI im) 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 or else provide a path. The name will be made unique with "_n" if it already exists in the profile.- Parameters:
query
- the query to create the bag frombagName
- name of new bagbagDescription
- a description for the new bagpathString
- path used to create listprofile
- bag will be created in this profileim
- InterMineAPI that will give us BagManager- Returns:
- the new bag, already saved
- Throws:
ObjectStoreException
- if persistence problem
-
getAttributesFromBag
public static java.lang.String getAttributesFromBag(InterMineBag bag, ObjectStore os, java.lang.String dbName, java.lang.String attrName, java.lang.String delimiter)
- Parameters:
bag
- the bagos
- the object storedbName
- the database to link toattrName
- the attribute name (identifier, omimId, etc)delimiter
- the delimiter to use for the attributes- Returns:
- the string of comma separated identifiers
-
getAttributesFromBag
public static java.lang.String getAttributesFromBag(InterMineBag bag, ObjectStore os, java.lang.String dbName, java.lang.String attrName)
Used by esyn tool- Parameters:
bag
- the bagos
- the object storedbName
- the database to link toattrName
- the attribute name (identifier, omimId, etc)- Returns:
- the string of separated identifiers, using the delimiter supplied
-
-