Package org.ametys.plugins.blog
Class InitializeBlogSiteObserver
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.plugins.blog.InitializeBlogSiteObserver
- All Implemented Interfaces:
Observer
,PluginAware
,LogEnabled
,Serviceable
public class InitializeBlogSiteObserver
extends AbstractLogEnabled
implements Observer, Serviceable, PluginAware
Initializes all blog pages when a site is created.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AmetysObjectResolver
The ametys object resolver.protected 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 SharedContentManager
The shared content manager.protected SkinsManager
The skins manager.protected WorkflowProvider
The workflow providerFields 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, 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
Initialize the "aside" zone.protected void
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
Initialize the profile page's default zone.protected Content
Initialize the blog profile page.protected void
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
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
Checks if the event is supported.protected String
Translate the key in the plugin's catalogue.Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
_ametysResolver
The ametys object resolver. -
_skinsManager
The skins manager. -
_serviceEP
The service extension point. -
_i18nUtils
The i18n utils. -
_observationManager
The observation manager. -
_workflowProvider
The workflow provider -
_pluginName
The plugin name. -
_i18nCatalogue
The i18n catalogue.
-
-
Constructor Details
-
InitializeBlogSiteObserver
public InitializeBlogSiteObserver()
-
-
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.- Specified by:
setPluginInfo
in interfacePluginAware
- 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
- Throws:
ServiceException
-
supports
Description copied from interface:Observer
Checks if the event is supported. If true, the observe(Event) method will be called. -
getPriority
Description copied from interface:Observer
Retrieves the priority to observe this event.
This can be used to process a supported event before others observers.- Specified by:
getPriority
in interfaceObserver
- Parameters:
event
- the event.- Returns:
- the priority where 0 the max priority and Integer.MAX_VALUE the min priority.
-
observe
Description copied from interface:Observer
Observes an event.- Specified by:
observe
in interfaceObserver
- Parameters:
event
- the event.transientVars
- transientVars passed from one Observer to another when processing a single Event. This may allow optimizations between observers.- Throws:
Exception
- if an error occurs. All exceptions will be logged but not propagated, as the observation mechanism should never fail.
-
initializeSite
Initialize the given site.- Parameters:
site
- the Site object.
-
initializeSitemap
Initialize the given sitemap.- Parameters:
sitemap
- the Sitemap object.
-
createPage
Create the blog root page.- Parameters:
sitemap
- The sitemapname
- The page's nametitle
- The page's title- Returns:
- the root page.
-
initializeIndexPage
Initialize the blog index page.- Parameters:
indexPage
- the blog index page.profileContent
- the profile Content.
-
initializeSearchPage
Initialize the search page.- Parameters:
page
- the search page.profileContent
- the profile Content.
-
initializeSearchDefaultZone
Initialize the search page's default zone.- Parameters:
page
- the search page.
-
initializeProfilePage
Initialize the blog profile page.- Parameters:
page
- the blog profile page.- Returns:
- the profile content.
-
initializeProfileDefaultZone
Initialize the profile page's default zone.- Parameters:
page
- the profile page.- Returns:
- the profile content.
-
initializeDefaultZone
Initialize the default zone.- Parameters:
page
- The page
-
initializeIndexAboutZone
Initialize the index page's "about" zone.- Parameters:
indexPage
- the index Page.profileContent
- the profile content.
-
initializeAsideZone
Initialize the "aside" zone.- Parameters:
page
- the page on which to initialize the aside zone.
-
createProfileContent
protected Content createProfileContent(String workflowName, String siteName, String lang, String title) throws com.opensymphony.workflow.WorkflowException Create a profile content.- Parameters:
workflowName
- The workflow namesiteName
- the site name.lang
- the language.title
- The content's title- Returns:
- the created person content.
- Throws:
com.opensymphony.workflow.WorkflowException
- if an error occurs
-
getDefaultXslt
Get the default value of the XSLT parameter of the given service.- Parameters:
serviceId
- the service ID.- Returns:
- the default XSLT parameter value.
-
translate
Translate the key in the plugin's catalogue.- Parameters:
key
- the i18n key.language
- the language.- Returns:
- the translated value.
-