public class InitializeBlogSiteObserver extends AbstractLogEnabled implements Observer, Serviceable, PluginAware
Modifier and Type | Field and Description |
---|---|
protected AmetysObjectResolver |
_ametysResolver
The ametys object resolver.
|
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 ServiceExtensionPoint |
_serviceEP
The service extension point.
|
protected SharedContentManager |
_sharedContentManager
The shared content manager.
|
protected SiteConfigurationExtensionPoint |
_siteConf
The site configuration extension point.
|
protected SkinsManager |
_skinsManager
The skins manager.
|
protected WorkflowProvider |
_workflowProvider
The workflow provider
|
MAX_PRIORITY, MIN_PRIORITY
Constructor and Description |
---|
InitializeBlogSiteObserver() |
Modifier and Type | Method and Description |
---|---|
protected ModifiablePage |
createPage(Sitemap sitemap,
String name,
String title)
Create the blog root page.
|
protected Content |
createProfileContent(String workflowName,
String siteName,
String lang,
String title)
Create a profile content.
|
protected String |
getDefaultXslt(String serviceId)
Get the default value of the XSLT parameter of the given service.
|
int |
getPriority(Event event)
Retrieves the priority to observe this event.
This can be used to process a supported event before others observers. |
protected void |
initializeAsideZone(ModifiablePage page)
Initialize the "aside" zone.
|
protected void |
initializeDefaultZone(ModifiablePage page)
Initialize the default zone.
|
protected void |
initializeIndexAboutZone(ModifiablePage indexPage,
Content profileContent)
Initialize the index page's "about" zone.
|
protected void |
initializeIndexPage(ModifiablePage indexPage,
Content profileContent)
Initialize the blog index page.
|
protected Content |
initializeProfileDefaultZone(ModifiablePage page)
Initialize the profile page's default zone.
|
protected Content |
initializeProfilePage(ModifiablePage page)
Initialize the blog profile page.
|
protected void |
initializeSearchDefaultZone(ModifiablePage page)
Initialize the search page's default zone.
|
protected void |
initializeSearchPage(ModifiablePage page,
Content profileContent)
Initialize the search page.
|
protected void |
initializeSite(Site site)
Initialize the given site.
|
protected void |
initializeSitemap(Sitemap sitemap)
Initialize the given sitemap.
|
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.
|
protected String |
translate(String key,
String language)
Translate the key in the plugin's catalogue.
|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
protected AmetysObjectResolver _ametysResolver
protected SkinsManager _skinsManager
protected ServiceExtensionPoint _serviceEP
protected SiteConfigurationExtensionPoint _siteConf
protected I18nUtils _i18nUtils
protected ObservationManager _observationManager
protected WorkflowProvider _workflowProvider
protected SharedContentManager _sharedContentManager
protected String _pluginName
protected String _i18nCatalogue
public InitializeBlogSiteObserver()
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 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 initializeSite(Site site)
site
- the Site object.protected void initializeSitemap(Sitemap sitemap)
sitemap
- the Sitemap object.protected ModifiablePage createPage(Sitemap sitemap, String name, String title)
sitemap
- The sitemapname
- The page's nametitle
- The page's titleprotected void initializeIndexPage(ModifiablePage indexPage, Content profileContent)
indexPage
- the blog index page.profileContent
- the profile Content.protected void initializeSearchPage(ModifiablePage page, Content profileContent)
page
- the search page.profileContent
- the profile Content.protected void initializeSearchDefaultZone(ModifiablePage page)
page
- the search page.protected Content initializeProfilePage(ModifiablePage page)
page
- the blog profile page.protected Content initializeProfileDefaultZone(ModifiablePage page)
page
- the profile page.protected void initializeDefaultZone(ModifiablePage page)
page
- The pageprotected void initializeIndexAboutZone(ModifiablePage indexPage, Content profileContent)
indexPage
- the index Page.profileContent
- the profile content.protected void initializeAsideZone(ModifiablePage page)
page
- the page on which to initialize the aside zone.protected Content createProfileContent(String workflowName, String siteName, String lang, String title) throws com.opensymphony.workflow.WorkflowException
workflowName
- The workflow namesiteName
- the site name.lang
- the language.title
- The content's titlecom.opensymphony.workflow.WorkflowException
- if an error occursprotected String getDefaultXslt(String serviceId)
serviceId
- the service ID.