Class FormsRegularExpressionRemovalListener

java.lang.Object
fr.paris.lutece.plugins.forms.service.listener.FormsRegularExpressionRemovalListener
All Implemented Interfaces:
fr.paris.lutece.portal.service.util.RemovalListener

@ApplicationScoped public class FormsRegularExpressionRemovalListener extends Object implements fr.paris.lutece.portal.service.util.RemovalListener
Refuses the removal of a regular expression while a control of a form (pattern validator) uses it: once removed, the control would reject every non-empty answer and the form could no longer be submitted.
  • Constructor Details

    • FormsRegularExpressionRemovalListener

      public FormsRegularExpressionRemovalListener()
  • Method Details

    • register

      public void register(@Observes @Initialized(jakarta.enterprise.context.ApplicationScoped.class) Object context)
      Registers this listener with the removal service of the regular expressions when the application starts.
      Parameters:
      context - the context of the started application
    • canBeRemoved

      public boolean canBeRemoved(String strId)
      Specified by:
      canBeRemoved in interface fr.paris.lutece.portal.service.util.RemovalListener
    • getRemovalRefusedMessage

      public String getRemovalRefusedMessage(String strId, Locale locale)
      Specified by:
      getRemovalRefusedMessage in interface fr.paris.lutece.portal.service.util.RemovalListener