public class InitializeProjectSitemapObserver extends AbstractLogEnabled implements Observer, Serviceable, PluginAware, Contextualizable
Modifier and Type | Field and Description |
---|---|
private Context |
_cocoonContext |
protected CurrentUserProvider |
_currentUserProvider
Current user provider
|
protected String |
_i18nCatalogue
The i18n catalogue.
|
protected I18nUtils |
_i18nUtils
The i18n utils.
|
protected ObservationManager |
_observationManager
The observation manager.
|
protected String |
_pluginName
The plugin name.
|
protected ProjectManager |
_projectManager
Workspaces project manager
|
protected ServiceExtensionPoint |
_serviceEP
The service extension point.
|
protected SkinsManager |
_skinsManager
The skins manager.
|
protected WorkflowProvider |
_workflowProvider
The workflow provider
|
MAX_PRIORITY, MIN_PRIORITY
Constructor and Description |
---|
InitializeProjectSitemapObserver() |
Modifier and Type | Method and Description |
---|---|
protected ModifiablePage |
_createPage(Sitemap sitemap,
String name,
I18nizableText i18nTitle)
Create a new page if not already exists
|
protected void |
_initializeIndexPage(Project project,
ModifiablePage indexPage)
Initialize the index page.
|
protected void |
_initializeIndexPage(Project project,
Skin skin,
ModifiablePage indexPage,
File cfgFile)
Initialize the index page from a configuration file
|
protected void |
_initializeSitemap(Sitemap sitemap,
Project project)
Initialize the given sitemap.
|
private void |
_setServiceParameters(Collection<ModelItem> modelItems,
ModifiableModelAwareDataHolder dataHolder,
Configuration paramsConf,
String lang) |
void |
contextualize(Context context) |
int |
getPriority(Event event)
Retrieves the priority to observe this event.
This can be used to process a supported event before others observers. |
void |
observe(Event event,
Map<String,Object> transientVars)
Observes an event.
|
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. |
boolean |
supports(Event event)
Checks if the event is supported.
|
getLogger, setLogger
protected ProjectManager _projectManager
protected I18nUtils _i18nUtils
protected ObservationManager _observationManager
protected SkinsManager _skinsManager
protected CurrentUserProvider _currentUserProvider
protected ServiceExtensionPoint _serviceEP
protected String _pluginName
protected String _i18nCatalogue
protected WorkflowProvider _workflowProvider
private Context _cocoonContext
public InitializeProjectSitemapObserver()
public void setPluginInfo(String pluginName, String featureName, String id)
PluginAware
setPluginInfo
in interface PluginAware
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this componentpublic void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public boolean supports(Event event)
Observer
public int getPriority(Event event)
Observer
getPriority
in interface Observer
event
- the event.public void observe(Event event, Map<String,Object> transientVars) throws Exception
Observer
observe
in interface Observer
event
- the event.transientVars
- transientVars passed from one Observer to another when processing a single Event.
This may allow optimizations between observers.Exception
- if an error occurs.
All exceptions will be logged but not propagated, as the observation mechanism should never fail.protected void _initializeSitemap(Sitemap sitemap, Project project)
sitemap
- the Sitemap object.project
- the corresponding projectprotected ModifiablePage _createPage(Sitemap sitemap, String name, I18nizableText i18nTitle)
sitemap
- The sitemap where the page will be createdname
- The page's namei18nTitle
- The page's titlenull
if page already existsprotected void _initializeIndexPage(Project project, ModifiablePage indexPage)
project
- The projectindexPage
- the index page.protected void _initializeIndexPage(Project project, Skin skin, ModifiablePage indexPage, File cfgFile)
project
- the projectskin
- the skinindexPage
- the index pagecfgFile
- the configuration fileprivate void _setServiceParameters(Collection<ModelItem> modelItems, ModifiableModelAwareDataHolder dataHolder, Configuration paramsConf, String lang) throws ConfigurationException
ConfigurationException