Package net.sf.basedb.core
Class RootRawBioAssay
java.lang.Object
net.sf.basedb.core.BasicItem
net.sf.basedb.core.ChildItem
net.sf.basedb.core.RootRawBioAssay
- All Implemented Interfaces:
AccessControlled
,Annotatable
,Identifiable
,Nameable
Represents the use of a raw bioassay in an experiment. Except
for keeping the link between the experiment and raw bioassay
the main purpose of this class is to make it possible to store
experimental factor values as annotations (primary or inherited)
without "contaminating" the raw bioassay and without problems
with access permissions. Access permissions for this item is
follows that of the experiment it belongs to.
- Since:
- 3.6
- Author:
- nicklas
-
Field Summary
Fields inherited from interface net.sf.basedb.core.Nameable
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
-
Constructor Summary
ConstructorDescriptionCreates a new root raw bioassay item from the given data. -
Method Summary
Modifier and TypeMethodDescriptionGet the raw bioassay.Get the annotation set containing the annotations for this item.static RootRawBioAssay
Get aRootRawBioAssay
item when you know the id.(package private) RootRawBioAssayData
getData()
Get theBasicData
object that holds all data for this item.Get the description for the item.Get the experiment this root raw bioassay belongs to.getName()
Get the name of the item.(package private) Permission
WRITE permission is required to be able to manage root raw bioassays.A protcol used in the creation of an item that is used to attach annotations for the protocol parameters.(package private) static ItemQuery<RootRawBioAssay>
getQuery()
Get a query configured to retrieve raw bioassays.Get the raw bioassay this root raw bioassay is representing.(package private) SharedData
Get the experiment.getType()
Get the type of item represented by the object.(package private) void
initPermissions
(int granted, int denied) Deny DELETE permission.boolean
Check if this item has an annotation set.void
Remove all annotations from this item, by deleting the annotation set.void
setDescription
(String description) Set the description for the item.void
Set the name of the item.Methods inherited from class net.sf.basedb.core.ChildItem
getPermissionForUse, 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, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, validate
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.sf.basedb.core.AccessControlled
checkPermission, getPermissions, hasPermission
Methods inherited from interface net.sf.basedb.core.Identifiable
getId, getVersion
-
Field Details
-
TYPE
The type of item represented by this class.- See Also:
-
-
Constructor Details
-
RootRawBioAssay
RootRawBioAssay(RootRawBioAssayData data) Creates a new root raw bioassay item from the given data.- Parameters:
data
- the data
-
-
Method Details
-
getById
public static RootRawBioAssay getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException Get aRootRawBioAssay
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
RootRawBioAssay
item - Throws:
ItemNotFoundException
- If an item with the specified id is not foundPermissionDeniedException
- If the logged in user doesn't havePermission.READ
permission to the itemBaseException
- If there is another error
-
getQuery
Get a query configured to retrieve raw bioassays.- Returns:
- An
ItemQuery
object
-
getData
RootRawBioAssayData 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.- Specified by:
getType
in interfaceIdentifiable
- Returns:
- A value indicating the type of item
-
getAnnotationSet
Description copied from interface:Annotatable
Get the annotation set containing the annotations for this item. If the item doesn't have any annotations a new annotation set is created and automatically saved to the database whenDbControl.commit()
is called. To check if an item has annotations without creating a new annotation set use theAnnotatable.isAnnotated()
method.- Specified by:
getAnnotationSet
in interfaceAnnotatable
- Returns:
- An
AnnotationSet
- Throws:
PermissionDeniedException
- If the logged in user doesn't have enough permissionsBaseException
- If there is another error
-
isAnnotated
public boolean isAnnotated()Description copied from interface:Annotatable
Check if this item has an annotation set. The annotation set may be empty.- Specified by:
isAnnotated
in interfaceAnnotatable
- Returns:
- TRUE if an annotation set exists, FALSE otherwise
-
removeAnnotations
Description copied from interface:Annotatable
Remove all annotations from this item, by deleting the annotation set.- Specified by:
removeAnnotations
in interfaceAnnotatable
- Throws:
PermissionDeniedException
- If the logged in user doesn't have write permissionBaseException
- If there is another error
-
getProtocol
Description copied from interface:Annotatable
A protcol used in the creation of an item that is used to attach annotations for the protocol parameters.- Specified by:
getProtocol
in interfaceAnnotatable
- Returns:
- A protocol or null if the protocol is unknown
-
getAnnotatableParents
Get the raw bioassay.- Specified by:
getAnnotatableParents
in interfaceAnnotatable
- Returns:
- A set containing annotatable items, or null
- Throws:
BaseException
- If there is an error
-
initPermissions
Deny DELETE permission. Root raw bioAssays are automatically deleted when the parent experiment is deleted or by callingExperiment.removeRawBioAssay(RawBioAssay)
- 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
-
getPermissionForWriteDeleteAndCreate
Permission getPermissionForWriteDeleteAndCreate()WRITE permission is required to be able to manage root raw bioassays.- Overrides:
getPermissionForWriteDeleteAndCreate
in classChildItem
-
getName
Description copied from interface:Nameable
Get the name of the item. -
setName
Description copied from interface:Nameable
Set the name of the item. The name cannot be null and mustn't be longer than the value specified by theNameable.MAX_NAME_LENGTH
constant.- Specified by:
setName
in interfaceNameable
- Parameters:
name
- The new name for the item- Throws:
PermissionDeniedException
- If the logged in user doesn't have write permissionInvalidDataException
- If the name is null or longer than specified by theNameable.MAX_NAME_LENGTH
constant
-
getDescription
Description copied from interface:Nameable
Get the description for the item.- Specified by:
getDescription
in interfaceNameable
- Returns:
- A
String
with a description of the item
-
setDescription
public void setDescription(String description) throws PermissionDeniedException, InvalidDataException Description copied from interface:Nameable
Set the description for the item. The description can be null but mustn't be longer than the value specified by theNameable.MAX_DESCRIPTION_LENGTH
constant.- Specified by:
setDescription
in interfaceNameable
- Parameters:
description
- The new description for the item- Throws:
PermissionDeniedException
- If the logged in user doesn't have write permissionInvalidDataException
- If the description longer than specified by theNameable.MAX_DESCRIPTION_LENGTH
constant
-
getExperiment
Get the experiment this root raw bioassay belongs to.- Returns:
- An
Experiment
object - Throws:
PermissionDeniedException
- If the logged in user doesn't have read permission to the experimentBaseException
- If there is another error
-
getRawBioAssay
Get the raw bioassay this root raw bioassay is representing.- Returns:
- A
RawBioAssay
object - Throws:
PermissionDeniedException
- If the logged in user doesn't have read permission to the bioassaysetBaseException
- If there is another error
-