001: package org.sakaibrary.osid.repository.xserver;
002:
003: /*******************************************************************************
004: * $URL:
005: * https://source.sakaiproject.org/svn/trunk/sakai/osid/api-impl/src/java/org/sakaiproject/component/osid/id/IdManager.java
006: * $ $Id: RecordStructure.java 22640 2007-03-14 21:04:07Z jimeng@umich.edu $
007: *******************************************************************************
008: *
009: * Copyright (c) 2003, 2004, 2005 The Regents of the University of Michigan,
010: * Trustees of Indiana University, Board of Trustees of the Leland Stanford,
011: * Jr., University, and The MIT Corporation
012: *
013: * Licensed under the Educational Community License Version 1.0 (the "License");
014: * By obtaining, using and/or copying this Original Work, you agree that you
015: * have read, understand, and will comply with the terms and conditions of the
016: * Educational Community License. You may obtain a copy of the License at:
017: *
018: * http://cvs.sakaiproject.org/licenses/license_1_0.html
019: *
020: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
021: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
022: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
023: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
024: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
025: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
026: * SOFTWARE.
027: *
028: ******************************************************************************/
029:
030: /**
031: * @author Massachusetts Institute of Techbology, Sakai Software Development
032: * Team
033: * @version
034: */
035: public class RecordStructure implements
036: org.osid.repository.RecordStructure {
037:
038: private static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
039: .getLog("org.sakaibrary.osid.repository.xserver.RecordStructure");
040:
041: private org.osid.shared.Id id = null;
042: private String idString = "af106d4f201080006d751920168000100";
043: private String displayName = "Citation";
044: private String description = "Encapsulates citation information for "
045: + "resources from scholarly electronic databases or metasearch engines.";
046: private String format = "";
047: private String schema = "";
048: private org.osid.shared.Type type = new Type("sakaibrary",
049: "recordStructure", "citation",
050: "Citation for Scholarly Resources");
051: private boolean repeatable = false;
052:
053: private static RecordStructure recordStructure = new RecordStructure();
054:
055: protected static RecordStructure getInstance() {
056: return recordStructure;
057: }
058:
059: protected RecordStructure() {
060: try {
061: this .id = Managers.getIdManager().getId(this .idString);
062: } catch (Throwable t) {
063: LOG.warn(t.getMessage());
064: }
065: }
066:
067: public String getDisplayName()
068: throws org.osid.repository.RepositoryException {
069: return this .displayName;
070: }
071:
072: public String getDescription()
073: throws org.osid.repository.RepositoryException {
074: return this .description;
075: }
076:
077: public String getFormat()
078: throws org.osid.repository.RepositoryException {
079: return this .format;
080: }
081:
082: public String getSchema()
083: throws org.osid.repository.RepositoryException {
084: return this .schema;
085: }
086:
087: public org.osid.shared.Type getType()
088: throws org.osid.repository.RepositoryException {
089: return this .type;
090: }
091:
092: public boolean isRepeatable()
093: throws org.osid.repository.RepositoryException {
094: return this .repeatable;
095: }
096:
097: public org.osid.shared.Id getId()
098: throws org.osid.repository.RepositoryException {
099: return this .id;
100: }
101:
102: public void updateDisplayName(String displayName)
103: throws org.osid.repository.RepositoryException {
104: throw new org.osid.repository.RepositoryException(
105: org.osid.OsidException.UNIMPLEMENTED);
106: }
107:
108: public org.osid.repository.PartStructureIterator getPartStructures()
109: throws org.osid.repository.RepositoryException {
110: java.util.Vector results = new java.util.Vector();
111: try {
112: results.addElement(CreatorPartStructure.getInstance());
113: results.addElement(DatePartStructure.getInstance());
114: results
115: .addElement(DateRetrievedPartStructure
116: .getInstance());
117: results.addElement(DOIPartStructure.getInstance());
118: results.addElement(EditionPartStructure.getInstance());
119: results.addElement(EndPagePartStructure.getInstance());
120: results.addElement(InLineCitationPartStructure
121: .getInstance());
122: results.addElement(IssuePartStructure.getInstance());
123: results.addElement(LanguagePartStructure.getInstance());
124: results
125: .addElement(LocIdentifierPartStructure
126: .getInstance());
127: results.addElement(NotePartStructure.getInstance());
128: results
129: .addElement(IsnIdentifierPartStructure
130: .getInstance());
131: results.addElement(OpenUrlPartStructure.getInstance());
132: results.addElement(PagesPartStructure.getInstance());
133: results.addElement(PublicationLocationPartStructure
134: .getInstance());
135: results.addElement(PublisherPartStructure.getInstance());
136: results.addElement(RightsPartStructure.getInstance());
137: results.addElement(SourceTitlePartStructure.getInstance());
138: results.addElement(StartPagePartStructure.getInstance());
139: results.addElement(SubjectPartStructure.getInstance());
140: results.addElement(TypePartStructure.getInstance());
141: results.addElement(URLPartStructure.getInstance());
142: results.addElement(URLLabelPartStructure.getInstance());
143: results.addElement(URLFormatPartStructure.getInstance());
144: results.addElement(VolumePartStructure.getInstance());
145: results.addElement(YearPartStructure.getInstance());
146: } catch (Throwable t) {
147: throw new org.osid.repository.RepositoryException(
148: org.osid.OsidException.OPERATION_FAILED);
149: }
150: return new PartStructureIterator(results);
151: }
152:
153: public boolean validateRecord(org.osid.repository.Record record)
154: throws org.osid.repository.RepositoryException {
155: return true;
156: }
157: }
|