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 FormatPartStructure implements
027: org.osid.repository.PartStructure {
028: private org.osid.shared.Id FORMAT_PART_STRUCTURE_ID = null;
029: private org.osid.shared.Type type = new Type("mit.edu",
030: "partStructure", "format");
031: private String displayName = "Format";
032: private String description = "Typically, Format may include the media-type or dimensions of the resource. Format may be used to identify the software, hardware, or other equipment needed to display or operate the resource. Examples of dimensions include size and duration.";
033: private boolean mandatory = false;
034: private boolean populatedByRepository = false;
035: private boolean repeatable = true;
036: private static FormatPartStructure formatPartStructure = new FormatPartStructure();
037:
038: protected static FormatPartStructure getInstance() {
039: return formatPartStructure;
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 FormatPartStructure() {
068: try {
069: this .FORMAT_PART_STRUCTURE_ID = Managers.getIdManager()
070: .getId("e46d541f201080006d751920168000100");
071: } catch (Throwable t) {
072: }
073: }
074:
075: public void updateDisplayName(String displayName)
076: throws org.osid.repository.RepositoryException {
077: throw new org.osid.repository.RepositoryException(
078: org.osid.OsidException.UNIMPLEMENTED);
079: }
080:
081: public org.osid.shared.Id getId()
082: throws org.osid.repository.RepositoryException {
083: return this .FORMAT_PART_STRUCTURE_ID;
084: }
085:
086: public org.osid.shared.Type getType()
087: throws org.osid.repository.RepositoryException {
088: return this .type;
089: }
090:
091: public org.osid.repository.RecordStructure getRecordStructure()
092: throws org.osid.repository.RepositoryException {
093: return RecordStructure.getInstance();
094: }
095:
096: public boolean validatePart(org.osid.repository.Part part)
097: throws org.osid.repository.RepositoryException {
098: return true;
099: }
100:
101: public org.osid.repository.PartStructureIterator getPartStructures()
102: throws org.osid.repository.RepositoryException {
103: return new PartStructureIterator(new java.util.Vector());
104: }
105: }
|