|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.BasicItem<D> net.sf.basedb.core.OwnedItem<D> net.sf.basedb.core.SharedItem<D>
public abstract class SharedItem<D extends SharedData>
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
Shareable
Field Summary | |
---|---|
private boolean |
itemKeySet
|
private boolean |
projectKeySet
|
Constructor Summary | |
---|---|
SharedItem(D sharedData)
|
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. |
(package private) void |
initPermissions(int granted,
int denied)
Grant permissions according to the item and project keys. |
boolean |
isShared()
Check if this item has been shared or not. |
(package private) void |
onBeforeCommit(Transactional.Action action)
If a project is active, automatically share the new item according to the settings of that project, unless a project or item key has been explicitely set (including null). |
void |
setItemKey(ItemKey itemKey)
Set the ItemKey for this item. |
void |
setProjectKey(ProjectKey projectKey)
Set the ProjectKey for this item. |
(package private) SharedItemInfo |
toTransferable(SharedItemInfo info)
|
Methods inherited from class net.sf.basedb.core.OwnedItem |
---|
getOwner, isOwner, setOwner, takeOwnership, toTransferable |
Methods inherited from class net.sf.basedb.core.BasicItem |
---|
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sf.basedb.core.Ownable |
---|
getOwner, isOwner, setOwner, takeOwnership |
Methods inherited from interface net.sf.basedb.core.Identifiable |
---|
getId, getType, getVersion |
Methods inherited from interface net.sf.basedb.core.AccessControlled |
---|
checkPermission, getPermissions, hasPermission |
Field Detail |
---|
private boolean projectKeySet
private boolean itemKeySet
Constructor Detail |
---|
SharedItem(D sharedData)
Method Detail |
---|
public ItemKey getItemKey() throws PermissionDeniedException, BaseException
Shareable
ItemKey
that is used to share this item to users
and groups.
getItemKey
in interface Shareable
ItemKey
object
PermissionDeniedException
- If the logged in user doesn't
have read permission to the key
BaseException
- If there is another errorpublic void setItemKey(ItemKey itemKey) throws PermissionDeniedException
Shareable
ItemKey
for this item.
setItemKey
in interface Shareable
itemKey
- The new item key for the item, or null to stop
sharing this item
PermissionDeniedException
- If the logged in user doesn't
have permission to change the key on the itempublic ProjectKey getProjectKey() throws PermissionDeniedException, BaseException
Shareable
ProjectKey
that is used to share this item to projects.
getProjectKey
in interface Shareable
ProjectKey
object
PermissionDeniedException
- If the logged in user doesn't
have read permission to the key
BaseException
- If there is another errorpublic void setProjectKey(ProjectKey projectKey) throws PermissionDeniedException
Shareable
ProjectKey
for this item.
setProjectKey
in interface Shareable
projectKey
- The new project key for the item, or null to stop
sharing this item
PermissionDeniedException
- If the logged in user doesn't
have permission to change the key on the itempublic boolean isShared()
Shareable
isShared
in interface Shareable
void onBeforeCommit(Transactional.Action action) throws NotLoggedInException, BaseException
onBeforeCommit
in class OwnedItem<D extends SharedData>
BaseException
- If there is another error
NotLoggedInException
- If no user is logged inTransactional
,
Core API overview - Transaction handling,
Coding rules and guidelines for item classesvoid initPermissions(int granted, int denied) throws BaseException
initPermissions
in class OwnedItem<D extends SharedData>
granted
- Permissions that have been granted by the subclassdenied
- Permissions that have been denied by the subclass
BaseException
- If the permissions couldn't be initialisedSharedItemInfo toTransferable(SharedItemInfo info)
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |