|
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.Setting<UserDefaultSettingData> net.sf.basedb.core.UserDefaultSetting
public class UserDefaultSetting
This class is used to represent a setting valid for a specific user using any client application.
Field Summary | |
---|---|
private static QueryRuntimeFilter |
RUNTIME_FILTER
This filter will only return items if the logged in user has generic read permission to users. |
static Item |
TYPE
The type of item represented by this class. |
Fields inherited from class net.sf.basedb.core.Setting |
---|
MAX_NAME_LENGTH, MAX_VALUE_LENGTH |
Constructor Summary | |
---|---|
UserDefaultSetting(UserDefaultSettingData data)
|
Method Summary | |
---|---|
static UserDefaultSetting |
getById(DbControl dc,
int id)
Get a UserDefaultSetting item when you know the ID. |
static UserDefaultSetting |
getNew(DbControl dc,
User user,
String name,
String value)
Create a new UserDefaultSetting item. |
static ItemQuery<UserDefaultSetting> |
getQuery(User user)
Get a query configured to retrieve default settings for a user. |
Item |
getType()
Get the type of item represented by the object. |
User |
getUser()
Get the user this setting is valid for. |
(package private) void |
initPermissions(int granted,
int denied)
READ permission is granted if the logged in user is the owner of this setting. |
(package private) void |
setUser(User user)
Set the user this setting is valid for. |
Methods inherited from class net.sf.basedb.core.Setting |
---|
getName, getValue, setName, setValue |
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, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Item TYPE
Item.USERDEFAULTSETTING
,
getType()
private static final QueryRuntimeFilter RUNTIME_FILTER
Constructor Detail |
---|
UserDefaultSetting(UserDefaultSettingData data)
Method Detail |
---|
public static UserDefaultSetting getNew(DbControl dc, User user, String name, String value) throws BaseException
UserDefaultSetting
item.
dc
- The DbControl
which will be used for
permission checking and database accessuser
- The User
which this should be a default setting forname
- The name of the settingvalue
- The value of the setting
UserDefaultSetting
item
BaseException
- If there is an errorUser.newDefaultSetting(String,String)
public static UserDefaultSetting getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
UserDefaultSetting
item when you know the ID.
dc
- The DbControl
which will be used for
permission checking and database access.id
- The ID of the item to load
UserDefaultSetting
item
ItemNotFoundException
- If an item with the specified
ID is not found
PermissionDeniedException
- If the logged in user doesn't
have Permission.READ
permission to the item
BaseException
- If there is another errorpublic static ItemQuery<UserDefaultSetting> getQuery(User user)
user
- The user to retreive settings for, null is allowed if
the logged in user has generic READ permission for users in which case
all settings will be returned
ItemQuery
objectUser.getDefaultSettings()
public Item getType()
Identifiable
Item
enumeration.
void initPermissions(int granted, int denied) throws BaseException
initPermissions
in class Setting<UserDefaultSettingData>
granted
- Permissions that have been granted by the subclassdenied
- Permissions that have been denied by the subclass
BaseException
- If the permissions couldn't be initialisedpublic User getUser() throws PermissionDeniedException, BaseException
User
item
PermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission
BaseException
- If there is another errorvoid setUser(User user) throws PermissionDeniedException, InvalidDataException
InvalidDataException
- If the user is null
PermissionDeniedException
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |