public class BioPlateEvent extends CommonItem implements Registered, Transactional
BioMaterialEvent
:s may be linked with
a bioplate event. The biomaterial events are then locked and most properties
are set on the bioplate event. The description field is mapped to the
comment field of the biomaterial events but it is possible to overwrite with a specific comment.Transactional.Action
Modifier and Type | Field and Description |
---|---|
private boolean |
needSynchronize |
static Item |
TYPE
The type of item represented by this class.
|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
Constructor and Description |
---|
BioPlateEvent(BioPlateEventData data) |
Modifier and Type | Method and Description |
---|---|
BioPlateEventParticipant |
addParticipant(BioPlate bioPlate,
String role,
int index)
Add a bioplate as a participant in this event.
|
private BioPlateEventParticipantData |
findParticipant(BioPlateData plate)
Find the participant object for the given bioplate.
|
ItemQuery<BioMaterialEvent> |
getBioMaterialEvents()
Get a query returning all biomaterial events linked to this
event.
|
static BioPlateEvent |
getById(DbControl dc,
int id)
Get a
BioPlateEvent item when you know the id. |
(package private) BioPlateEventData |
getData()
Get the
BasicData object that holds all data for this item. |
Date |
getEntryDate()
Get the date that the item was registered in the database.
|
Date |
getEventDate()
Get the date this event was done in the lab.
|
BioPlateEventType |
getEventType()
Get the event type of this event.
|
Hardware |
getHardware()
Get the
Hardware that was used in this event. |
static BioPlateEvent |
getNew(DbControl dc,
BioPlateEventType eventType)
Create a new
BioPlateEvent item. |
BioPlateEventParticipant |
getParticipant(BioPlate bioPlate)
Get the participant object representing the given bioplate in this
event.
|
ItemQuery<BioPlateEventParticipant> |
getParticipants()
Get a query returning all participants in the event.
|
Protocol |
getProtocol()
Get the
Protocol describing the procedure used in this event. |
static ItemQuery<BioPlateEvent> |
getQuery()
Get a query that returns bioplate event items.
|
Item |
getType()
Get the type of item represented by the object.
|
boolean |
isParticipant(BioPlate plate)
Check if the given bioplate is a participant of this event.
|
(package private) void |
onBeforeCommit(Transactional.Action action)
If a project is active, automatically share the new item according to
the settings of that project, unless a project or item key has been
explicitely set (including null).
|
void |
removeParticipant(BioPlate bioPlate)
Remove the given bioplate from this event.
|
void |
setDescription(String description)
Set the description.
|
void |
setEventDate(Date eventDate)
Set the date this event was done in the lab.
|
(package private) void |
setEventType(BioPlateEventType eventType) |
void |
setHardware(Hardware hardware)
Set the
Hardware that was used in this event. |
void |
setProtocol(Protocol protocol)
Set the
Protocol that describes the procedure used in this event. |
(package private) void |
synchronizeAllBioMaterialEvents()
Synchronize all properties on the child biomaterial
events that are related to this event.
|
(package private) void |
synchronizeProperties(BioMaterialEventData event,
BioPlateEventParticipantData participant)
Synchronize all related properties between this event and the
biomaterial event.
|
getDescription, getName, isRemoved, setName, setRemoved
getItemKey, getProjectKey, initPermissions, isShared, setItemKey, setProjectKey
getOwner, isOwner, setOwner, takeOwnership
addUsingItems, addUsingItems, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getVersion
checkPermission, getPermissions, hasPermission
getOwner, isOwner, setOwner, takeOwnership
public static final Item TYPE
Item.BIOPLATEEVENT
,
getType()
private boolean needSynchronize
BioPlateEvent(BioPlateEventData data)
public static BioPlateEvent getNew(DbControl dc, BioPlateEventType eventType) throws BaseException
BioPlateEvent
item.dc
- The DbControl
which will be used for
permission checking and database accesseventType
- The event type of the event (must not be null)BioPlateEvent
itemBaseException
- If there is an errorpublic static BioPlateEvent getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
BioPlateEvent
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 loadBioPlateEvent
itemItemNotFoundException
- If an item with the specified
id is not foundPermissionDeniedException
- If the logged in user doesn't
have read permission to the itemBaseException
- If there is another errorpublic static ItemQuery<BioPlateEvent> getQuery()
ItemQuery
object.BioPlateEventData getData()
BasicItem
BasicData
object that holds all data for this item.getData
in class CommonItem
public Item getType()
Identifiable
Item
enumeration.getType
in interface Identifiable
public Date getEntryDate()
Registered
getEntryDate
in interface Registered
public void setDescription(String description) throws PermissionDeniedException, InvalidDataException
setDescription
in interface Nameable
setDescription
in class CommonItem
description
- The new description for the itemPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the description longer
than specified by the Nameable.MAX_DESCRIPTION_LENGTH
constantvoid onBeforeCommit(Transactional.Action action) throws NotLoggedInException, BaseException
SharedItem
onBeforeCommit
in class SharedItem
NotLoggedInException
- If no user is logged inBaseException
- If there is another errorTransactional
,
Developer documentation: Transactions,
Developer documentation: Coding rules and guidelines for item classespublic Protocol getProtocol() throws PermissionDeniedException, BaseException
Protocol
describing the procedure used in this event.Protocol
item, or null if not knownPermissionDeniedException
- If the logged in user doesn't have
read permission to the protocolBaseException
- If there is another errorpublic void setProtocol(Protocol protocol) throws PermissionDeniedException
Protocol
that describes the procedure used in this event.
The protocol is also updated on all related biomaterial events (when the
transaction is committed).protocol
- A Protocol
item, or null if not knownPermissionDeniedException
- If the logged in user doesn't have
write permission on this event or use permission for the protocolpublic Hardware getHardware() throws PermissionDeniedException, BaseException
Hardware
that was used in this event.Hardware
item, or null if not knownPermissionDeniedException
- If the logged in user doesn't have
read permission to the hardwareBaseException
- If there is another errorpublic void setHardware(Hardware hardware) throws PermissionDeniedException
Hardware
that was used in this event. The hardware
is also updated on all related biomaterial events (when the
transaction is committed).hardware
- A Hardware
item, or null if not knownPermissionDeniedException
- If the logged in user doesn't have
write permission on this event or use permission for the hardwarepublic Date getEventDate()
Date
object, or null if not knownpublic void setEventDate(Date eventDate) throws PermissionDeniedException
eventDate
- The date, or null if not knownPermissionDeniedException
- If the logged in user doesn't have
write permission on this eventpublic BioPlateEventType getEventType()
void setEventType(BioPlateEventType eventType)
public boolean isParticipant(BioPlate plate)
plate
- A bioplatepublic BioPlateEventParticipant getParticipant(BioPlate bioPlate)
bioPlate
- The bioplatepublic BioPlateEventParticipant addParticipant(BioPlate bioPlate, String role, int index)
bioPlate
- The bioplate to add as a participant (null is not allowed)role
- The rolw of the plateindex
- The index (if the event requires ordering of the plates)public void removeParticipant(BioPlate bioPlate)
bioPlate
- The bioplatePermissionDeniedException
- If the logged in user
doesn't have write permissionpublic ItemQuery<BioPlateEventParticipant> getParticipants()
public ItemQuery<BioMaterialEvent> getBioMaterialEvents()
private BioPlateEventParticipantData findParticipant(BioPlateData plate)
plate
- The bioplatevoid synchronizeAllBioMaterialEvents()
void synchronizeProperties(BioMaterialEventData event, BioPlateEventParticipantData participant)