001: package edu.indiana.lib.osid.base.repository.http;
002:
003: public class NotePartStructure implements
004: org.osid.repository.PartStructure {
005: private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils
006: .getLog(NotePartStructure.class);
007: private org.osid.shared.Id NOTE_PART_STRUCTURE_ID = null;
008: private org.osid.shared.Type type = new Type("sakaibrary",
009: "partStructure", "note",
010: "Note attached to resource metadata");
011: private String displayName = "Note";
012: private String description = "A Note can be any addition to the metadata "
013: + "of a resource";
014: private boolean mandatory = false;
015: private boolean populatedByRepository = false;
016: private boolean repeatable = true;
017:
018: private static NotePartStructure notePartStructure = new NotePartStructure();
019:
020: protected static NotePartStructure getInstance() {
021: return notePartStructure;
022: }
023:
024: /**
025: * Public method to fetch the PartStructure ID
026: */
027: public static org.osid.shared.Id getPartStructureId() {
028: org.osid.shared.Id id = null;
029:
030: try {
031: id = getInstance().getId();
032: } catch (org.osid.repository.RepositoryException ignore) {
033: }
034:
035: return id;
036: }
037:
038: public String getDisplayName()
039: throws org.osid.repository.RepositoryException {
040: return this .displayName;
041: }
042:
043: public String getDescription()
044: throws org.osid.repository.RepositoryException {
045: return this .description;
046: }
047:
048: public boolean isMandatory()
049: throws org.osid.repository.RepositoryException {
050: return this .mandatory;
051: }
052:
053: public boolean isPopulatedByRepository()
054: throws org.osid.repository.RepositoryException {
055: return this .populatedByRepository;
056: }
057:
058: public boolean isRepeatable()
059: throws org.osid.repository.RepositoryException {
060: return this .repeatable;
061: }
062:
063: protected NotePartStructure() {
064: try {
065: this .NOTE_PART_STRUCTURE_ID = Managers.getIdManager()
066: .getId("k12ydf93k0we79s7234d98932g4423999");
067: } catch (Throwable t) {
068: }
069: }
070:
071: public void updateDisplayName(String displayName)
072: throws org.osid.repository.RepositoryException {
073: throw new org.osid.repository.RepositoryException(
074: org.osid.OsidException.UNIMPLEMENTED);
075: }
076:
077: public org.osid.shared.Id getId()
078: throws org.osid.repository.RepositoryException {
079: return this .NOTE_PART_STRUCTURE_ID;
080: }
081:
082: public org.osid.shared.Type getType()
083: throws org.osid.repository.RepositoryException {
084: return this .type;
085: }
086:
087: public org.osid.repository.RecordStructure getRecordStructure()
088: throws org.osid.repository.RepositoryException {
089: return RecordStructure.getInstance();
090: }
091:
092: public boolean validatePart(org.osid.repository.Part part)
093: throws org.osid.repository.RepositoryException {
094: return true;
095: }
096:
097: public org.osid.repository.PartStructureIterator getPartStructures()
098: throws org.osid.repository.RepositoryException {
099: return new PartStructureIterator(new java.util.Vector());
100: }
101:
102: }
|