Last update: 2011-06-23

org.proteios.core
Class SharedItem<D extends SharedData>

java.lang.Object
  extended by org.proteios.core.BasicItem<D>
      extended by org.proteios.core.OwnedItem<D>
          extended by org.proteios.core.SharedItem<D>
All Implemented Interfaces:
AccessControlled, Identifiable, Ownable, Shareable
Direct Known Subclasses:
CommonItem, Directory, PluginDefinition, SeparationMethod

public abstract class SharedItem<D extends SharedData>
extends OwnedItem<D>
implements Shareable

This class inherits from the OwnedItem class and implements the Shareable interface. An Shareable item is an item that can be shared to User:s, Group:s and Project:s

Version:
2.0
Author:
Nicklas
See Also:
Shareable
Last modified
$Date: 2009-04-09 08:48:11 +0200 (Thu, 09 Apr 2009) $

Method Summary
 ItemKey getItemKey()
          Get the ItemKey that is used to share this item to users and groups.
 ProjectKey getProjectKey()
          Get the ProjectKey that is used to share this item to projects.
 boolean isShared()
          Check if this item has been shared or not.
 void setItemKey(ItemKey itemKey)
          Set the ItemKey for this item.
 void setProjectKey(ProjectKey projectKey)
          Set the ProjectKey for this item.
 
Methods inherited from class org.proteios.core.OwnedItem
getOwner, setOwner
 
Methods inherited from class org.proteios.core.BasicItem
checkPermission, equals, getDbControl, getId, getPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.proteios.core.Ownable
getOwner, setOwner
 
Methods inherited from interface org.proteios.core.Identifiable
getId, getType, getVersion
 
Methods inherited from interface org.proteios.core.AccessControlled
checkPermission, hasPermission
 

Method Detail

getItemKey

public ItemKey getItemKey()
                   throws PermissionDeniedException,
                          BaseException
Description copied from interface: Shareable
Get the ItemKey that is used to share this item to users and groups.

Specified by:
getItemKey in interface Shareable
Returns:
The ItemKey object
Throws:
PermissionDeniedException - If the logged in user doesn't have read permission to the key
BaseException - If there is another error

setItemKey

public void setItemKey(ItemKey itemKey)
                throws PermissionDeniedException
Description copied from interface: Shareable
Set the ItemKey for this item.

Specified by:
setItemKey in interface Shareable
Parameters:
itemKey - The new item key for the item, or null to stop sharing this item
Throws:
PermissionDeniedException - If the logged in user doesn't have permission to change the key on the item

getProjectKey

public ProjectKey getProjectKey()
                         throws PermissionDeniedException,
                                BaseException
Description copied from interface: Shareable
Get the ProjectKey that is used to share this item to projects.

Specified by:
getProjectKey in interface Shareable
Returns:
The ProjectKey object
Throws:
PermissionDeniedException - If the logged in user doesn't have read permission to the key
BaseException - If there is another error

setProjectKey

public void setProjectKey(ProjectKey projectKey)
                   throws PermissionDeniedException
Description copied from interface: Shareable
Set the ProjectKey for this item.

Specified by:
setProjectKey in interface Shareable
Parameters:
projectKey - The new project key for the item, or null to stop sharing this item
Throws:
PermissionDeniedException - If the logged in user doesn't have permission to change the key on the item

isShared

public boolean isShared()
Description copied from interface: Shareable
Check if this item has been shared or not.

Specified by:
isShared in interface Shareable
Returns:
TRUE if this item has been shared to a user, group or project

Last update: 2011-06-23