001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/user/tags/sakai_2-4-1/user-api/api/src/java/org/sakaiproject/user/cover/PreferencesService.java $
003: * $Id: PreferencesService.java 8388 2006-04-27 03:12:14Z ggolden@umich.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
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.user.cover;
021:
022: import org.sakaiproject.component.cover.ComponentManager;
023:
024: /**
025: * <p>
026: * PreferencesService is a static Cover for the {@link org.sakaiproject.user.api.PreferencesService PreferencesService}; see that interface for usage details.
027: * </p>
028: */
029: public class PreferencesService {
030: /**
031: * Access the component instance: special cover only method.
032: *
033: * @return the component instance.
034: */
035: public static org.sakaiproject.user.api.PreferencesService getInstance() {
036: if (ComponentManager.CACHE_COMPONENTS) {
037: if (m_instance == null)
038: m_instance = (org.sakaiproject.user.api.PreferencesService) ComponentManager
039: .get(org.sakaiproject.user.api.PreferencesService.class);
040: return m_instance;
041: } else {
042: return (org.sakaiproject.user.api.PreferencesService) ComponentManager
043: .get(org.sakaiproject.user.api.PreferencesService.class);
044: }
045: }
046:
047: private static org.sakaiproject.user.api.PreferencesService m_instance = null;
048:
049: public static java.lang.String APPLICATION_ID = org.sakaiproject.user.api.PreferencesService.APPLICATION_ID;
050:
051: public static java.lang.String REFERENCE_ROOT = org.sakaiproject.user.api.PreferencesService.REFERENCE_ROOT;
052:
053: public static java.lang.String SECURE_ADD_PREFS = org.sakaiproject.user.api.PreferencesService.SECURE_ADD_PREFS;
054:
055: public static java.lang.String SECURE_EDIT_PREFS = org.sakaiproject.user.api.PreferencesService.SECURE_EDIT_PREFS;
056:
057: public static java.lang.String SECURE_REMOVE_PREFS = org.sakaiproject.user.api.PreferencesService.SECURE_REMOVE_PREFS;
058:
059: public static void commit(
060: org.sakaiproject.user.api.PreferencesEdit param0) {
061: org.sakaiproject.user.api.PreferencesService service = getInstance();
062: if (service == null)
063: return;
064:
065: service.commit(param0);
066: }
067:
068: public static org.sakaiproject.user.api.Preferences getPreferences(
069: java.lang.String param0) {
070: org.sakaiproject.user.api.PreferencesService service = getInstance();
071: if (service == null)
072: return null;
073:
074: return service.getPreferences(param0);
075: }
076:
077: public static boolean allowUpdate(java.lang.String param0) {
078: org.sakaiproject.user.api.PreferencesService service = getInstance();
079: if (service == null)
080: return false;
081:
082: return service.allowUpdate(param0);
083: }
084:
085: public static org.sakaiproject.user.api.PreferencesEdit add(
086: java.lang.String param0)
087: throws org.sakaiproject.exception.PermissionException,
088: org.sakaiproject.exception.IdUsedException {
089: org.sakaiproject.user.api.PreferencesService service = getInstance();
090: if (service == null)
091: return null;
092:
093: return service.add(param0);
094: }
095:
096: public static void remove(
097: org.sakaiproject.user.api.PreferencesEdit param0) {
098: org.sakaiproject.user.api.PreferencesService service = getInstance();
099: if (service == null)
100: return;
101:
102: service.remove(param0);
103: }
104:
105: public static void cancel(
106: org.sakaiproject.user.api.PreferencesEdit param0) {
107: org.sakaiproject.user.api.PreferencesService service = getInstance();
108: if (service == null)
109: return;
110:
111: service.cancel(param0);
112: }
113:
114: public static org.sakaiproject.user.api.PreferencesEdit edit(
115: java.lang.String param0)
116: throws org.sakaiproject.exception.PermissionException,
117: org.sakaiproject.exception.InUseException,
118: org.sakaiproject.exception.IdUnusedException {
119: org.sakaiproject.user.api.PreferencesService service = getInstance();
120: if (service == null)
121: return null;
122:
123: return service.edit(param0);
124: }
125: }
|