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 IsnIdentifierPartStructure 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.IsnIdentifierPartStructure");
029:
030: private org.osid.shared.Id ISN_IDENTIFIER_PART_STRUCTURE_ID = null;
031: private org.osid.shared.Type type = new Type("sakaibrary",
032: "partStructure", "isnIdentifier",
033: "International Standard Number");
034: private String displayName = "International Standard Number";
035: private String description = "International Standard Number, usually ISSN"
036: + " or ISBN";
037: private boolean mandatory = false;
038: private boolean populatedByRepository = false;
039: private boolean repeatable = false;
040:
041: private static IsnIdentifierPartStructure isnIdentifierPartStructure;
042:
043: private IsnIdentifierPartStructure() {
044: try {
045: this .ISN_IDENTIFIER_PART_STRUCTURE_ID = Managers
046: .getIdManager().getId(
047: "d7345qe3245a1006esr98n1234bvh8730");
048: } catch (Throwable t) {
049: LOG
050: .warn("IsnIdentifierPartStructure() failed to get partStructure id: "
051: + t.getMessage());
052: }
053: }
054:
055: protected static synchronized IsnIdentifierPartStructure getInstance() {
056: if (isnIdentifierPartStructure == null) {
057: isnIdentifierPartStructure = new IsnIdentifierPartStructure();
058: }
059: return isnIdentifierPartStructure;
060: }
061:
062: public String getDisplayName()
063: throws org.osid.repository.RepositoryException {
064: return this .displayName;
065: }
066:
067: public String getDescription()
068: throws org.osid.repository.RepositoryException {
069: return this .description;
070: }
071:
072: public boolean isMandatory()
073: throws org.osid.repository.RepositoryException {
074: return this .mandatory;
075: }
076:
077: public boolean isPopulatedByRepository()
078: throws org.osid.repository.RepositoryException {
079: return this .populatedByRepository;
080: }
081:
082: public boolean isRepeatable()
083: throws org.osid.repository.RepositoryException {
084: return this .repeatable;
085: }
086:
087: public void updateDisplayName(String displayName)
088: throws org.osid.repository.RepositoryException {
089: throw new org.osid.repository.RepositoryException(
090: org.osid.OsidException.UNIMPLEMENTED);
091: }
092:
093: public org.osid.shared.Id getId()
094: throws org.osid.repository.RepositoryException {
095: return this .ISN_IDENTIFIER_PART_STRUCTURE_ID;
096: }
097:
098: public org.osid.shared.Type getType()
099: throws org.osid.repository.RepositoryException {
100: return this .type;
101: }
102:
103: public org.osid.repository.RecordStructure getRecordStructure()
104: throws org.osid.repository.RepositoryException {
105: return RecordStructure.getInstance();
106: }
107:
108: public boolean validatePart(org.osid.repository.Part part)
109: throws org.osid.repository.RepositoryException {
110: return true;
111: }
112:
113: public org.osid.repository.PartStructureIterator getPartStructures()
114: throws org.osid.repository.RepositoryException {
115: return new PartStructureIterator(new java.util.Vector());
116: }
117: }
|