Class OdfProgramRestrictionManager
- java.lang.Object
- 
- org.ametys.runtime.plugin.component.AbstractLogEnabled
- 
- org.ametys.plugins.odfweb.restrictions.OdfProgramRestrictionManager
 
 
- 
- All Implemented Interfaces:
- LogEnabled,- Disposable,- Component,- Contextualizable,- Serviceable
 
 public class OdfProgramRestrictionManager extends AbstractLogEnabled implements Component, Serviceable, Contextualizable, Disposable Component able to handle program restrictions related to the "odf-restrictions" site parameter.
- 
- 
Field SummaryFields Modifier and Type Field Description protected Context_cocoonContextCocoon contextprotected ContentTypeExtensionPoint_cTypeEPThe content type extension point.protected AmetysObjectResolver_resolverAmetys object resolverprotected Map<String,OdfProgramRestriction>_restrictionsThe available odf restrictionsprotected RootOrgUnitProvider_rootOrgUnitProviderRoot orgunit providerprotected SiteManager_siteManagerSite Managerstatic StringROLEThe avalon role.
 - 
Constructor SummaryConstructors Constructor Description OdfProgramRestrictionManager()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected OdfRestrictionRule_configureRestrictionRule(Configuration ruleConf)Configure a restriction rule from a configuration nodeprotected List<OdfRestrictionRule>_configureRestrictionRules(Configuration rulesConf)Create a list of rules from configuration nodesprotected void_readRestrictionConfigurationFile()Configured the restrictions from the XML configuration filevoidcontextualize(Context context)voiddispose()OdfProgramRestrictiongetRestriction(Page odfRootPage)Get the ODF restriction for the given ODF root pageStringgetRestrictionRootOrgUnitId(String siteName)Get the id of the restriction root orgunitMap<String,OdfProgramRestriction>getRestrictions()Retrieves the available restrictionsbooleanhasOrgunitRestrictions(Page rootPage)Indicate is there is any restriction related to orgunit for this root pagebooleanhasRestrictions(Page rootPage)Indicate is there is any restriction for this root pagevoidservice(ServiceManager serviceManager)- 
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabledgetLogger, setLogger
 
- 
 
- 
- 
- 
Field Detail- 
_siteManagerprotected SiteManager _siteManager Site Manager
 - 
_cTypeEPprotected ContentTypeExtensionPoint _cTypeEP The content type extension point.
 - 
_resolverprotected AmetysObjectResolver _resolver Ametys object resolver
 - 
_rootOrgUnitProviderprotected RootOrgUnitProvider _rootOrgUnitProvider Root orgunit provider
 - 
_cocoonContextprotected Context _cocoonContext Cocoon context
 - 
_restrictionsprotected Map<String,OdfProgramRestriction> _restrictions The available odf restrictions
 
- 
 - 
Constructor Detail- 
OdfProgramRestrictionManagerpublic OdfProgramRestrictionManager() 
 
- 
 - 
Method Detail- 
servicepublic void service(ServiceManager serviceManager) throws ServiceException - Specified by:
- servicein interface- Serviceable
- Throws:
- ServiceException
 
 - 
contextualizepublic void contextualize(Context context) throws ContextException - Specified by:
- contextualizein interface- Contextualizable
- Throws:
- ContextException
 
 - 
disposepublic void dispose() - Specified by:
- disposein interface- Disposable
 
 - 
getRestrictionspublic Map<String,OdfProgramRestriction> getRestrictions() Retrieves the available restrictions- Returns:
- The map of restriction, where keys are restriction ids.
 
 - 
getRestrictionpublic OdfProgramRestriction getRestriction(Page odfRootPage) Get the ODF restriction for the given ODF root page- Parameters:
- odfRootPage- The ODF root page
- Returns:
- The restriction or null
 
 - 
hasRestrictionspublic boolean hasRestrictions(Page rootPage) Indicate is there is any restriction for this root page- Parameters:
- rootPage- odf root page
- Returns:
- true if it is the case
 
 - 
hasOrgunitRestrictionspublic boolean hasOrgunitRestrictions(Page rootPage) Indicate is there is any restriction related to orgunit for this root page- Parameters:
- rootPage- odf root page
- Returns:
- true if it is the case
 
 - 
getRestrictionRootOrgUnitIdpublic String getRestrictionRootOrgUnitId(String siteName) Get the id of the restriction root orgunit- Parameters:
- siteName- the site name
- Returns:
- the id of the restriction root orgunit
 
 - 
_readRestrictionConfigurationFileprotected void _readRestrictionConfigurationFile() Configured the restrictions from the XML configuration file
 - 
_configureRestrictionRulesprotected List<OdfRestrictionRule> _configureRestrictionRules(Configuration rulesConf) throws ConfigurationException Create a list of rules from configuration nodes- Parameters:
- rulesConf- Array of configuration node that represents the set of rules
- Returns:
- list of rules
- Throws:
- ConfigurationException- if a configuration error is encountered
 
 - 
_configureRestrictionRuleprotected OdfRestrictionRule _configureRestrictionRule(Configuration ruleConf) throws ConfigurationException Configure a restriction rule from a configuration node- Parameters:
- ruleConf- The configuration node representing the rule
- Returns:
- The odf restriction rule
- Throws:
- ConfigurationException- if a configuration error is encountered
 
 
- 
 
-