public class BioPlateEventParticipant extends ChildItem<BioPlateEventParticipantData>
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.
Modifier and Type | Field and Description |
---|---|
static int |
MAX_ROLE_LENGTH
The maximum length of the role string that can be stored in the database.
|
static Item |
TYPE
The type of item represented by this class.
|
Constructor and Description |
---|
BioPlateEventParticipant(BioPlateEventParticipantData data) |
Modifier and Type | Method and Description |
---|---|
BioPlate |
getBioPlate()
Get the
BioPlate . |
static BioPlateEventParticipant |
getById(DbControl dc,
int id)
Get a
BioPlateEventParticipant item when you know the id. |
BioPlateEvent |
getEvent()
Get the
BioPlateEvent . |
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> |
getQuery(BioPlate bioPlate)
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.
|
java.lang.String |
getRole()
Get the role that the plate has in this event.
|
(package private) SharedData |
getSharedParent()
Get the shareable parent item of this child item.
|
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 each
Transactional item and on
all items if the action is Transactional.Action.CREATE
or Transactional.Action.DELETE before a commit is issued to the database. |
void |
setIndex(int index)
Set the index of the plate in this event.
|
void |
setRole(java.lang.String role)
Set the role that the plate has in this event.
|
getPermissionForUse, getPermissionForWriteDeleteAndCreate, getPluginPermissions
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate
public static final Item TYPE
Item.BIOPLATEEVENTPARTICIPANT
,
getType()
public static final int MAX_ROLE_LENGTH
setRole(String)
,
Constant Field ValuesBioPlateEventParticipant(BioPlateEventParticipantData data)
static BioPlateEventParticipant getNew(DbControl dc, BioPlateEvent event, BioPlate plate)
public static BioPlateEventParticipant getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
BioPlateEventParticipant
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 loadBioPlateEventParticipant
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<BioPlateEventParticipant> getQuery(BioPlateEvent event) throws InvalidDataException
event
- The event to get participants for (null is not allowed)ItemQuery
objectInvalidUseOfNullException
- If the event parameter is nullInvalidDataException
public static ItemQuery<BioPlateEventParticipant> getQuery(BioPlate bioPlate) throws InvalidDataException
bioPlate
- The bioplate to get participants for (null is not allowed)ItemQuery
objectInvalidUseOfNullException
- If the bioplate parameter is nullInvalidDataException
public Item getType()
Identifiable
Item
enumeration.SharedData getSharedParent()
ChildItem
ChildItem.initPermissions(int, int)
method to calculate
the logged in user's permissions for the child item.getSharedParent
in class ChildItem<BioPlateEventParticipantData>
void initPermissions(int granted, int denied) throws BaseException
ChildItem
ChildItem.getPermissionForWriteDeleteAndCreate()
method
for the parent, WRITE, DELETE and CREATE permission
is granted.initPermissions
in class ChildItem<BioPlateEventParticipantData>
granted
- Permissions that have been granted by the subclassdenied
- Permissions that have been denied by the subclassBaseException
- If the permissions couldn't be initialisedvoid onBeforeCommit(Transactional.Action action) throws BaseException
BasicItem
Transactional
item and on
all items if the action is Transactional.Action.CREATE
or Transactional.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)
.onBeforeCommit
in class BasicItem<BioPlateEventParticipantData>
BaseException
- If there is an errorTransactional
,
Developer documentation: Transactions,
Developer documentation: Coding rules and guidelines for item classespublic BioPlate getBioPlate() throws PermissionDeniedException, BaseException
BioPlate
.PermissionDeniedException
- If the logged in user doesn't have
read permission for the bioplateBaseException
- If there is another errorpublic BioPlateEvent getEvent() throws PermissionDeniedException, BaseException
BioPlateEvent
.PermissionDeniedException
- If the logged in user doesn't have
read permission for the eventBaseException
- If there is another errorpublic java.lang.String getRole()
public void setRole(java.lang.String role)
public int getIndex()
public void setIndex(int index)