Class OdfProgramRestriction
- java.lang.Object
-
- org.ametys.plugins.odfweb.restrictions.OdfProgramRestriction
-
public class OdfProgramRestriction extends Object
A restriction on the ODF programs of a site.
-
-
Field Summary
Fields Modifier and Type Field Description private String
_id
private I18nizableText
_label
private OdfRestrictionRule
_rule
-
Constructor Summary
Constructors Constructor Description OdfProgramRestriction(String id, I18nizableText label, List<OdfRestrictionRule> rules)
Odf restriction constructorOdfProgramRestriction(String id, I18nizableText label, OdfRestrictionRule rule)
Odf restriction constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static OdfRestrictionRule
_extractMainRule(List<OdfRestrictionRule> rules)
boolean
contains(Program program)
Determines if the current restriction contains the programExpression
getExpression()
Translate the restriction into an expression that can be used for repository query.String
getId()
Id getterI18nizableText
getLabel()
Label getterboolean
hasOrgunitRestrictions()
Indicate if this restriction is related to orgunit
-
-
-
Field Detail
-
_label
private final I18nizableText _label
-
_rule
private final OdfRestrictionRule _rule
-
-
Constructor Detail
-
OdfProgramRestriction
public OdfProgramRestriction(String id, I18nizableText label, OdfRestrictionRule rule)
Odf restriction constructor- Parameters:
id
- Unique id of the restrictionlabel
- The restriction labelrule
- The rule of this restriction
-
OdfProgramRestriction
public OdfProgramRestriction(String id, I18nizableText label, List<OdfRestrictionRule> rules)
Odf restriction constructor- Parameters:
id
- Unique id of the restrictionlabel
- The restriction labelrules
- The set of rule of this restriction
-
-
Method Detail
-
_extractMainRule
private static OdfRestrictionRule _extractMainRule(List<OdfRestrictionRule> rules)
-
getLabel
public I18nizableText getLabel()
Label getter- Returns:
- The label
-
contains
public boolean contains(Program program)
Determines if the current restriction contains the program- Parameters:
program
- The program to check- Returns:
true
if the program is part of the restrictions
-
getExpression
public Expression getExpression()
Translate the restriction into an expression that can be used for repository query.- Returns:
- The restriction expression
-
hasOrgunitRestrictions
public boolean hasOrgunitRestrictions()
Indicate if this restriction is related to orgunit- Returns:
- true if it is the case
-
-