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
FieldsModifier and TypeFieldDescriptionprotected CurrentUserProviderCurrent user providerprotected StringThe i18n catalogue.protected I18nUtilsThe i18n utils.protected ObservationManagerThe observation manager.protected StringThe plugin name.protected ServiceExtensionPointThe service extension point.protected SkinsManagerThe skins manager.protected SourceResolverSource resoverFields inherited from class org.ametys.plugins.workspaces.project.observers.AbstractInitializeProjectObserver
_projectManagerFields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY -
Constructor Summary
Constructors -
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.voidThis method will be called byObserver.observe(Event, Map)when there is a project on this sitevoidservice(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
getPriority, observe, supportsMethods 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. -
_sourceResolver
Source resover
-
-
Constructor Details
-
InitializeProjectSitemapObserver
public InitializeProjectSitemapObserver()
-
-
Method Details
-
setPluginInfo
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.- 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:
servicein interfaceServiceable- Overrides:
servicein classAbstractInitializeProjectObserver- Throws:
ServiceException
-
doObserve
public void doObserve(Event event, Map<String, Object> transientVars, Site site, Project project) throws ExceptionDescription 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
-
_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
nullif 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
-