public class ReporterCloneTemplate extends CommonItem implements Registered
Experiment.getReporterCloneBatcher(DbControl)
.
The reporter internal and external id
are always cloned and should not be part of the template. The cloning operation
also creates a locked copy of the template, so that it is possible to make modifications
to the original template without affecting the cloned data.Modifier and Type | Field and Description |
---|---|
static Item |
TYPE
The type of item represented by this class.
|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
Constructor and Description |
---|
ReporterCloneTemplate(ReporterCloneTemplateData data) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
addBytes(long bytes) |
void |
addClonableProperty(ClonableProperty property)
Add a clonable property to this template.
|
(package private) static ReporterCloneTemplateData |
createAllCopy(java.lang.String name) |
(package private) ReporterCloneTemplateData |
createLockedCopy()
Create a deep clone of this template.
|
static ReporterCloneTemplate |
getById(DbControl dc,
int id)
Get a reporter clone template item when you know the id.
|
long |
getBytes()
Get the number of bytes the cloned reporter information use in
the database.
|
java.util.List<ClonableProperty> |
getClonableProperties()
Get a list with all clonable properties in this template.
|
(package private) static java.util.List<ClonableProperty> |
getClonableProperties(ReporterCloneTemplateData template) |
ClonableProperty |
getClonableProperty(java.lang.String propertyName)
Get information about a clonable property that is included in this template.
|
(package private) ReporterCloneTemplateData |
getData()
Get the
BasicData object that holds all data for this item. |
java.util.Date |
getEntryDate()
Get the date that the item was registered in the database.
|
static ReporterCloneTemplate |
getNew(DbControl dc)
Create a new reporter clone template item.
|
(package private) PluginPermission |
getPluginPermissions() |
static ItemQuery<ReporterCloneTemplate> |
getQuery()
Get a query that returns reporter clone templates.
|
Item |
getType()
Get the type of item represented by the object.
|
java.util.Set<ItemProxy> |
getUsingItems()
Get all:
Experiment that is using this template
|
boolean |
hasClonableProperty(java.lang.String propertyName)
Check if this template contains a clonable property with
the given name.
|
(package private) void |
initPermissions(int granted,
int denied)
Locked templates are READ-able by all, and everything else
is denied.
|
boolean |
isLocked()
If the template is locked it means that it is used by an experiment
and can't be modified or deleted.
|
boolean |
isUsed()
Check if:
An experiment/virtualdb is using this template
|
void |
removeClonableProperty(java.lang.String propertyName)
Remove the property with the given name from this template
|
void |
setDescription(java.lang.String description)
Allow the description to be changed with RESTRICTED_WRITE
permission.
|
void |
setEntryDate(java.util.Date entryDate)
Set the date the entry was registered in the database.
|
getDescription, getName, getRemovedBy, isRemoved, setName, setRemoved
getItemKey, getProjectKey, isShared, onBeforeCommit, setItemKey, setProjectKey
getOwner, isOwner, setOwner, takeOwnership
addAnnotatableParents, addUsingItems, addUsingItems, breakCircularReferences, checkBatchAnnotatableUsage, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, 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.REPORTERCLONETEMPLATE
,
getType()
ReporterCloneTemplate(ReporterCloneTemplateData data)
public static ReporterCloneTemplate getNew(DbControl dc) throws BaseException
dc
- The DbControl
which will be used for
permission checking and database accessReporterCloneTemplate
itemBaseException
- If there is an errorpublic static ReporterCloneTemplate getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
dc
- The DbControl
which will be used for
permission checking and database access.id
- The id of the item to loadReporterCloneTemplate
itemItemNotFoundException
- If an item with the specified
id is not foundPermissionDeniedException
- If the logged in user doesn't
have Permission.READ
permission to the itemBaseException
- If there is another errorpublic static ItemQuery<ReporterCloneTemplate> getQuery()
ItemQuery
objectReporterCloneTemplateData 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
void initPermissions(int granted, int denied) throws BaseException
initPermissions
in class SharedItem
granted
- Permissions that have been granted by the subclassdenied
- Permissions that have been denied by the subclassBaseException
- If the permissions couldn't be initialisedPluginPermission getPluginPermissions()
getPluginPermissions
in class BasicItem
public boolean isUsed() throws BaseException
isUsed
in class BasicItem
BaseException
- If not able to tell if item is used or not.BasicItem.getUsingItems()
public java.util.Set<ItemProxy> getUsingItems()
getUsingItems
in class BasicItem
BasicItem.addUsingItems(Set, Item, org.hibernate.query.Query)
public java.util.Date getEntryDate()
Registered
getEntryDate
in interface Registered
public void setEntryDate(java.util.Date entryDate)
Registered
setEntryDate
in interface Registered
entryDate
- A date or null to use today's datepublic void setDescription(java.lang.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
constantpublic boolean isLocked()
public long getBytes()
void addBytes(long bytes)
public void addClonableProperty(ClonableProperty property)
property
- Information about the property to include in the
template (null is not allowed)public void removeClonableProperty(java.lang.String propertyName)
propertyName
- The name of a property (null is not allowed)public ClonableProperty getClonableProperty(java.lang.String propertyName)
propertyName
- The name of a propertypublic boolean hasClonableProperty(java.lang.String propertyName)
propertyName
- The property name to checkpublic java.util.List<ClonableProperty> getClonableProperties()
ReporterCloneTemplateData createLockedCopy()
static ReporterCloneTemplateData createAllCopy(java.lang.String name)
static java.util.List<ClonableProperty> getClonableProperties(ReporterCloneTemplateData template)