java.lang.Object
fr.paris.lutece.plugins.document.business.rules.AbstractRule
fr.paris.lutece.plugins.document.modules.rulemovespace.business.MoveSpaceRule
All Implemented Interfaces:
Rule, fr.paris.lutece.portal.service.i18n.Localizable, Serializable

@Dependent @Named("document.MoveSpaceRule") public class MoveSpaceRule extends AbstractRule implements Serializable
This rule lets move a document from a space to another when the document's state is changing
See Also:
  • Constructor Details

    • MoveSpaceRule

      public MoveSpaceRule()
  • Method Details

    • init

      public void init()
      Initialize the rule
      Specified by:
      init in interface Rule
    • getNameKey

      public String getNameKey()
      Gets the Rule name key
      Specified by:
      getNameKey in interface Rule
      Returns:
      The Rule name key
    • apply

      public void apply(DocumentEvent event) throws DocumentException
      Execute the rule
      Specified by:
      apply in interface Rule
      Parameters:
      event - The document event
      Throws:
      DocumentException - raise when error occurs in event or rule
    • getCreateForm

      public String getCreateForm(fr.paris.lutece.portal.business.user.AdminUser user, Locale locale)
      Gets a specific form to enter rule's attributes
      Specified by:
      getCreateForm in interface Rule
      Parameters:
      user - The current user
      locale - The current Locale
      Returns:
      The HTML code of the form
    • isAuthorized

      public boolean isAuthorized(fr.paris.lutece.portal.business.user.AdminUser user)
      true if the user is authorized to view the rule
      Specified by:
      isAuthorized in interface Rule
      Parameters:
      user - the current user
      Returns:
      true if the user is authorized to view the rule
    • validateRule

      public String validateRule()
      Check the rule
      Specified by:
      validateRule in interface Rule
      Returns:
      null if rule is valid, message if rule not valid
    • getAttributesList

      public String[] getAttributesList()
      Gets all attributes of the rule
      Specified by:
      getAttributesList in interface Rule
      Returns:
      attributes of the rule
    • getRule

      public String getRule()
      Gets the explicit text of the rule
      Specified by:
      getRule in interface Rule
      Returns:
      The text of the rule
    • getParameterKeySourceSpaceId

      public static String getParameterKeySourceSpaceId()
      Get the parameter key for the source space Id
      Returns:
      The parameter key
    • getParameterKeyDestinationSpaceId

      public static String getParameterKeyDestinationSpaceId()
      Get the parameter key for the destination space Id
      Returns:
      The parameter key
    • getParameterKeyStateId

      public static String getParameterKeyStateId()
      Get the parameter key for the state Id
      Returns:
      The parameter key
    • equals

      public boolean equals(Object obj)
      Description copied from class: AbstractRule
      Specified by:
      equals in class AbstractRule