Class ProfilePlugin

java.lang.Object
org.imixs.workflow.engine.plugins.AbstractPlugin
org.imixs.marty.profile.ProfilePlugin
All Implemented Interfaces:
org.imixs.workflow.Plugin
Direct Known Subclasses:
ProfilePlugin

public class ProfilePlugin extends org.imixs.workflow.engine.plugins.AbstractPlugin
This plug-in supports additional business logic for profile entities. This Plugins is used by the System Workflow only.

The plugin verifies the userId and email address for input patterns and validates for duplicates. The input pattern for the userID can be defined by the imixs property

  • security.userid.input.pattern
The default value is "^[A-Za-z0-9.@\\-\\w]+"

In addition the input mode can be set to LOWERCASE or UPPERCASE. This is controlled by the imixs property

  • security.userid.input.mode
The default value is LOWERCASE.
Author:
rsoika
  • Field Details

    • USERNAME_ALREADY_TAKEN

      public static String USERNAME_ALREADY_TAKEN
    • INVALID_USERNAME

      public static String INVALID_USERNAME
    • EMAIL_ALREADY_TAKEN

      public static String EMAIL_ALREADY_TAKEN
    • INVALID_EMAIL

      public static String INVALID_EMAIL
    • NO_PROFILE_SERVICE_FOUND

      public static String NO_PROFILE_SERVICE_FOUND
    • EMAIL_PATTERN

      public static final String EMAIL_PATTERN
      See Also:
    • DEFAULT_USERID_PATTERN

      public static final String DEFAULT_USERID_PATTERN
      See Also:
    • DEFAULT_USER_INPUT_MODE

      public static final String DEFAULT_USER_INPUT_MODE
      See Also:
  • Constructor Details

    • ProfilePlugin

      public ProfilePlugin()
  • Method Details

    • run

      public org.imixs.workflow.ItemCollection run(org.imixs.workflow.ItemCollection workItem, org.imixs.workflow.ItemCollection documentActivity) throws org.imixs.workflow.exceptions.PluginException
      The Plug-in verifies if the workitem is from the type 'profile'. The plug-in tests if the usernam or email is unique
      Throws:
      org.imixs.workflow.exceptions.PluginException
    • close

      public void close(boolean rollbackTransaction) throws org.imixs.workflow.exceptions.PluginException
      This method discards the cache for the current userID (ProfileService). This is called only in case a profile was processed and no rollback is called.
      Specified by:
      close in interface org.imixs.workflow.Plugin
      Overrides:
      close in class org.imixs.workflow.engine.plugins.AbstractPlugin
      Throws:
      org.imixs.workflow.exceptions.PluginException
    • isValidUserId

      public boolean isValidUserId(String userid)
      Validate userID with regular expression provided by the property 'security.userid.input.pattern'
      Parameters:
      userid - - userID for validation
      Returns:
      true valid userID, false invalid userID
    • isValidEmailAddress

      public boolean isValidEmailAddress(String email)
      Validates a Emailaddress with regular expression
      Parameters:
      userid - - email for validation
      Returns:
      true valid email, false invalid email