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