|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.BasicItem<D> net.sf.basedb.core.OwnedItem<D> net.sf.basedb.core.SharedItem<D> net.sf.basedb.core.CommonItem<D> net.sf.basedb.core.AnnotatedItem<ProtocolData> net.sf.basedb.core.Protocol
public class Protocol
This class is used to represent individual protocol items and information about them.
Field Summary | |
---|---|
static int |
MAX_EXTERNAL_ID_LENGTH
The maximum length of the external id that can be stored in the database. |
static Item |
TYPE
The type of item represented by this class. |
Fields inherited from interface net.sf.basedb.core.Nameable |
---|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH |
Constructor Summary | |
---|---|
Protocol(ProtocolData data)
Creates a new protocol item. |
Method Summary | |
---|---|
void |
addParameter(AnnotationType annotationType)
Add an annotation type as a parameter to this protocol. |
Set<Annotatable> |
getAnnotatableParents()
Get all parents objects which are annotatable and the logged in user has read permission to. |
static Protocol |
getById(DbControl dc,
int id)
Get a Protocol item when you know the ID. |
Date |
getEntryDate()
Get the date that the item was registered in the database. |
String |
getExternalId()
Get the external id of the protocol. |
File |
getFile()
Get the file that is attached to the item. |
static Protocol |
getNew(DbControl dc,
ProtocolType protocolType)
Create a new Protocol item. |
ItemQuery<AnnotationType> |
getParameters()
Get a query that returns all annotation types used as parameters for this protocol. |
ProtocolType |
getProtocolType()
Get the associated ProtocolType item. |
static ItemQuery<Protocol> |
getQuery()
Get a query configured to retrieve protocols. |
Item |
getType()
Get the type of item represented by the object. |
Set<ItemProxy> |
getUsingItems()
Get all: a BioMaterial :s and Hybridization :s using this protocol
a Plate :s using this protocol
an ArrayBatch :s using this protocol
a Scan :s using this protocol
a RawBioAssay :s using this protocol
|
boolean |
isParameter(Annotation annotation)
Check if the annotation is parameter to this protocol. |
boolean |
isParameter(AnnotationType annotationType)
Check if the annotation type is a parameter to this protocol. |
boolean |
isUsed()
Check if this protocol is used by: a BioMaterialEvent
a PlateEvent
an ArrayBatch
a Scan
a RawBioAssay
|
void |
removeParameter(AnnotationType annotationType)
Remove an annotation type from the parameters for this protocol. |
void |
setExternalId(String externalId)
Set the external id of the protocol. |
void |
setFile(File file)
Attach a file to the item. |
void |
setProtocolType(ProtocolType protocolType)
Set the protocol type of this Protocol item. |
Methods inherited from class net.sf.basedb.core.AnnotatedItem |
---|
getAnnotationSet, getProtocol, isAnnotated, removeAnnotations, toTransferable |
Methods inherited from class net.sf.basedb.core.CommonItem |
---|
getDescription, getName, isRemoved, setDescription, setName, setRemoved, toTransferable |
Methods inherited from class net.sf.basedb.core.SharedItem |
---|
getItemKey, getProjectKey, initPermissions, isShared, onBeforeCommit, setItemKey, setProjectKey, toTransferable |
Methods inherited from class net.sf.basedb.core.OwnedItem |
---|
getOwner, isOwner, setOwner, takeOwnership, toTransferable |
Methods inherited from class net.sf.basedb.core.BasicItem |
---|
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sf.basedb.core.Identifiable |
---|
getId, getVersion |
Methods inherited from interface net.sf.basedb.core.AccessControlled |
---|
checkPermission, getPermissions, hasPermission |
Methods inherited from interface net.sf.basedb.core.Ownable |
---|
getOwner, isOwner, setOwner, takeOwnership |
Field Detail |
---|
public static final Item TYPE
Item.PROTOCOL
,
getType()
public static final int MAX_EXTERNAL_ID_LENGTH
setExternalId(String)
,
Constant Field ValuesConstructor Detail |
---|
Protocol(ProtocolData data)
data
- the dataMethod Detail |
---|
public static Protocol getNew(DbControl dc, ProtocolType protocolType) throws BaseException
Protocol
item.
dc
- The DbControl
which will be used for
permission checking and database accessprotocolType
- The type of the protocol
Protocol
item
BaseException
- If there is an errorpublic static Protocol getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
Protocol
item when you know the ID.
dc
- The DbControl
which will be used for
permission checking and database access.id
- The ID of the item to load
Protocol
item
ItemNotFoundException
- This exception is thrown if an
item with the specified ID is not found
PermissionDeniedException
- This exception is thrown if
the logged in user doesn't have READ
permission to the item
BaseException
- This exception is thrown if there is another
errorpublic static ItemQuery<Protocol> getQuery()
ItemQuery
objectpublic Item getType()
Identifiable
Item
enumeration.
getType
in interface Identifiable
public File getFile() throws PermissionDeniedException, BaseException
FileAttachable
getFile
in interface FileAttachable
File
item, or null if no file is attached
PermissionDeniedException
- If the logged in user doesn't have
read permission for the file
BaseException
- If there is another errorpublic void setFile(File file) throws PermissionDeniedException
FileAttachable
setFile
in interface FileAttachable
file
- The file to attach to the item
PermissionDeniedException
- If the logged in user doesn't
have use permission for the file or write permission for the
itempublic Date getEntryDate()
Registered
getEntryDate
in interface Registered
public Set<Annotatable> getAnnotatableParents()
Annotatable
getAnnotatableParents
in interface Annotatable
public boolean isUsed() throws BaseException
BioMaterialEvent
PlateEvent
ArrayBatch
Scan
RawBioAssay
isUsed
in class BasicItem<ProtocolData>
BaseException
- If not able to tell if item is used or not.BasicItem.getUsingItems()
public Set<ItemProxy> getUsingItems()
BioMaterial
:s and Hybridization
:s using this protocol
Plate
:s using this protocol
ArrayBatch
:s using this protocol
Scan
:s using this protocol
RawBioAssay
:s using this protocol
getUsingItems
in class BasicItem<ProtocolData>
BasicItem.addUsingItems(Set, Item, org.hibernate.Query)
public ProtocolType getProtocolType() throws PermissionDeniedException, BaseException
ProtocolType
item.
All Protocol
items must have a type.
ProtocolType
item
PermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission for the protocol type
BaseException
- If there is any errorpublic void setProtocolType(ProtocolType protocolType) throws PermissionDeniedException, InvalidUseOfNullException
Protocol
item.
This parameter mustn't be null
.
protocolType
- The new ProtocolType
PermissionDeniedException
- If the logged in user doesn't have
Permission.WRITE
permission to this protocol or
Permission.USE
permission for the protocol type
InvalidUseOfNullException
- If protocoltype is nullpublic String getExternalId()
public void setExternalId(String externalId) throws PermissionDeniedException, InvalidDataException
MAX_EXTERNAL_ID_LENGTH
constant.
externalId
- The new value for the external id
PermissionDeniedException
- If the logged in user doesn't have
write permission
InvalidDataException
- If the string is too longpublic void addParameter(AnnotationType annotationType) throws PermissionDeniedException, InvalidDataException
annotationType
- The annotation type to add to this protocol
PermissionDeniedException
- If the
logged in user doesn't have Permission.WRITE
permission for the protocol and Permission.USE
for the annotation type
InvalidDataException
- If the annotationType is null, or the
AnnotationType.isProtocolParameter()
doesn't return truepublic void removeParameter(AnnotationType annotationType) throws PermissionDeniedException, InvalidDataException
annotationType
- The annotation type to remove from this protocol
PermissionDeniedException
- If the
logged in user doesn't have Permission.WRITE
permission for the protocol
InvalidDataException
- If the annotationType is nullpublic boolean isParameter(AnnotationType annotationType)
annotationType
- The annotation type to check, null always return false
AnnotationType.isProtocolParameter(Protocol)
public boolean isParameter(Annotation annotation)
isParameter(AnnotationType)
but is not
affected by possible permission problems with the annotation type.
annotation
- The annotation to check, null always return false
public ItemQuery<AnnotationType> getParameters()
ItemQuery
object
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |