Package net.sf.basedb.core
Class BioPlateEventParticipant
java.lang.Object
net.sf.basedb.core.BasicItem
net.sf.basedb.core.ChildItem
net.sf.basedb.core.BioPlateEventParticipant
- All Implemented Interfaces:
AccessControlled
,Identifiable
Holds information about a bioplate that is participating in a bioplate event.
The bioplate may have a specific 'role' and an 'index' (if the ordering among
multiple plates is important). The BASE core itself doesn't requires or makes
any use of those attributes. It is also possible to link individual biomaterial
events to a participant.
A bioplate participant object is formally a child item to the bioplate event, but users that has read permission to the bioplate also get read permission to the participant object.
- Since:
- 2.17
- Author:
- Nicklas
- Last modified
- $Date: 2017-05-22 14:35:27 +0200 (må, 22 maj 2017) $
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The maximum length of the role string that can be stored in the database.static final Item
The type of item represented by this class. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet theBioPlate
.static BioPlateEventParticipant
Get aBioPlateEventParticipant
item when you know the id.(package private) BioPlateEventParticipantData
getData()
Get theBasicData
object that holds all data for this item.getEvent()
Get theBioPlateEvent
.int
getIndex()
Get the index of the plate in this event.(package private) static BioPlateEventParticipant
getNew
(DbControl dc, BioPlateEvent event, BioPlate plate) Creates a new participant for the given event and bioplate.static ItemQuery<BioPlateEventParticipant>
Get a query configured to return all event participants for a bioplate.static ItemQuery<BioPlateEventParticipant>
getQuery
(BioPlateEvent event) Get a query configured to return all participants for a bioplate event.getRole()
Get the role that the plate has in this event.(package private) SharedData
Get the shareable parent item of this child item.getType()
Get the type of item represented by the object.(package private) void
initPermissions
(int granted, int denied) If the logged in user has read permission for the parent, read permission is granted.(package private) void
onBeforeCommit
(Transactional.Action action) This method is called on eachTransactional
item and on all items if the action isTransactional.Action.CREATE
orTransactional.Action.DELETE
before a commit is issued to the database.void
setIndex
(int index) Set the index of the plate in this event.void
Set the role that the plate has in this event.Methods inherited from class net.sf.basedb.core.ChildItem
getPermissionForUse, getPermissionForWriteDeleteAndCreate, getPluginPermissions
Methods inherited from class net.sf.basedb.core.BasicItem
addAnnotatableParents, addUsingItems, addUsingItems, breakCircularReferences, checkBatchAnnotatableUsage, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, validate
-
Field Details
-
TYPE
The type of item represented by this class.- See Also:
-
MAX_ROLE_LENGTH
public static final int MAX_ROLE_LENGTHThe maximum length of the role string that can be stored in the database.- See Also:
-
-
Constructor Details
-
BioPlateEventParticipant
BioPlateEventParticipant(BioPlateEventParticipantData data)
-
-
Method Details
-
getNew
Creates a new participant for the given event and bioplate. -
getById
public static BioPlateEventParticipant getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException Get aBioPlateEventParticipant
item when you know the id.- Parameters:
dc
- TheDbControl
which will be used for permission checking and database access.id
- The id of the item to load- Returns:
- The
BioPlateEventParticipant
item - Throws:
ItemNotFoundException
- 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 error
-
getQuery
public static ItemQuery<BioPlateEventParticipant> getQuery(BioPlateEvent event) throws InvalidDataException Get a query configured to return all participants for a bioplate event.- Parameters:
event
- The event to get participants for (null is not allowed)- Returns:
- An
ItemQuery
object - Throws:
InvalidUseOfNullException
- If the event parameter is nullInvalidDataException
-
getQuery
public static ItemQuery<BioPlateEventParticipant> getQuery(BioPlate bioPlate) throws InvalidDataException Get a query configured to return all event participants for a bioplate.- Parameters:
bioPlate
- The bioplate to get participants for (null is not allowed)- Returns:
- An
ItemQuery
object - Throws:
InvalidUseOfNullException
- If the bioplate parameter is nullInvalidDataException
-
getData
BioPlateEventParticipantData getData()Description copied from class:BasicItem
Get theBasicData
object that holds all data for this item. -
getType
Description copied from interface:Identifiable
Get the type of item represented by the object. The returned value is one of the values defined in theItem
enumeration.- Returns:
- A value indicating the type of item
-
initPermissions
Description copied from class:ChildItem
If the logged in user has read permission for the parent, read permission is granted. If the logged in user has the permission returned by theChildItem.getPermissionForWriteDeleteAndCreate()
method for the parent, WRITE, DELETE and CREATE permission is granted.- Overrides:
initPermissions
in classChildItem
- Parameters:
granted
- Permissions that have been granted by the subclassdenied
- Permissions that have been denied by the subclass- Throws:
BaseException
- If the permissions couldn't be initialised
-
onBeforeCommit
Description copied from class:BasicItem
This method is called on eachTransactional
item and on all items if the action isTransactional.Action.CREATE
orTransactional.Action.DELETE
before a commit is issued to the database. If the subclass overrides this method it must also propagate the call to the superclass, ie.super.onBeforeCommit(action)
.- Overrides:
onBeforeCommit
in classBasicItem
- Throws:
BaseException
- If there is an error- See Also:
-
getBioPlate
Get theBioPlate
.- Throws:
PermissionDeniedException
- If the logged in user doesn't have read permission for the bioplateBaseException
- If there is another error
-
getEvent
Get theBioPlateEvent
.- Throws:
PermissionDeniedException
- If the logged in user doesn't have read permission for the eventBaseException
- If there is another error
-
getRole
Get the role that the plate has in this event. The role is a string defined by the client application. -
setRole
Set the role that the plate has in this event. The role is a string defined by the client application. -
getIndex
public int getIndex()Get the index of the plate in this event. This has no meaning unless the event require that the plates are ordered. -
setIndex
public void setIndex(int index) Set the index of the plate in this event. This has no meaning unless the event require that the plates are ordered.
-