01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/archive/tags/sakai_2-4-1/archive-api/api/src/java/org/sakaiproject/archive/cover/ImportMetadataService.java $
03: * $Id: ImportMetadataService.java 7947 2006-04-19 03:14:11Z ggolden@umich.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2005, 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.sakaiproject.archive.cover;
21:
22: import org.sakaiproject.component.cover.ComponentManager;
23:
24: /**
25: * ...
26: */
27: public class ImportMetadataService {
28: private static org.sakaiproject.archive.api.ImportMetadataService m_instance = null;
29:
30: public static java.lang.String SERVICE_NAME = org.sakaiproject.archive.api.ImportMetadataService.SERVICE_NAME;
31:
32: /**
33: * Access the component instance: special cover only method.
34: *
35: * @return the component instance.
36: */
37: public static org.sakaiproject.archive.api.ImportMetadataService getInstance() {
38: if (ComponentManager.CACHE_COMPONENTS) {
39: if (m_instance == null)
40: m_instance = (org.sakaiproject.archive.api.ImportMetadataService) ComponentManager
41: .get(org.sakaiproject.archive.api.ImportMetadataService.class);
42: return m_instance;
43: } else {
44: return (org.sakaiproject.archive.api.ImportMetadataService) ComponentManager
45: .get(org.sakaiproject.archive.api.ImportMetadataService.class);
46: }
47: }
48:
49: public static org.sakaiproject.archive.api.ImportMetadata getImportMapById(
50: String id) {
51: org.sakaiproject.archive.api.ImportMetadataService service = getInstance();
52: if (service == null)
53: return null;
54:
55: return service.getImportMapById(id);
56: }
57:
58: public static java.util.List getImportMetadataElements(
59: org.w3c.dom.Document doc) {
60: org.sakaiproject.archive.api.ImportMetadataService service = getInstance();
61: if (service == null)
62: return null;
63:
64: return service.getImportMetadataElements(doc);
65: }
66:
67: /**
68: * @param username
69: * @param siteDoc
70: * @return
71: */
72: public static boolean hasMaintainRole(String username,
73: org.w3c.dom.Document siteDoc) {
74: org.sakaiproject.archive.api.ImportMetadataService service = getInstance();
75: if (service == null)
76: return false;
77:
78: return service.hasMaintainRole(username, siteDoc);
79: }
80: }
|