Class UnqualifiedRoleAttribute

All Implemented Interfaces:
Serializable, RoleAttribute, WorkflowRuleAttribute
Direct Known Subclasses:
RoutedByUserRoleAttribute

public abstract class UnqualifiedRoleAttribute extends AbstractRoleAttribute
A simple base RoleAttribute implementation for roles that do not need to be qualified prior to resolution.
Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
  • Field Details

  • Constructor Details

    • UnqualifiedRoleAttribute

      public UnqualifiedRoleAttribute()
      No-arg constructor for subclasses that will override getRoleNames() to provide their own roles list
    • UnqualifiedRoleAttribute

      public UnqualifiedRoleAttribute(List<RoleName> roles)
      Constructor for subclasses that can provide a role list at construction time
  • Method Details

    • getRoleNames

      public List<RoleName> getRoleNames()
      Description copied from interface: RoleAttribute
      List of RoleNames this RoleAttribute supports
      Returns:
      list of RoleNames this RoleAttribute supports
    • getQualifiedRoleNames

      public List<String> getQualifiedRoleNames(String roleName, DocumentContent documentContent)
      Returns a List<String> containing only the roleName parameter; i.e. no qualification occurs
      Parameters:
      roleName - the role name (without class prefix)
      documentContent - the document content
    • parseRoleNameFromClassAndRole

      protected String parseRoleNameFromClassAndRole(String classAndRole)
      Helper method for parsing the actual role name out from the class/rolename combination as Role class combines the two and does expose the original role name
      Parameters:
      classAndRole - the class and role string (e.g. org.blah.MyRoleAttribute!SOME_ROLE_NAME)
      Returns:
      the role name portion of the class and role string (e.g. SOME_ROLE_NAME);
    • isValidRoleName

      protected boolean isValidRoleName(String roleName)
      Parameters:
      roleName - roleName to test
      Returns:
      whether the roleName specifies a role that this attribute can resolve
    • resolveQualifiedRole

      public ResolvedQualifiedRole resolveQualifiedRole(RouteContext routeContext, String roleName, String qualifiedRole)
      Description copied from interface: RoleAttribute
      Returns a List of Workflow Users which are members of the given qualified role.
      Parameters:
      routeContext - the RouteContext
      roleName - the roleName (without class prefix)
      qualifiedRole - one of the the qualified role names returned from the RoleAttribute.getQualifiedRoleNames(String, DocumentContent) method
      Returns:
      ResolvedQualifiedRole containing recipients, role label (most likely the roleName), and an annotation
    • resolveRole

      protected abstract ResolvedQualifiedRole resolveRole(RouteContext routeContext, String roleName)
      Template method for subclasses to implement
      Parameters:
      routeContext - the RouteContext
      roleName - the role name
      Returns:
      a ResolvedQualifiedRole