Package org.imixs.marty.profile
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
"^[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
- Author:
- rsoika
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic Stringstatic final Stringstatic Stringstatic Stringstatic Stringstatic StringFields inherited from class org.imixs.workflow.engine.plugins.AbstractPlugin
INVALID_ITEMVALUE_FORMAT, INVALID_PROPERTYVALUE_FORMAT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose(boolean rollbackTransaction) This method discards the cache for the current userID (ProfileService).booleanisValidEmailAddress(String email) Validates a Emailaddress with regular expressionbooleanisValidUserId(String userid) Validate userID with regular expression provided by the property 'security.userid.input.pattern'org.imixs.workflow.ItemCollectionrun(org.imixs.workflow.ItemCollection workItem, org.imixs.workflow.ItemCollection documentActivity) The Plug-in verifies if the workitem is from the type 'profile'.Methods inherited from class org.imixs.workflow.engine.plugins.AbstractPlugin
getCtx, getWorkflowService, init, mergeFieldList, uniqueList
-
Field Details
-
USERNAME_ALREADY_TAKEN
-
INVALID_USERNAME
-
EMAIL_ALREADY_TAKEN
-
INVALID_EMAIL
-
NO_PROFILE_SERVICE_FOUND
-
EMAIL_PATTERN
- See Also:
-
DEFAULT_USERID_PATTERN
- See Also:
-
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:
closein interfaceorg.imixs.workflow.Plugin- Overrides:
closein classorg.imixs.workflow.engine.plugins.AbstractPlugin- Throws:
org.imixs.workflow.exceptions.PluginException
-
isValidUserId
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
Validates a Emailaddress with regular expression- Parameters:
userid- - email for validation- Returns:
- true valid email, false invalid email
-