|
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.ChildItem<HelpData> net.sf.basedb.core.Help
public class Help
This class is used to represent a help text for a client application.
Field Summary | |
---|---|
static int |
MAX_EXTERNAL_ID_LENGTH
The maximum length of the external id variable that can be stored in the database. |
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. |
Fields inherited from interface net.sf.basedb.core.Nameable |
---|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH |
Constructor Summary | |
---|---|
Help(HelpData data)
Creates a new help item |
Method Summary | |
---|---|
static Help |
getById(DbControl dc,
int id)
Get a Help item when you know the ID. |
Client |
getClient()
Get the client application this setting is valid for. |
String |
getDescription()
Get the description for the item. |
String |
getExternalId()
Get the external id for this Help item. |
String |
getName()
Get the name of the item. |
static Help |
getNew(DbControl dc,
Client client,
String externalId)
Create a new Help item. |
static ItemQuery<Help> |
getQuery(Client client)
Get a query configured to retrieve help texts for the specified client application. |
(package private) SharedData |
getSharedParent()
Get the shareable parent item of this child item. |
Item |
getType()
Get the type of item represented by the object. |
(package private) void |
setClient(Client client)
Set the client application this setting is valid for. |
void |
setDescription(String description)
Set the description for the item. |
void |
setExternalId(String externalId)
Set the external id for this Help item. |
void |
setName(String name)
Set the name of the item. |
Methods inherited from class net.sf.basedb.core.ChildItem |
---|
getPermissionForWriteDeleteAndCreate, getPluginPermissions, initPermissions |
Methods inherited from class net.sf.basedb.core.BasicItem |
---|
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, 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 |
Methods inherited from interface net.sf.basedb.core.Identifiable |
---|
getId, getVersion |
Methods inherited from interface net.sf.basedb.core.AccessControlled |
---|
checkPermission, getPermissions, hasPermission |
Field Detail |
---|
public static final Item TYPE
Item.HELP
,
getType()
public static final int MAX_EXTERNAL_ID_LENGTH
setExternalId(String)
method to avoid
exceptions.
private static final QueryRuntimeFilter RUNTIME_FILTER
Constructor Detail |
---|
Help(HelpData data)
data
- the dataMethod Detail |
---|
public static Help getNew(DbControl dc, Client client, String externalId) throws BaseException
Help
item.
dc
- The DbControl
which will be used for
permission checking and database accessclient
- The Client
which this help text is forexternalId
- A unique string used for quick retrieval of a specific help text
ClientDefaultSetting
item
BaseException
- If there is an errorClient.newHelp(String)
public static Help getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
Help
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
Help
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<Help> getQuery(Client client)
client
- The client to retreive help for, null is allowed if
the logged in user has generic READ permission for clients in which case
all help will be returned
ItemQuery
objectClient.getHelp()
public Item getType()
Identifiable
Item
enumeration.
getType
in interface Identifiable
public String getName()
Nameable
getName
in interface Nameable
String
with the name of the itempublic void setName(String name) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_NAME_LENGTH
constant.
setName
in interface Nameable
name
- The new name for the item
PermissionDeniedException
- If the logged in user doesn't
have write permission
InvalidDataException
- If the name is null or longer
than specified by the Nameable.MAX_NAME_LENGTH
constantpublic String getDescription()
Nameable
getDescription
in interface Nameable
String
with a description of the itempublic void setDescription(String description) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_DESCRIPTION_LENGTH
constant.
setDescription
in interface Nameable
description
- The new description for the item
PermissionDeniedException
- If the logged in user doesn't
have write permission
InvalidDataException
- If the description longer
than specified by the Nameable.MAX_DESCRIPTION_LENGTH
constantSharedData getSharedParent()
ChildItem
ChildItem.initPermissions(int, int)
method to calculate
the logged in user's permissions for the child item.
getSharedParent
in class ChildItem<HelpData>
public Client getClient() throws PermissionDeniedException, BaseException
Client
item
PermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission
BaseException
- If there is another errorvoid setClient(Client client) throws PermissionDeniedException, InvalidDataException
InvalidDataException
- If the client is null
PermissionDeniedException
public String getExternalId()
Help
item.
public void setExternalId(String externalId) throws PermissionDeniedException, InvalidDataException
Help
item. The value
cannot be null and must not be longer than the value specified by
the MAX_EXTERNAL_ID_LENGTH
constant. It must also be a value
that is unique for the client application.
externalId
- The new external id for this item
PermissionDeniedException
- If the logged in user doesn't have
write permission
InvalidDataException
- If the new value is null or longer than
MAX_EXTERNAL_ID_LENGTH
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |