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 Summary
FieldsModifier and TypeFieldDescriptionprotected ContextCocoon contextprotected ContentTypeExtensionPointThe content type extension point.protected OdfReferenceTableHelperThe ODF reference table helperprotected AmetysObjectResolverAmetys object resolverprotected Map<String, OdfProgramRestriction> The available odf restrictionsprotected RootOrgUnitProviderRoot orgunit providerprotected SiteManagerSite Managerstatic final StringThe avalon role. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 voidConfigured the restrictions from the XML configuration filevoidcontextualize(Context context) voiddispose()getRestriction(Page odfRootPage) Get the ODF restriction for the given ODF root pagegetRestrictionRootOrgUnitId(String siteName) Get the id of the restriction root orgunitRetrieves 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.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The avalon role. -
_siteManager
Site Manager -
_cTypeEP
The content type extension point. -
_resolver
Ametys object resolver -
_odfReferenceTableHelper
The ODF reference table helper -
_rootOrgUnitProvider
Root orgunit provider -
_cocoonContext
Cocoon context -
_restrictions
The available odf restrictions
-
-
Constructor Details
-
OdfProgramRestrictionManager
public OdfProgramRestrictionManager()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
contextualize
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
dispose
- Specified by:
disposein interfaceDisposable
-
getRestrictions
Retrieves the available restrictions- Returns:
- The map of restriction, where keys are restriction ids.
-
getRestriction
Get the ODF restriction for the given ODF root page- Parameters:
odfRootPage- The ODF root page- Returns:
- The restriction or
null
-
hasRestrictions
Indicate is there is any restriction for this root page- Parameters:
rootPage- odf root page- Returns:
- true if it is the case
-
hasOrgunitRestrictions
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
-
getRestrictionRootOrgUnitId
Get the id of the restriction root orgunit- Parameters:
siteName- the site name- Returns:
- the id of the restriction root orgunit
-
_readRestrictionConfigurationFile
Configured the restrictions from the XML configuration file -
_configureRestrictionRules
protected 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
-
_configureRestrictionRule
protected 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
-