public class ClientDefaultSetting extends Setting
Modifier and Type | Field and Description |
---|---|
private static QueryRuntimeFilter |
RUNTIME_FILTER
This filter will only return items if the logged in user has
generic read permission to clients.
|
static Item |
TYPE
The type of item represented by this class.
|
MAX_NAME_LENGTH, MAX_VALUE_LENGTH
Constructor and Description |
---|
ClientDefaultSetting(ClientDefaultSettingData data) |
Modifier and Type | Method and Description |
---|---|
static ClientDefaultSetting |
getById(DbControl dc,
int id)
Get a
ClientDefaultSetting item when you know the ID. |
Client |
getClient()
Get the client application this setting is valid for.
|
(package private) ClientDefaultSettingData |
getData()
Get the
BasicData object that holds all data for this item. |
static ClientDefaultSetting |
getNew(DbControl dc,
Client client,
String name,
String value)
Create a new
ClientDefaultSetting item. |
static ItemQuery<ClientDefaultSetting> |
getQuery(Client client)
Get a query object configured to retrieve
default settings for the specified client application.
|
Item |
getType()
Get the type of item represented by the object.
|
(package private) void |
initPermissions(int granted,
int denied)
READ permission is granted if the logged in user has READ permission to the
client application.
|
(package private) void |
setClient(Client client)
Set the client application this setting is valid for.
|
addAnnotatableParents, addUsingItems, addUsingItems, breakCircularReferences, checkBatchAnnotatableUsage, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, validate
public static final Item TYPE
Item.CLIENTDEFAULTSETTING
,
getType()
private static final QueryRuntimeFilter RUNTIME_FILTER
ClientDefaultSetting(ClientDefaultSettingData data)
public static ClientDefaultSetting getNew(DbControl dc, Client client, String name, String value) throws BaseException
ClientDefaultSetting
item.dc
- The DbControl
which will be used for
permission checking and database accessclient
- The Client
which this should be a default setting forname
- The name of the settingvalue
- The value of the settingClientDefaultSetting
itemBaseException
- If there is an errorClient.newDefaultSetting(String,String)
public static ClientDefaultSetting getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
ClientDefaultSetting
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 loadClientDefaultSetting
itemItemNotFoundException
- If an item with the specified
ID is not foundPermissionDeniedException
- If the logged in user doesn't
have Permission.READ
permission to the itemBaseException
- If there is another errorpublic static ItemQuery<ClientDefaultSetting> getQuery(Client client)
client
- The client to retreive settings for, null is allowed if
the logged in user has generic READ permission for clients in which case
all settings will be returnedItemQuery
objectClient.getDefaultSettings()
ClientDefaultSettingData getData()
BasicItem
BasicData
object that holds all data for this item.public Item getType()
Identifiable
Item
enumeration.void initPermissions(int granted, int denied) throws BaseException
initPermissions
in class Setting
granted
- Permissions that have been granted by the subclassdenied
- Permissions that have been denied by the subclassBaseException
- If the permissions couldn't be initialisedpublic Client getClient() throws PermissionDeniedException, BaseException
Client
itemPermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permissionBaseException
- If there is another errorvoid setClient(Client client) throws PermissionDeniedException, InvalidDataException
InvalidDataException
- If the client is nullPermissionDeniedException