public class ActivityDefinition extends NoteTemplateDefinition
An ActivityDefinition is a special kind of a template definition which defines an activity or activity type.
Activities result from actions which were conducted by a user and are visualized by a template note with that user being the author. The different types of actions like creating a topic or editing the permissions are modeled by distinctive activities which are instances of the activity definition with a unique ID (the templateId).
As soon as an ActivityDefiniton is added to the
ActivityService
activity messages for that
type can be created. Activity messages are template notes which have the templateId of the
definition and additionally have a note property that marks the note as an activity.
The ActivityDefinition defines the default properties of an activity and the activity messages.
Some of these settings can be overwritten by an ActivityConfiguration
with the same
identifier (templateId). The definition is only available as long as it is registered to the
ActivityService which is usually the time the providing plugin is deployed. The configuration on
the other hand can be persisted.
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_DELETABLE_BY_USER
the default value for all definitions that do not set the deletableByUser flag
|
Constructor and Description |
---|
ActivityDefinition(String templateId,
boolean external,
boolean configurablePerTopic,
boolean isDeactivatableByManager)
Create a new activity template definition.
|
ActivityDefinition(String templateId,
LocalizedMessage templateName,
LocalizedMessage template,
boolean external,
boolean configurablePerTopic)
Create a new activity template definition with a default expiration timeout of 180 days.
|
ActivityDefinition(String templateId,
LocalizedMessage templateName,
LocalizedMessage template,
boolean external,
boolean configurablePerTopic,
boolean isDeactivatableByManager)
Create a new activity template definition with a default expiration timeout of 180 days.
|
ActivityDefinition(String templateId,
LocalizedMessage templateName,
LocalizedMessage template,
long expirationTimeout,
boolean external,
boolean configurablePerTopic)
Create a new activity template definition.
|
ActivityDefinition(String templateId,
LocalizedMessage templateName,
LocalizedMessage template,
long expirationTimeout,
boolean external,
boolean configurablePerTopic,
boolean isDeactivatableByManager)
Create a new activity template definition.
|
ActivityDefinition(String templateId,
long expirationTimeout,
boolean external,
boolean configurablePerTopic,
boolean isDeactivatableByManager)
Create a new activity template definition.
|
Modifier and Type | Method and Description |
---|---|
LocalizedMessage |
getDescription() |
String |
getStaticName() |
boolean |
isActive() |
boolean |
isConfigurablePerTopic() |
boolean |
isDeactivatableByManager()
Return whether the client manager should be allowed to deactivate the activity.
|
boolean |
isDeletable() |
boolean |
isDeletableByUser() |
boolean |
isExternal() |
void |
setActive(boolean active)
Set whether the activity should be active.
|
void |
setDeactivatableByManager(boolean deactivatable)
Set whether the client manager should be allowed to deactivate the activity.
|
void |
setDeletable(boolean isDeletable) |
void |
setDeletableByUser(boolean deletableByUser)
Set whether authorized users are allowed to delete the messages of this activity.
|
void |
setDescription(LocalizedMessage description)
Set the description of the activity.
|
void |
setStaticName(String staticName)
Set the display name of the activity which should be shown when the localized name is not
accessible anymore, for example after the definition was removed.
|
addTemplate, getExpirationTimeout, getTemplate, getTemplate, getTemplateId, getTemplateName, hasTemplate, removeTemplate, setExpirationTimeout, setPropertiesValidator, validateProperties
public static final boolean DEFAULT_DELETABLE_BY_USER
isDeletableByUser()
,
Constant Field Valuespublic ActivityDefinition(String templateId, boolean external, boolean configurablePerTopic, boolean isDeactivatableByManager)
templateId
- an ID which uniquely identifies the activityexternal
- whether activity messages of this type are created by external systemsconfigurablePerTopic
- whether the activity can be activated or deactivated per topic by the topic
managerisDeactivatableByManager
- Set to true, if this activity is deactivatable.public ActivityDefinition(String templateId, LocalizedMessage templateName, LocalizedMessage template, boolean external, boolean configurablePerTopic)
templateId
- an ID which uniquely identifies the activitytemplateName
- a localizable name of the activitytemplate
- the actual template. This will be the default template.external
- whether activity messages of this type are created by external systemsconfigurablePerTopic
- whether the activity can be activated or deactivated per topic by the topic
managerpublic ActivityDefinition(String templateId, LocalizedMessage templateName, LocalizedMessage template, boolean external, boolean configurablePerTopic, boolean isDeactivatableByManager)
templateId
- an ID which uniquely identifies the activitytemplateName
- a localizable name of the activitytemplate
- the actual template. This will be the default template.external
- whether activity messages of this type are created by external systemsconfigurablePerTopic
- whether the activity can be activated or deactivated per topic by the topic
managerisDeactivatableByManager
- Set to true, if this activity is deactivatable.public ActivityDefinition(String templateId, LocalizedMessage templateName, LocalizedMessage template, long expirationTimeout, boolean external, boolean configurablePerTopic)
templateId
- an ID which uniquely identifies the activitytemplateName
- a localizable name of the activitytemplate
- the actual template. This will be the default template.expirationTimeout
- a timeout in milliseconds after which activity messages should expireexternal
- whether activity messages of this type are created by external systemsconfigurablePerTopic
- whether the activity can be activated or deactivated per topic by the topic
managerpublic ActivityDefinition(String templateId, LocalizedMessage templateName, LocalizedMessage template, long expirationTimeout, boolean external, boolean configurablePerTopic, boolean isDeactivatableByManager)
templateId
- an ID which uniquely identifies the activitytemplateName
- a localizable name of the activitytemplate
- the actual template. This will be the default template.expirationTimeout
- a timeout in milliseconds after which activity messages should expireexternal
- whether activity messages of this type are created by external systemsconfigurablePerTopic
- whether the activity can be activated or deactivated per topic by the topic
managerisDeactivatableByManager
- Set to true, if this activity is deactivatable.public ActivityDefinition(String templateId, long expirationTimeout, boolean external, boolean configurablePerTopic, boolean isDeactivatableByManager)
templateId
- an ID which uniquely identifies the activityexpirationTimeout
- a timeout in milliseconds after which activity messages should expireexternal
- whether activity messages of this type are created by external systemsconfigurablePerTopic
- whether the activity can be activated or deactivated per topic by the topic
managerisDeactivatableByManager
- Set to true, if this activity is deactivatable.public LocalizedMessage getDescription()
public String getStaticName()
public boolean isActive()
ActivityConfiguration.isActive()
public boolean isConfigurablePerTopic()
public boolean isDeactivatableByManager()
public boolean isDeletable()
public boolean isDeletableByUser()
DEFAULT_DELETABLE_BY_USER
public boolean isExternal()
public void setActive(boolean active)
active
- true if the activity should be active, false otherwiseActivityConfiguration.isActive()
public void setDeactivatableByManager(boolean deactivatable)
deactivatable
- true if the client manager should be allowed to deactivate the activity, false
otherwisepublic void setDeletable(boolean isDeletable)
isDeletable
- the isDeletable to setpublic void setDeletableByUser(boolean deletableByUser)
DEFAULT_DELETABLE_BY_USER
deletableByUser
- true if authorized users are allowed to delete the messages of the activity, false
otherwisepublic void setDescription(LocalizedMessage description)
description
- the localized description of the activitypublic void setStaticName(String staticName)
staticName
- the display nameCopyright © 2019 Communote team. All rights reserved.