001: /**********************************************************************************
002: *
003: * $Id: XmlImportable.java 20758 2007-01-29 18:07:03Z ray@media.berkeley.edu $
004: *
005: ***********************************************************************************
006: *
007: * Copyright (c) 2007 The Regents of the University of California
008: *
009: * Licensed under the Educational Community License, Version 1.0 (the "License");
010: * you may not use this file except in compliance with the License.
011: * You may obtain a copy of the License at
012: *
013: * http://www.opensource.org/licenses/ecl1.php
014: *
015: * Unless required by applicable law or agreed to in writing, software
016: * distributed under the License is distributed on an "AS IS" BASIS,
017: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018: * See the License for the specific language governing permissions and
019: * limitations under the License.
020: *
021: **********************************************************************************/package org.sakaiproject.tool.gradebook.facades.sakai2impl;
022:
023: import org.sakaiproject.importer.api.Importable;
024:
025: /**
026: * A simple generic wrapper to add new types of importable objects without needing
027: * to subclass each of them.
028: *
029: * THIS IS CURRENTLY UNUSED. It's here on a speculative basis for upcoming
030: * import/archive/merge development.
031: * <p>
032: * TODO This would subclass AbstractImportable if AbstractImportable was bumped up to
033: * the importer.api package for looser coupling. Currently, the AbstractImportable JAR
034: * brings in unrelated dependencies such as the QTI class.
035: */
036: public class XmlImportable implements Importable {
037: private String typeName;
038: private String xmlData;
039: private String guid;
040: private String legacyGroup;
041: private String contextPath;
042: private Importable parent;
043:
044: public XmlImportable() {
045: }
046:
047: /**
048: * Create an importable object in one line.
049: *
050: * @param typeName identifies what type of domain data is serialized in the XML
051: * @param xmlData XML string describing the data itself, suitable for archiving
052: * or merging
053: */
054: public XmlImportable(String typeName, String xmlData) {
055: this .typeName = typeName;
056: this .xmlData = xmlData;
057: }
058:
059: public String getTypeName() {
060: return typeName;
061: }
062:
063: public void setTypeName(String typeName) {
064: this .typeName = typeName;
065: }
066:
067: public String getXmlData() {
068: return xmlData;
069: }
070:
071: /**
072: * Since this class doesn't parse the data, this property could easily be renamed
073: * "setDataDescription" and this class renamed "StringImportable".
074: * But since XML is central to our archive / export / merge plans, it seems
075: * worth advertising that the data can be parsed as such.
076: * @param xmlData
077: */
078: public void setXmlData(String xmlData) {
079: this .xmlData = xmlData;
080: }
081:
082: public Importable getParent() {
083: return parent;
084: }
085:
086: public void setParent(Importable parent) {
087: this .parent = parent;
088: }
089:
090: public String getGuid() {
091: return guid;
092: }
093:
094: public void setGuid(String guid) {
095: this .guid = guid;
096: }
097:
098: public String getLegacyGroup() {
099: return legacyGroup;
100: }
101:
102: public void setLegacyGroup(String legacyGroup) {
103: this .legacyGroup = legacyGroup;
104: }
105:
106: public String getContextPath() {
107: return contextPath;
108: }
109:
110: public void setContextPath(String contextPath) {
111: this.contextPath = contextPath;
112: }
113: }
|