001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/sections/tags/sakai_2-4-1/sections-api/src/java/org/sakaiproject/component/section/cover/SectionAwareness.java $
003: * $Id: SectionAwareness.java 18134 2006-11-14 18:59:25Z jholtzman@berkeley.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2005, 2006 The Regents of the University of California and The Regents of the University of Michigan
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.component.section.cover;
021:
022: import java.util.List;
023: import java.util.Locale;
024:
025: import org.sakaiproject.component.cover.ComponentManager;
026: import org.sakaiproject.section.api.coursemanagement.CourseSection;
027: import org.sakaiproject.section.api.facade.Role;
028:
029: public class SectionAwareness {
030: private static org.sakaiproject.section.api.SectionAwareness instance;
031:
032: private static org.sakaiproject.section.api.SectionAwareness getInstance() {
033: if (instance == null) {
034: instance = (org.sakaiproject.section.api.SectionAwareness) ComponentManager
035: .get(org.sakaiproject.section.api.SectionAwareness.class);
036: }
037: return instance;
038: }
039:
040: public static final List findSiteMembersInRole(String siteContext,
041: Role role, String pattern) {
042: return getInstance().findSiteMembersInRole(siteContext, role,
043: pattern);
044: }
045:
046: public static final String getCategoryName(String categoryId,
047: Locale locale) {
048: return getInstance().getCategoryName(categoryId, locale);
049: }
050:
051: public static final CourseSection getSection(String sectionUuid) {
052: return getInstance().getSection(sectionUuid);
053: }
054:
055: public static final List getSectionCategories(String siteContext) {
056: return getInstance().getSectionCategories(siteContext);
057: }
058:
059: public static final List getSectionMembers(String sectionUuid) {
060: return getInstance().getSectionMembers(sectionUuid);
061: }
062:
063: public static final List getSectionMembersInRole(
064: String sectionUuid, Role role) {
065: return getInstance().getSectionMembersInRole(sectionUuid, role);
066: }
067:
068: public static final List getSections(String siteContext) {
069: return getInstance().getSections(siteContext);
070: }
071:
072: public static final List getSectionsInCategory(String siteContext,
073: String categoryId) {
074: return getInstance().getSectionsInCategory(siteContext,
075: categoryId);
076: }
077:
078: public static final List getSiteMembersInRole(String siteContext,
079: Role role) {
080: return getInstance().getSiteMembersInRole(siteContext, role);
081: }
082:
083: public static final boolean isSectionMemberInRole(
084: String sectionUuid, String userUid, Role role) {
085: return getInstance().isSectionMemberInRole(sectionUuid,
086: userUid, role);
087: }
088:
089: public static final boolean isSiteMemberInRole(String siteContext,
090: String userUid, Role role) {
091: return getInstance().isSiteMemberInRole(siteContext, userUid,
092: role);
093: }
094:
095: public static final List getUnassignedMembersInRole(
096: String siteContext, Role role) {
097: return getInstance().getUnassignedMembersInRole(siteContext,
098: role);
099: }
100:
101: }
|