Interface Shareable

All Superinterfaces:
AccessControlled, Identifiable, Ownable
All Known Implementing Classes:
AnnotatedItem, AnnotationType, AnnotationTypeCategory, ArrayBatch, ArrayDesign, ArraySlide, BioMaterial, BioPlate, BioPlateEvent, BioSource, Client, CommonItem, DerivedBioAssay, Directory, Experiment, Extract, File, FileServer, Formula, Hardware, ItemList, Job, JobAgent, Kit, MeasuredBioMaterial, PermissionTemplate, PhysicalBioAssay, Plate, PlateMapping, PlateType, PluginConfiguration, PluginDefinition, Protocol, RawBioAssay, ReporterCloneTemplate, ReporterList, Sample, SharedItem, Software, Tag

public interface Shareable extends Ownable
An Shareable item is an item which can be shared to other User:s, Group:s and Project:s. Sharing information is stored in ItemKey and ProjectKey objects. The ShareableUtil class provides methods that includes data validation to make it easy to implement this interface.

Reference implementation

public ItemKey getItemKey()
   throws PermissionDeniedException, BaseException
{
   return getDbControl().getItem(ItemKey.class, getData().getItemKey());
}
public void setItemKey(ItemKey itemKey)
   throws PermissionDeniedException
{
   checkPermission(Permission.SET_PERMISSION);
   ShareableUtil.setItemKey(getData(), itemKey);
}
public ProjectKey getProjectKey()
   throws PermissionDeniedException, BaseException
{
   return getDbControl().getItem(ProjectKey.class, getData().getProjectKey());
}
public void setProjectKey(ProjectKey projectKey)
   throws PermissionDeniedException
{
   checkPermission(Permission.SET_PERMISSION);
   ShareableUtil.setProjectKey(getData(), projectKey);
}
public boolean isShared()
{
   return getData().getItemKey() != null || getData().getProjectKey() != null;
}
Version:
2.0
Author:
Nicklas
See Also:
Last modified
$Date: 2009-04-06 14:52:39 +0200 (må, 06 apr 2009) $