Class AbstractWorkspacesActivityType
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.repository.activities.DefaultActivityType
org.ametys.plugins.workspaces.activities.AbstractWorkspacesActivityType
- All Implemented Interfaces:
ActivityType
,LogEnabled
,PluginAware
,Configurable
,Serviceable
- Direct Known Subclasses:
AbstractProjectsActivityType
,CalendarEventActivityType
,DocumentsActivityType
,MinisiteActivityType
,TasksActivityType
,ThreadsActivityType
Class representing a generic activity type for workspaces
-
Field Summary
Modifier and TypeFieldDescriptionprotected NotificationPreferencesHelper
The notification preference helperprotected ProjectManager
The project managerprotected AmetysObjectResolver
Resolverstatic final String
Constant for project's access JSON key.static final String
Constant for project's category JSON key.static final String
Constant for project's name JSON key.static final String
Constant for project's title JSON key.static final String
Constant for project's url JSON key.Fields inherited from class org.ametys.plugins.repository.activities.DefaultActivityType
_currentUserProvider, _userHelper
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Add the value of item if exists to JSON activity representationadditionnalDataToJSONForClient
(Activity activity) Retrieve data specific to theActivityType
that needs to be serialized but are not stored in theDataHolder
.abstract String
getMailBodyURI
(Activity activity) Get the URI to resolve to get the mail bodyprotected Project
Helper method to retrieve the parent project of an ametys objectabstract Project
getProjectFromEvent
(Event event) Retrieve the project concerned by the event.getSubjectI18nKey
(Activity activity) the subject key Warning : the key parameters are using indexgetSubjectI18nParams
(Activity activity) A list of string that will be used to parameterize the i18n keyabstract AmetysObject
getTargetAmetysObject
(Activity activity) Retrieve the ametys object targeted by this activity.getUsersEmailToNotify
(Activity activity) Get the user affected by this activity that requested to receive direct notificationboolean
isMergeable
(Activity activity1, Activity activity2) Determines if two activities can be mergedvoid
service
(ServiceManager serviceManager) void
setAdditionalActivityData
(Activity activityNode, Map<String, Object> parameters) Add the value specific to the activity type to the activityboolean
Check if an event with an id in the getSupportedEventType should actually leads to the creation of an activityMethods inherited from class org.ametys.plugins.repository.activities.DefaultActivityType
configure, getSupportedEventTypes, mergeActivities, setPluginInfo
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
PROJECT_NAME
Constant for project's name JSON key. The value is aString
.- See Also:
-
PROJECT_TITLE
Constant for project's title JSON key. The value is aString
.- See Also:
-
PROJECT_ACCESS
Constant for project's access JSON key. The value is a boolean.- See Also:
-
PROJECT_URL
Constant for project's url JSON key. The value is aString
.- See Also:
-
PROJECT_CATEGORY
Constant for project's category JSON key. The value is aString
.- See Also:
-
_resolver
Resolver -
_projectManager
The project manager -
_notificationPreferenceHelper
The notification preference helper
-
-
Constructor Details
-
AbstractWorkspacesActivityType
public AbstractWorkspacesActivityType()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classDefaultActivityType
- Throws:
ServiceException
-
setAdditionalActivityData
public void setAdditionalActivityData(Activity activityNode, Map<String, Object> parameters) throws javax.jcr.RepositoryExceptionDescription copied from interface:ActivityType
Add the value specific to the activity type to the activity- Parameters:
activityNode
- the activityparameters
- the activity parameters- Throws:
javax.jcr.RepositoryException
- if an error occurs while manipulating the repository
-
additionnalDataToJSONForClient
Description copied from interface:ActivityType
Retrieve data specific to theActivityType
that needs to be serialized but are not stored in theDataHolder
. Those data will be added to the data of the dataHolder- Parameters:
activity
- the activity to serialize- Returns:
- a json map of the specific data
-
isMergeable
Description copied from interface:ActivityType
Determines if two activities can be merged- Specified by:
isMergeable
in interfaceActivityType
- Overrides:
isMergeable
in classDefaultActivityType
- Parameters:
activity1
- The first activityactivity2
- The second activity- Returns:
- true if the events can be merged
-
_addValueIfExists
protected void _addValueIfExists(Map<String, Object> json, Activity activity, String dataPath, String key) Add the value of item if exists to JSON activity representation- Parameters:
json
- the JSON activityactivity
- the activitydataPath
- the data pathkey
- the JSON key
-
support
Check if an event with an id in the getSupportedEventType should actually leads to the creation of an activity- Parameters:
event
- the event to test- Returns:
- true if an activity should be created
-
getProjectFromEvent
Retrieve the project concerned by the event. the event must be supported by the ActivityType.- Parameters:
event
- an event supported by the activity type- Returns:
- the targeted project
-
getParentProject
Helper method to retrieve the parent project of an ametys object- Parameters:
ao
- the ametys object- Returns:
- the parent project or null if the object doesn't have have project as parent
-
getTargetAmetysObject
Retrieve the ametys object targeted by this activity. This method is intended for right computation purposes.- Parameters:
activity
- the activity- Returns:
- the target
-
getSubjectI18nKey
the subject key Warning : the key parameters are using index- Parameters:
activity
- the activity- Returns:
- the i18nkey
-
getSubjectI18nParams
A list of string that will be used to parameterize the i18n key- Parameters:
activity
- the activity- Returns:
- the list of parameters
-
getMailBodyURI
Get the URI to resolve to get the mail body- Parameters:
activity
- the activity- Returns:
- the uri
-
getUsersEmailToNotify
Get the user affected by this activity that requested to receive direct notification- Parameters:
activity
- the activity- Returns:
- the email of the user to notify
-