public class Help extends ChildItem implements Nameable
Modifier and Type | Field and Description |
---|---|
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.
|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
Constructor and Description |
---|
Help(HelpData data)
Creates a new help item
|
Modifier and Type | Method and Description |
---|---|
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.
|
(package private) HelpData |
getData()
Get the
BasicData object that holds all data for this item. |
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.
|
getPermissionForUse, getPermissionForWriteDeleteAndCreate, getPluginPermissions, initPermissions
addAnnotatableParents, addUsingItems, addUsingItems, breakCircularReferences, checkBatchAnnotatableUsage, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getVersion
checkPermission, getPermissions, hasPermission
public static final Item TYPE
public static final int MAX_EXTERNAL_ID_LENGTH
setExternalId(String)
method to avoid
exceptions.private static final QueryRuntimeFilter RUNTIME_FILTER
Help(HelpData data)
data
- the datapublic 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 textClientDefaultSetting
itemBaseException
- 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 loadHelp
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<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 returnedItemQuery
objectClient.getHelp()
HelpData getData()
BasicItem
BasicData
object that holds all data for this item.public Item getType()
Identifiable
Item
enumeration.getType
in interface Identifiable
public String getName()
Nameable
public void setName(String name) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_NAME_LENGTH
constant.setName
in interface Nameable
name
- The new name for the itemPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- 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 itemPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- 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
public 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
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 itemPermissionDeniedException
- If the logged in user doesn't have
write permissionInvalidDataException
- If the new value is null or longer than
MAX_EXTERNAL_ID_LENGTH