Package org.ametys.plugins.workspaces
Class PagePopulator
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.PagePopulator
- All Implemented Interfaces:
- LogEnabled,- Component,- Serviceable
Component allowing to create and fill a page from a configuration file
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected ContentTypeExtensionPointthe content type extension pointprotected CurrentUserProviderthe current user providerprotected I18nUtilsthe i18n utils componentprotected ObservationManagerthe observation managerprotected PageDAOthe page daoprotected ProfileAssignmentStorageExtensionPointthe profile assignment storage extension pointprotected SAXParserExcalibur SaxParserprotected ServiceExtensionPointthe service extension pointprotected SkinsManagerthe skins managerprotected SourceResolverthe source resolverprotected ContentWorkflowHelperthe workflow helperstatic final StringThe avalon role
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected void_notifyACLChange(Object context, Set<String> profilesId) Utility method to notify a change of ACL on a contextprotected voidconfigurePage(ModifiablePage newPage, Configuration configuration) Use a configuration to edit a page.protected voidcreateAndConfigureContentItem(ModifiableZone zone, Configuration contentCfg) Create a new content based on configuration and add it to a new zone itemprotected voidcreateAndConfigureServiceItem(ModifiableZone zone, Configuration serviceCfg) Create and configure a zone item based on a service configurationprotected voidcreateAndConfigureZone(ModifiablePage newPage, Configuration zoneCfg) Create and configure a zone based on configurationprotected Optional<ModifiablePage>createPage(ModifiableSitemapElement parent, Configuration configuration) Create a new page based on a configuration.initPage(ModifiableSitemapElement parent, String path) Create a new page based on a configuration file.initPage(ModifiableSitemapElement parent, Configuration configuration) Create and configure a new page based on a configuration.voidservice(ServiceManager manager) protected voidsetReaderAccess(ModifiablePage newPage, Configuration configuration) Set page reader access based on configurationMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabledgetLogger, setLogger
- 
Field Details- 
ROLEThe avalon role
- 
_sourceResolverthe source resolver
- 
_i18nUtilsthe i18n utils component
- 
_serviceEPthe service extension point
- 
_observationManagerthe observation manager
- 
_workflowHelperthe workflow helper
- 
_currentUserProviderthe current user provider
- 
_pageDAOthe page dao
- 
_profileAssignementStorageEPthe profile assignment storage extension point
- 
_skinsManagerthe skins manager
- 
_contentTypeEPthe content type extension point
- 
_saxParserExcalibur SaxParser
 
- 
- 
Constructor Details- 
PagePopulatorpublic PagePopulator()
 
- 
- 
Method Details- 
service- Specified by:
- servicein interface- Serviceable
- Throws:
- ServiceException
 
- 
initPagepublic Optional<ModifiablePage> initPage(ModifiableSitemapElement parent, String path) throws IOException, SAXException, ConfigurationException Create a new page based on a configuration file.- Parameters:
- parent- the parent where the page should be inserted
- path- the path where the configuration can be found
- Returns:
- the newly created page or Optional#empty()if no page was created.
- Throws:
- IOException- if an error occurred while reading the file
- SAXException- if an error occurred while parsing the configuration file
- ConfigurationException- if the configuration is not valid; A required info is missing.
 
- 
initPagepublic Optional<ModifiablePage> initPage(ModifiableSitemapElement parent, Configuration configuration) throws ConfigurationException Create and configure a new page based on a configuration.- Parameters:
- parent- the parent where the page should be added
- configuration- the page configuration
- Returns:
- the newly created page or Optional#empty()if no page was created.
- Throws:
- ConfigurationException- if the configuration is not valid; A required info is missing.
 
- 
createPageprotected Optional<ModifiablePage> createPage(ModifiableSitemapElement parent, Configuration configuration) throws ConfigurationException Create a new page based on a configuration.- Parameters:
- parent- the sitemap element where the page should be added
- configuration- the page configuration
- Returns:
- the newly created page or Optional#empty()if the page already exist.
- Throws:
- ConfigurationException- if the configuration is not valid; A required info is missing.
 
- 
configurePageprotected void configurePage(ModifiablePage newPage, Configuration configuration) throws ConfigurationException Use a configuration to edit a page. Via configuration, it's possible to define the page tags, template and zone items (service or content)- Parameters:
- newPage- the page that needs configuration
- configuration- the configuration describing the expected page
- Throws:
- ConfigurationException- if the configuration is not valid
 
- 
createAndConfigureZoneprotected void createAndConfigureZone(ModifiablePage newPage, Configuration zoneCfg) throws ConfigurationException Create and configure a zone based on configuration- Parameters:
- newPage- the new page where the zone should be added
- zoneCfg- the configuration to use
- Throws:
- ConfigurationException- if the configuration is invalid
 
- 
createAndConfigureServiceItemprotected void createAndConfigureServiceItem(ModifiableZone zone, Configuration serviceCfg) throws ConfigurationException Create and configure a zone item based on a service configuration- Parameters:
- zone- the zone where the zone item should be added
- serviceCfg- the configuration to use
- Throws:
- ConfigurationException- if the configuration is invalid
 
- 
createAndConfigureContentItemprotected void createAndConfigureContentItem(ModifiableZone zone, Configuration contentCfg) throws ConfigurationException Create a new content based on configuration and add it to a new zone item- Parameters:
- zone- the zone where the zone item should be added
- contentCfg- the configuration to use
- Throws:
- ConfigurationException- if the configuration is invalid
 
- 
setReaderAccessprotected void setReaderAccess(ModifiablePage newPage, Configuration configuration) throws ConfigurationException Set page reader access based on configuration- Parameters:
- newPage- the newly created page
- configuration- the page configuration
- Throws:
- ConfigurationException- if an unrecognized group is present in configuration
 
- 
_notifyACLChangeUtility method to notify a change of ACL on a context- Parameters:
- context- the impacted context
- profilesId- the assigned or removed profiles
 
 
-