001: /**********************************************************************************
002: * $URL: $
003: * $Id: $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.component.osid.repository.srw;
021:
022: /**
023: * @author Massachusetts Institute of Techbology, Sakai Software Development Team
024: * @version
025: */
026: public class ContributorPartStructure implements
027: org.osid.repository.PartStructure {
028: private org.osid.shared.Id CONTRIBUTOR_PART_STRUCTURE_ID = null;
029: private org.osid.shared.Type type = new Type("mit.edu",
030: "partStructure", "contributor", "Contributor");
031: private String displayName = "Contributor";
032: private String description = "Examples of Contributor include a person, an organization, or a service. Typically, the name of a Contributor should be used to indicate the entity.";
033: private boolean mandatory = false;
034: private boolean populatedByRepository = false;
035: private boolean repeatable = true;
036: private static ContributorPartStructure contributorPartStructure = new ContributorPartStructure();
037:
038: protected static ContributorPartStructure getInstance() {
039: return contributorPartStructure;
040: }
041:
042: public String getDisplayName()
043: throws org.osid.repository.RepositoryException {
044: return this .displayName;
045: }
046:
047: public String getDescription()
048: throws org.osid.repository.RepositoryException {
049: return this .description;
050: }
051:
052: public boolean isMandatory()
053: throws org.osid.repository.RepositoryException {
054: return this .mandatory;
055: }
056:
057: public boolean isPopulatedByRepository()
058: throws org.osid.repository.RepositoryException {
059: return this .populatedByRepository;
060: }
061:
062: public boolean isRepeatable()
063: throws org.osid.repository.RepositoryException {
064: return this .repeatable;
065: }
066:
067: protected ContributorPartStructure() {
068: try {
069: this .CONTRIBUTOR_PART_STRUCTURE_ID = Managers
070: .getIdManager().getId(
071: "18a4541f201080006d751920168000100");
072: } catch (Throwable t) {
073: }
074: }
075:
076: public void updateDisplayName(String displayName)
077: throws org.osid.repository.RepositoryException {
078: throw new org.osid.repository.RepositoryException(
079: org.osid.OsidException.UNIMPLEMENTED);
080: }
081:
082: public org.osid.shared.Id getId()
083: throws org.osid.repository.RepositoryException {
084: return this .CONTRIBUTOR_PART_STRUCTURE_ID;
085: }
086:
087: public org.osid.shared.Type getType()
088: throws org.osid.repository.RepositoryException {
089: return this .type;
090: }
091:
092: public org.osid.repository.RecordStructure getRecordStructure()
093: throws org.osid.repository.RepositoryException {
094: return RecordStructure.getInstance();
095: }
096:
097: public boolean validatePart(org.osid.repository.Part part)
098: throws org.osid.repository.RepositoryException {
099: return true;
100: }
101:
102: public org.osid.repository.PartStructureIterator getPartStructures()
103: throws org.osid.repository.RepositoryException {
104: return new PartStructureIterator(new java.util.Vector());
105: }
106: }
|