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_calendarDAOWorkspace Calendar DAOprivate String_colorprivate I18nizableText_descriptionprotected I18nUtils_i18nUtilsThe i18n utils.protected WorkspaceModuleExtensionPoint_moduleEPWorkspace Module Extension Pointprivate String_pluginNameprivate I18nizableText_templateDescprivate I18nizableText_titleprivate String_visibilityprivate 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)voidconfigure(Configuration configuration)protected voiddoObserve(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 StringgetLang(Project project)Get the lang for this project, or fr if none foundintgetPriority(Event event)Retrieves the priority to observe this event.
This can be used to process a supported event before others observers.voidservice(ServiceManager manager)voidsetPluginInfo(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:
servicein interfaceServiceable- Overrides:
servicein classAbstractInitializeProjectObserver- Throws:
ServiceException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
getPriority
public int getPriority(Event event)
Description copied from interface:ObserverRetrieves the priority to observe this event.
This can be used to process a supported event before others observers.- Specified by:
getPriorityin interfaceObserver- Overrides:
getPriorityin 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:AbstractInitializeProjectObserverThis method will be called byObserver.observe(Event, Map)when there is a project on this site- Specified by:
doObservein 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:PluginAwareSets 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:
setPluginInfoin 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
-
-