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 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

      @Inject protected jakarta.enterprise.event.Event<ProfileEvent> profileEvents
  • Constructor Details

    • ProfileService

      public ProfileService()
  • Method Details

    • reset

      public void reset()
      resets the profile cache..
    • findProfileById

      public org.imixs.workflow.ItemCollection findProfileById(String userid)
      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

      public org.imixs.workflow.ItemCollection findProfileById(String userid, boolean refresh)
      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 id
      refresh - - boolean indicates if the internal cache should be used
      Returns:
      cloned workitem
    • lookupProfileById

      public org.imixs.workflow.ItemCollection lookupProfileById(String userid)
      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

      public void discardCache(String userid)
      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.ModelException
      org.imixs.workflow.exceptions.PluginException
      org.imixs.workflow.exceptions.ProcessingErrorException
      org.imixs.workflow.exceptions.AccessDeniedException