001: package org.sakaibrary.osid.repository.xserver;
002:
003: /*******************************************************************************
004: * Copyright (c) 2003, 2004, 2005 The Regents of the University of Michigan,
005: * Trustees of Indiana University, Board of Trustees of the Leland Stanford,
006: * Jr., University, and The MIT Corporation
007: *
008: * Licensed under the Educational Community License Version 1.0 (the "License");
009: * By obtaining, using and/or copying this Original Work, you agree that you
010: * have read, understand, and will comply with the terms and conditions of the
011: * Educational Community License. You may obtain a copy of the License at:
012: *
013: * http://cvs.sakaiproject.org/licenses/license_1_0.html
014: *
015: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
016: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
017: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
018: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
019: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
020: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
021: * SOFTWARE.
022: *
023: *******************************************************************************/
024:
025: public class VolumePartStructure implements
026: org.osid.repository.PartStructure {
027: private static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
028: .getLog("org.sakaibrary.osid.repository.xserver.VolumePartStructure");
029:
030: private org.osid.shared.Id VOLUME_PART_STRUCTURE_ID = null;
031: private org.osid.shared.Type type = new Type("sakaibrary",
032: "partStructure", "volume", "Volume number of source");
033: private String displayName = "Volume";
034: private String description = "Volume number of source (i.e. Journal title"
035: + ", vol. 23)";
036: private boolean mandatory = false;
037: private boolean populatedByRepository = false;
038: private boolean repeatable = false;
039:
040: private static VolumePartStructure volumePartStructure;
041:
042: private VolumePartStructure() {
043: try {
044: this .VOLUME_PART_STRUCTURE_ID = Managers.getIdManager()
045: .getId("011293y7h98332do29873e1v000z02");
046: } catch (Throwable t) {
047: LOG
048: .warn("VolumePartStructure() failed to get partStructure id: "
049: + t.getMessage());
050: }
051: }
052:
053: protected static synchronized VolumePartStructure getInstance() {
054: if (volumePartStructure == null) {
055: volumePartStructure = new VolumePartStructure();
056: }
057: return volumePartStructure;
058: }
059:
060: public String getDisplayName()
061: throws org.osid.repository.RepositoryException {
062: return this .displayName;
063: }
064:
065: public String getDescription()
066: throws org.osid.repository.RepositoryException {
067: return this .description;
068: }
069:
070: public boolean isMandatory()
071: throws org.osid.repository.RepositoryException {
072: return this .mandatory;
073: }
074:
075: public boolean isPopulatedByRepository()
076: throws org.osid.repository.RepositoryException {
077: return this .populatedByRepository;
078: }
079:
080: public boolean isRepeatable()
081: throws org.osid.repository.RepositoryException {
082: return this .repeatable;
083: }
084:
085: public void updateDisplayName(String displayName)
086: throws org.osid.repository.RepositoryException {
087: throw new org.osid.repository.RepositoryException(
088: org.osid.OsidException.UNIMPLEMENTED);
089: }
090:
091: public org.osid.shared.Id getId()
092: throws org.osid.repository.RepositoryException {
093: return this .VOLUME_PART_STRUCTURE_ID;
094: }
095:
096: public org.osid.shared.Type getType()
097: throws org.osid.repository.RepositoryException {
098: return this .type;
099: }
100:
101: public org.osid.repository.RecordStructure getRecordStructure()
102: throws org.osid.repository.RepositoryException {
103: return RecordStructure.getInstance();
104: }
105:
106: public boolean validatePart(org.osid.repository.Part part)
107: throws org.osid.repository.RepositoryException {
108: return true;
109: }
110:
111: public org.osid.repository.PartStructureIterator getPartStructures()
112: throws org.osid.repository.RepositoryException {
113: return new PartStructureIterator(new java.util.Vector());
114: }
115: }
|