Class InitializeProjectSitemapObserver
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.project.observers.AbstractInitializeProjectObserver
org.ametys.plugins.workspaces.project.observers.InitializeProjectSitemapObserver
- All Implemented Interfaces:
Observer
,LogEnabled
,PluginAware
,Serviceable
Initializes all project workspace pages when a sitemap is created.
-
Field Summary
Modifier and TypeFieldDescriptionprotected CurrentUserProvider
Current user providerprotected String
The i18n catalogue.protected I18nUtils
The i18n utils.protected ObservationManager
The observation manager.protected String
The plugin name.protected ServiceExtensionPoint
The service extension point.protected SkinsManager
The skins manager.protected SourceResolver
Source resoverprotected WorkflowProvider
The workflow providerFields 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
-
Method Summary
Modifier and TypeMethodDescriptionprotected ModifiablePage
_createPage
(Sitemap sitemap, String name, I18nizableText i18nTitle) Create a new page if not already existsprotected void
_initializeIndexPage
(Project project, ModifiablePage indexPage) Initialize the index page.protected void
_initializeIndexPage
(Project project, Skin skin, ModifiablePage indexPage, Source cfgFile) Initialize the index page from a configuration fileprotected void
_initializeSitemap
(Sitemap sitemap, Project project) Initialize the given sitemap.void
This method will be called byObserver.observe(Event, Map)
when there is a project on this sitevoid
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
getPriority, observe, supports
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_i18nUtils
The i18n utils. -
_observationManager
The observation manager. -
_skinsManager
The skins manager. -
_currentUserProvider
Current user provider -
_serviceEP
The service extension point. -
_pluginName
The plugin name. -
_i18nCatalogue
The i18n catalogue. -
_workflowProvider
The workflow provider -
_sourceResolver
Source resover
-
-
Constructor Details
-
InitializeProjectSitemapObserver
public InitializeProjectSitemapObserver()
-
-
Method Details
-
setPluginInfo
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.- Parameters:
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this component
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractInitializeProjectObserver
- Throws:
ServiceException
-
doObserve
public void doObserve(Event event, Map<String, Object> transientVars, Site site, Project project) throws ExceptionDescription 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
-
_initializeSitemap
Initialize the given sitemap.- Parameters:
sitemap
- the Sitemap object.project
- the corresponding project
-
_createPage
Create a new page if not already exists- Parameters:
sitemap
- The sitemap where the page will be createdname
- The page's namei18nTitle
- The page's title- Returns:
- the created page or
null
if page already exists
-
_initializeIndexPage
Initialize the index page.- Parameters:
project
- The projectindexPage
- the index page.
-
_initializeIndexPage
protected void _initializeIndexPage(Project project, Skin skin, ModifiablePage indexPage, Source cfgFile) Initialize the index page from a configuration file- Parameters:
project
- the projectskin
- the skinindexPage
- the index pagecfgFile
- the configuration file
-