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
public class InitializeProjectSitemapObserver extends AbstractInitializeProjectObserver
Initializes all project workspace pages when a sitemap is created.
-
-
Field Summary
Fields Modifier and Type Field Description protected CurrentUserProvider
_currentUserProvider
Current user providerprotected String
_i18nCatalogue
The i18n catalogue.protected I18nUtils
_i18nUtils
The i18n utils.protected ObservationManager
_observationManager
The observation manager.protected String
_pluginName
The plugin name.protected ServiceExtensionPoint
_serviceEP
The service extension point.protected SkinsManager
_skinsManager
The skins manager.protected SourceResolver
_sourceResolver
Source resoverprotected WorkflowProvider
_workflowProvider
The workflow provider-
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 InitializeProjectSitemapObserver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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.private void
_setServiceParameters(Collection<ModelItem> modelItems, ModifiableModelAwareDataHolder dataHolder, Configuration paramsConf, String lang)
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 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 Detail
-
_i18nUtils
protected I18nUtils _i18nUtils
The i18n utils.
-
_observationManager
protected ObservationManager _observationManager
The observation manager.
-
_skinsManager
protected SkinsManager _skinsManager
The skins manager.
-
_currentUserProvider
protected CurrentUserProvider _currentUserProvider
Current user provider
-
_serviceEP
protected ServiceExtensionPoint _serviceEP
The service extension point.
-
_pluginName
protected String _pluginName
The plugin name.
-
_i18nCatalogue
protected String _i18nCatalogue
The i18n catalogue.
-
_workflowProvider
protected WorkflowProvider _workflowProvider
The workflow provider
-
_sourceResolver
protected SourceResolver _sourceResolver
Source resover
-
-
Constructor Detail
-
InitializeProjectSitemapObserver
public InitializeProjectSitemapObserver()
-
-
Method Detail
-
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.- 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
public void service(ServiceManager manager) throws ServiceException
- 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 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
-
_initializeSitemap
protected void _initializeSitemap(Sitemap sitemap, Project project)
Initialize the given sitemap.- Parameters:
sitemap
- the Sitemap object.project
- the corresponding project
-
_createPage
protected ModifiablePage _createPage(Sitemap sitemap, String name, I18nizableText i18nTitle)
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
protected void _initializeIndexPage(Project project, ModifiablePage indexPage)
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
-
_setServiceParameters
private void _setServiceParameters(Collection<ModelItem> modelItems, ModifiableModelAwareDataHolder dataHolder, Configuration paramsConf, String lang) throws ConfigurationException
- Throws:
ConfigurationException
-
-