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