Interface Rule
-
- All Superinterfaces:
fr.paris.lutece.portal.service.i18n.Localizable
- All Known Implementing Classes:
AbstractRule,MoveSpaceRule,NotifyUsersRule
public interface Rule extends fr.paris.lutece.portal.service.i18n.LocalizableInterface of rules that can be applied on documents by the RuleEngine
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidapply(DocumentEvent event)Execute the ruleStringgetAttribute(String strAttributeName)Gets a specific attribute by its nameString[]getAttributesList()Gives all specific attributes of the ruleStringgetCreateForm(fr.paris.lutece.portal.business.user.AdminUser user, Locale locale)Return the HTML form containing specific fields of the ruleintgetId()Gets the Rule IdStringgetNameKey()Gets the Rule name keyStringgetRule()Gets the Rule definitionStringgetRuleTypeId()Gets the Rule Type Idfr.paris.lutece.portal.business.user.AdminUsergetUser()Gets the current uservoidinit()Initialize the rulebooleanisAuthorized(fr.paris.lutece.portal.business.user.AdminUser user)true if the user is authorized to view the rulevoidreadAttributes(javax.servlet.http.HttpServletRequest request)Reads rule attributesvoidsetAttribute(String strAttributeName, String strAttributeValue)Sets a specific rule attributevoidsetId(int nId)Sets the Rule IdvoidsetRuleTypeId(String strId)Sets the RuleTypeIdvoidsetUser(fr.paris.lutece.portal.business.user.AdminUser user)set the admin user who use the ruleStringvalidateRule()Check the rule
-
-
-
Method Detail
-
init
void init()
Initialize the rule
-
setId
void setId(int nId)
Sets the Rule Id- Parameters:
nId- The rule Id
-
getId
int getId()
Gets the Rule Id- Returns:
- the Rule Id
-
setRuleTypeId
void setRuleTypeId(String strId)
Sets the RuleTypeId- Parameters:
strId- The Rule type Id
-
getRuleTypeId
String getRuleTypeId()
Gets the Rule Type Id- Returns:
- the Rule Type Id
-
getAttribute
String getAttribute(String strAttributeName)
Gets a specific attribute by its name- Parameters:
strAttributeName- The attribute name- Returns:
- The attribute value
-
setAttribute
void setAttribute(String strAttributeName, String strAttributeValue)
Sets a specific rule attribute- Parameters:
strAttributeName- The attribute namestrAttributeValue- The attribute value
-
readAttributes
void readAttributes(javax.servlet.http.HttpServletRequest request)
Reads rule attributes- Parameters:
request- The HTTP request
-
apply
void apply(DocumentEvent event) throws DocumentException
Execute the rule- Parameters:
event- The document event- Throws:
DocumentException- raise when error occurs in event or rule
-
validateRule
String validateRule()
Check the rule- Returns:
- null if rule is valid, message if rule not valid
-
getCreateForm
String getCreateForm(fr.paris.lutece.portal.business.user.AdminUser user, Locale locale)
Return the HTML form containing specific fields of the rule- Parameters:
user- The current userlocale- The Locale- Returns:
- The Create HTML form
-
getAttributesList
String[] getAttributesList()
Gives all specific attributes of the rule- Returns:
- A string array containing all attributes names
-
getRule
String getRule()
Gets the Rule definition- Returns:
- The Rule definition
-
getUser
fr.paris.lutece.portal.business.user.AdminUser getUser()
Gets the current user- Returns:
- the current user
-
isAuthorized
boolean isAuthorized(fr.paris.lutece.portal.business.user.AdminUser user)
true if the user is authorized to view the rule- Parameters:
user- the current user- Returns:
- true if the user is authorized to view the rule
-
setUser
void setUser(fr.paris.lutece.portal.business.user.AdminUser user)
set the admin user who use the rule- Parameters:
user- the admin user who use the rule
-
getNameKey
String getNameKey()
Gets the Rule name key- Returns:
- The Rule name key
-
-