|
3.1.1: 2012-03-29 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Shareable
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;
}
SharedItem,
ShareableUtil| 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 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 |
| Method Detail |
|---|
ItemKey getItemKey()
throws PermissionDeniedException,
BaseException
ItemKey that is used to share this item to users
and groups.
ItemKey object
PermissionDeniedException - If the logged in user doesn't
have read permission to the key
BaseException - If there is another error
void setItemKey(ItemKey itemKey)
throws PermissionDeniedException
ItemKey for this item.
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 item
ProjectKey getProjectKey()
throws PermissionDeniedException,
BaseException
ProjectKey that is used to share this item to projects.
ProjectKey object
PermissionDeniedException - If the logged in user doesn't
have read permission to the key
BaseException - If there is another error
void setProjectKey(ProjectKey projectKey)
throws PermissionDeniedException
ProjectKey for this item.
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 itemboolean isShared()
|
3.1.1: 2012-03-29 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||