01: /**********************************************************************************
02: *
03: * $Id: UserDirectoryServiceStandaloneSectionsImpl.java 18134 2006-11-14 18:59:25Z jholtzman@berkeley.edu $
04: *
05: ***********************************************************************************
06: *
07: * Copyright (c) 2005 The Regents of the University of California, The MIT Corporation
08: *
09: * Licensed under the Educational Community License, Version 1.0 (the "License");
10: * you may not use this file except in compliance with the License.
11: * You may obtain a copy of the License at
12: *
13: * http://www.opensource.org/licenses/ecl1.php
14: *
15: * Unless required by applicable law or agreed to in writing, software
16: * distributed under the License is distributed on an "AS IS" BASIS,
17: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18: * See the License for the specific language governing permissions and
19: * limitations under the License.
20: *
21: **********************************************************************************/package org.sakaiproject.tool.gradebook.facades.sections;
22:
23: import org.apache.commons.logging.Log;
24: import org.apache.commons.logging.LogFactory;
25: import org.sakaiproject.section.api.coursemanagement.User;
26: import org.sakaiproject.component.section.support.UserManager;
27: import org.sakaiproject.service.gradebook.shared.UnknownUserException;
28: import org.sakaiproject.tool.gradebook.facades.UserDirectoryService;
29:
30: public class UserDirectoryServiceStandaloneSectionsImpl implements
31: UserDirectoryService {
32: private static final Log log = LogFactory
33: .getLog(UserDirectoryServiceStandaloneSectionsImpl.class);
34: private UserManager userManager;
35:
36: public String getUserDisplayName(final String userUid)
37: throws UnknownUserException {
38: User user = userManager.findUser(userUid);
39: if (user == null) {
40: throw new UnknownUserException("Unknown uid: " + userUid);
41: }
42: return user.getDisplayName();
43: }
44:
45: public UserManager getUserManager() {
46: return userManager;
47: }
48:
49: public void setUserManager(UserManager userManager) {
50: this.userManager = userManager;
51: }
52: }
|