org.sakaiproject.component.section.sakai
Class SectionAwarenessImpl

java.lang.Object
  extended by org.sakaiproject.component.section.sakai.SectionAwarenessImpl
All Implemented Interfaces:
SectionAwareness

public class SectionAwarenessImpl
extends Object
implements SectionAwareness

A sakai based implementation of the Section Awareness API, using the grouping capability of the framework as the persistence mechanism.

Author:
Josh Holtzman

Field Summary
protected  CourseManagementService courseManagementService
           
protected  org.sakaiproject.entity.api.EntityManager entityManager
           
protected  org.sakaiproject.authz.api.FunctionManager functionManager
           
protected  org.sakaiproject.authz.api.SecurityService securityService
           
protected  org.sakaiproject.site.api.SiteService siteService
           
protected  org.sakaiproject.user.api.UserDirectoryService userDirectoryService
           
 
Fields inherited from interface org.sakaiproject.section.api.SectionAwareness
INSTRUCTOR_MARKER, STUDENT_MARKER, TA_MARKER
 
Constructor Summary
SectionAwarenessImpl()
           
 
Method Summary
 void destroy()
           
 List findSiteMembersInRole(String siteContext, Role role, String pattern)
          Finds site members in the given context and Role with a matching name or display id.
 String getCategoryName(String categoryId, Locale locale)
          Gets the localized name of a given category.
 CourseSection getSection(String sectionUuid)
          Gets a CourseSection by its uuid.
 List getSectionCategories(String siteContext)
          Gets the list of section categories.
 String getSectionCategory(String sectionUuid)
           
 List getSectionMembers(String sectionUuid)
          Gets the full membership of the given section.
 List getSectionMembersInRole(String sectionUuid, Role role)
          Gets the members of a given section that play a given role in the section.
 String getSectionName(String sectionUuid)
           
 List getSections(String siteContext)
          Gets the sections associated with this site context.
 List getSectionsInCategory(String siteContext, String categoryId)
          Lists the sections in this context that are a member of the given category.
 List getSiteMembersInRole(String siteContext, Role role)
          Gets the site membership for a given context.
 List getUnassignedMembersInRole(String siteContext, Role role)
          Gets all users who are members of a site but are members of zero sections within the site.
 void init()
          Bean initialization (called by spring) registers authorization functions with the AuthzGroup system.
 boolean isSectionMemberInRole(String sectionUuid, String userUid, Role role)
          Checks whether a user plays a particular Role in a section.
 boolean isSiteMemberInRole(String siteContext, String userUid, Role role)
          Checks whether a user plays a particular Role in a given site context.
 void setCourseManagementService(CourseManagementService courseManagementService)
           
 void setEntityManager(org.sakaiproject.entity.api.EntityManager entityManager)
           
 void setFunctionManager(org.sakaiproject.authz.api.FunctionManager functionManager)
           
 void setSecurityService(org.sakaiproject.authz.api.SecurityService securityService)
           
 void setSiteService(org.sakaiproject.site.api.SiteService siteService)
           
 void setUserDirectoryService(org.sakaiproject.user.api.UserDirectoryService userDirectoryService)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

siteService

protected org.sakaiproject.site.api.SiteService siteService

securityService

protected org.sakaiproject.authz.api.SecurityService securityService

entityManager

protected org.sakaiproject.entity.api.EntityManager entityManager

functionManager

protected org.sakaiproject.authz.api.FunctionManager functionManager

userDirectoryService

protected org.sakaiproject.user.api.UserDirectoryService userDirectoryService

courseManagementService

protected CourseManagementService courseManagementService
Constructor Detail

SectionAwarenessImpl

public SectionAwarenessImpl()
Method Detail

init

public void init()
Bean initialization (called by spring) registers authorization functions with the AuthzGroup system.


destroy

public void destroy()

getSections

public List getSections(String siteContext)
Description copied from interface: SectionAwareness
Gets the sections associated with this site context.

Specified by:
getSections in interface SectionAwareness
Parameters:
siteContext - The site context
Returns:
The List of CourseSections associated with this site context.

getSectionCategories

public List getSectionCategories(String siteContext)
Description copied from interface: SectionAwareness
Gets the list of section categories. In sakai 2.1, there will be only a single set of categories. They will not be configurable on a per-course or per-context bases. In future versions, the list of categories will be configurable at the site level.

Specified by:
getSectionCategories in interface SectionAwareness
Parameters:
siteContext - The site context
Returns:
A List of unique Strings that identify the available section categories. These should be internationalized for display using getCategoryName.

getSection

public CourseSection getSection(String sectionUuid)
Description copied from interface: SectionAwareness
Gets a CourseSection by its uuid.

Specified by:
getSection in interface SectionAwareness
Returns:

getSiteMembersInRole

public List getSiteMembersInRole(String siteContext,
                                 Role role)
Description copied from interface: SectionAwareness
Gets the site membership for a given context.

Specified by:
getSiteMembersInRole in interface SectionAwareness
Parameters:
siteContext - The site context
Returns:
A List of ParticipationRecords representing the users in the given site, playing the given Role.

findSiteMembersInRole

public List findSiteMembersInRole(String siteContext,
                                  Role role,
                                  String pattern)
Description copied from interface: SectionAwareness
Finds site members in the given context and Role with a matching name or display id. Pattern matching is TBD, but will probably match in any of the following cases:

Specified by:
findSiteMembersInRole in interface SectionAwareness
Parameters:
siteContext - The site context
role - The role the user must play in this context
pattern - The pattern the user's name or id must match
Returns:
A List of ParticipationRecords representing the users in the given site, playing the given role, that match the string pattern.

isSiteMemberInRole

public boolean isSiteMemberInRole(String siteContext,
                                  String userUid,
                                  Role role)
Description copied from interface: SectionAwareness
Checks whether a user plays a particular Role in a given site context.

Specified by:
isSiteMemberInRole in interface SectionAwareness
Parameters:
siteContext - The site context
userUid - The user's unique id
role - The role we're checking
Returns:
Whether this user plays this role in this context.

getSectionMembers

public List getSectionMembers(String sectionUuid)
Description copied from interface: SectionAwareness
Gets the full membership of the given section.

Specified by:
getSectionMembers in interface SectionAwareness
Returns:
A List of ParticipationRecords representing the users in a CourseSection.

getSectionMembersInRole

public List getSectionMembersInRole(String sectionUuid,
                                    Role role)
Description copied from interface: SectionAwareness
Gets the members of a given section that play a given role in the section.

Specified by:
getSectionMembersInRole in interface SectionAwareness
Returns:
A List of ParticipationRecords representing the users in a CourseSection that play a given Role.

isSectionMemberInRole

public boolean isSectionMemberInRole(String sectionUuid,
                                     String userUid,
                                     Role role)
Description copied from interface: SectionAwareness
Checks whether a user plays a particular Role in a section.

Specified by:
isSectionMemberInRole in interface SectionAwareness
Returns:
Whether the user plays a particular role in a section.

getSectionName

public String getSectionName(String sectionUuid)

getSectionCategory

public String getSectionCategory(String sectionUuid)

getSectionsInCategory

public List getSectionsInCategory(String siteContext,
                                  String categoryId)
Description copied from interface: SectionAwareness
Lists the sections in this context that are a member of the given category.

Specified by:
getSectionsInCategory in interface SectionAwareness
Parameters:
siteContext - The site context
Returns:
A List of CourseSections

getCategoryName

public String getCategoryName(String categoryId,
                              Locale locale)
Description copied from interface: SectionAwareness
Gets the localized name of a given category.

Specified by:
getCategoryName in interface SectionAwareness
Parameters:
categoryId - A string identifying the category
locale - The locale of the client
Returns:
An internationalized string to display for this category.

getUnassignedMembersInRole

public List getUnassignedMembersInRole(String siteContext,
                                       Role role)
Description copied from interface: SectionAwareness
Gets all users who are members of a site but are members of zero sections within the site.

Specified by:
getUnassignedMembersInRole in interface SectionAwareness
Parameters:
siteContext - The site context
role - The role that the user must play in the given site
Returns:
A List of ParticipationRecords

setSiteService

public void setSiteService(org.sakaiproject.site.api.SiteService siteService)

setFunctionManager

public void setFunctionManager(org.sakaiproject.authz.api.FunctionManager functionManager)

setEntityManager

public void setEntityManager(org.sakaiproject.entity.api.EntityManager entityManager)

setSecurityService

public void setSecurityService(org.sakaiproject.authz.api.SecurityService securityService)

setUserDirectoryService

public void setUserDirectoryService(org.sakaiproject.user.api.UserDirectoryService userDirectoryService)

setCourseManagementService

public void setCourseManagementService(CourseManagementService courseManagementService)


Copyright © 2011 Sakai Project. All Rights Reserved.