Package org.imixs.marty.profile
Class ProfileService
java.lang.Object
org.imixs.marty.profile.ProfileService
@DeclareRoles({"org.imixs.ACCESSLEVEL.NOACCESS","org.imixs.ACCESSLEVEL.READERACCESS","org.imixs.ACCESSLEVEL.AUTHORACCESS","org.imixs.ACCESSLEVEL.EDITORACCESS","org.imixs.ACCESSLEVEL.MANAGERACCESS"})
@RolesAllowed({"org.imixs.ACCESSLEVEL.NOACCESS","org.imixs.ACCESSLEVEL.READERACCESS","org.imixs.ACCESSLEVEL.AUTHORACCESS","org.imixs.ACCESSLEVEL.EDITORACCESS","org.imixs.ACCESSLEVEL.MANAGERACCESS"})
public class ProfileService
extends Object
The Marty ProfileService is a sigelton EJB providing user attributes like the
username and user email. The service is used to cache names application wide.
- Author:
- rsoika
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprotected jakarta.enterprise.event.Event<ProfileEvent>static final intprotected org.imixs.workflow.engine.WorkflowService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.imixs.workflow.ItemCollectioncloneWorkitem(org.imixs.workflow.ItemCollection aWorkitem) This method closes a profile entity and computes the attributes txtUsername and txtInitialsorg.imixs.workflow.ItemCollectioncreateProfile(String userid, String locale) Creates a new profile documentvoiddiscardCache(String userid) This method removes a profile from the cache.org.imixs.workflow.ItemCollectionfindProfileById(String userid) This method returns a profile by its id.org.imixs.workflow.ItemCollectionfindProfileById(String userid, boolean refresh) This method returns a profile by its id.org.imixs.workflow.ItemCollectionlookupProfileById(String userid) This method returns a profile by its id.voidreset()resets the profile cache..
-
Field Details
-
START_PROFILE_PROCESS_ID
public static final int START_PROFILE_PROCESS_ID- See Also:
-
CREATE_PROFILE_ACTIVITY_ID
public static final int CREATE_PROFILE_ACTIVITY_ID- See Also:
-
workflowService
protected org.imixs.workflow.engine.WorkflowService workflowService -
profileEvents
-
-
Constructor Details
-
ProfileService
public ProfileService()
-
-
Method Details
-
reset
public void reset()resets the profile cache.. -
findProfileById
This method returns a profile by its id. The method uses an internal cache. The method returns null if no Profile for this name was found The returned workitem is a cloned version of the profile entity and can not be processed or updated. Use lookupProfile to get the full entity of a profile.- Parameters:
userid- - the profile id- Returns:
- cloned workitem
-
findProfileById
This method returns a profile by its id. The method uses an internal cache. The method returns in any case a user profile, even if no Profile for this name was found. In this case a dummy profile will be created. The userid is case sensitive.The returned workitem is a cloned version of the profile entity and can not be processed or updated. Use lookupProfile to get the full entity of a profile.
If the boolean 'refresh' is true the method lookup the user in any case with a search query and updates the cache.
- Parameters:
userid- - the profile idrefresh- - boolean indicates if the internal cache should be used- Returns:
- cloned workitem
-
lookupProfileById
This method returns a profile by its id. In different to the findProfileById method this method lookups the profile and returns the full entity. The returned workItem can be processed. The userId is case sensitive.Use findProfileById to work with the internal cache if there is no need to update the profile.
The method also fires a ProfileEvent which can be observed by clients to provide a different behavior. For example a LDAPService can lookup the data in a LDAP directory if a local profile was not found (see issue #343)
- Parameters:
userid- - the profile id- Returns:
- profile workitem
-
discardCache
This method removes a profile from the cache.- Parameters:
userid-
-
cloneWorkitem
public org.imixs.workflow.ItemCollection cloneWorkitem(org.imixs.workflow.ItemCollection aWorkitem) This method closes a profile entity and computes the attributes txtUsername and txtInitials- Parameters:
aWorkitem-- Returns:
-
createProfile
public org.imixs.workflow.ItemCollection createProfile(String userid, String locale) throws org.imixs.workflow.exceptions.AccessDeniedException, org.imixs.workflow.exceptions.ProcessingErrorException, org.imixs.workflow.exceptions.PluginException, org.imixs.workflow.exceptions.ModelException Creates a new profile document- Parameters:
userid-- Returns:
- Throws:
org.imixs.workflow.exceptions.ModelExceptionorg.imixs.workflow.exceptions.PluginExceptionorg.imixs.workflow.exceptions.ProcessingErrorExceptionorg.imixs.workflow.exceptions.AccessDeniedException
-