01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/calendar/tags/sakai_2-4-1/calendar-api/api/src/java/org/sakaiproject/calendar/api/CalendarImporterService.java $
03: * $Id: CalendarImporterService.java 8050 2006-04-20 17:39:55Z ggolden@umich.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2003, 2004, 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.calendar.api;
21:
22: import java.io.InputStream;
23: import java.util.List;
24: import java.util.Map;
25:
26: import org.sakaiproject.exception.ImportException;
27:
28: /**
29: * Interface for importing various calendar exports into Sakai.
30: */
31: public interface CalendarImporterService {
32: /** Comma separated value import type */
33: public static final String CSV_IMPORT = "CSV";
34:
35: /** MeetingMaker import type */
36: public static final String MEETINGMAKER_IMPORT = "MeetingMaker";
37:
38: /** Outlook import type */
39: public static final String OUTLOOK_IMPORT = "Outlook";
40:
41: /**
42: * Get the default column mapping (keys are column headers, values are property names).
43: * @param importType Type such as Outlook, MeetingMaker, etc. defined in the CalendarImporterService interface.
44: * @throws ImportException
45: */
46: public Map getDefaultColumnMap(String importType)
47: throws ImportException;
48:
49: /**
50: * Perform an import given the import type.
51: * @param importType Type such as Outlook, MeetingMaker, etc. defined in the CalendarImporterService interface.
52: * @param importStream Stream of data to be imported
53: * @param columnMapping Map of column headers (keys) to property names (values)
54: * @param customFieldPropertyNames Array of custom properties that we want to import. null if there are no custom properties.
55: * @return A list of CalendarEvent objects. These objects are not "real", so their copies
56: * must be copied into CalendarEvents created by the Calendar service.
57: * @throws ImportException
58: */
59: public List doImport(String importType, InputStream importStream,
60: Map columnMapping, String[] customFieldPropertyNames)
61: throws ImportException;
62:
63: }
|