Class InitializeCalendarObserver
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.workspaces.project.observers.AbstractInitializeProjectObserver
-
- org.ametys.plugins.workspaces.project.observers.InitializeCalendarObserver
-
- All Implemented Interfaces:
Observer
,LogEnabled
,PluginAware
,Configurable
,Serviceable
public class InitializeCalendarObserver extends AbstractInitializeProjectObserver implements Configurable
Initialize the calendar when a project is created
-
-
Field Summary
Fields Modifier and Type Field Description protected WorkspaceCalendarDAO
_calendarDAO
Workspace Calendar DAOprivate String
_color
private I18nizableText
_description
protected I18nUtils
_i18nUtils
The i18n utils.protected WorkspaceModuleExtensionPoint
_moduleEP
Workspace Module Extension Pointprivate String
_pluginName
private I18nizableText
_templateDesc
private I18nizableText
_title
private String
_visibility
private String
_workflowName
-
Fields inherited from class org.ametys.plugins.workspaces.project.observers.AbstractInitializeProjectObserver
_projectManager
-
Fields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description InitializeCalendarObserver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
_hasCalendar(CalendarWorkspaceModule calendarModule, Project project)
void
configure(Configuration configuration)
protected void
doObserve(Event event, Map<String,Object> transientVars, Site site, Project project)
This method will be called byObserver.observe(Event, Map)
when there is a project on this siteprotected String
getLang(Project project)
Get the lang for this project, or fr if none foundint
getPriority(Event event)
Retrieves the priority to observe this event.
This can be used to process a supported event before others observers.void
service(ServiceManager manager)
void
setPluginInfo(String pluginName, String featureName, String id)
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.-
Methods inherited from class org.ametys.plugins.workspaces.project.observers.AbstractInitializeProjectObserver
observe, supports
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_calendarDAO
protected WorkspaceCalendarDAO _calendarDAO
Workspace Calendar DAO
-
_moduleEP
protected WorkspaceModuleExtensionPoint _moduleEP
Workspace Module Extension Point
-
_i18nUtils
protected I18nUtils _i18nUtils
The i18n utils.
-
_pluginName
private String _pluginName
-
_templateDesc
private I18nizableText _templateDesc
-
_visibility
private String _visibility
-
_workflowName
private String _workflowName
-
_title
private I18nizableText _title
-
_description
private I18nizableText _description
-
-
Constructor Detail
-
InitializeCalendarObserver
public InitializeCalendarObserver()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractInitializeProjectObserver
- Throws:
ServiceException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
getPriority
public int getPriority(Event event)
Description copied from interface:Observer
Retrieves the priority to observe this event.
This can be used to process a supported event before others observers.- Specified by:
getPriority
in interfaceObserver
- Overrides:
getPriority
in classAbstractInitializeProjectObserver
- Parameters:
event
- the event.- Returns:
- the priority where 0 the max priority and Integer.MAX_VALUE the min priority.
-
doObserve
protected void doObserve(Event event, Map<String,Object> transientVars, Site site, Project project) throws Exception
Description copied from class:AbstractInitializeProjectObserver
This method will be called byObserver.observe(Event, Map)
when there is a project on this site- Specified by:
doObserve
in classAbstractInitializeProjectObserver
- Parameters:
event
- the eventtransientVars
- transientVars passed from one Observer to another when processing a single Event. This may allow optimizations between observers.site
- the site impactedproject
- the project impacted- Throws:
Exception
- something went wrong
-
_hasCalendar
private boolean _hasCalendar(CalendarWorkspaceModule calendarModule, Project project)
-
getLang
protected String getLang(Project project)
Get the lang for this project, or fr if none found- Parameters:
project
- the project to check- Returns:
- a lang in this project
-
setPluginInfo
public void setPluginInfo(String pluginName, String featureName, String id)
Description copied from interface:PluginAware
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.- Specified by:
setPluginInfo
in interfacePluginAware
- Parameters:
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this component
-
-