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