001: package edu.indiana.lib.osid.base.repository.http;
002:
003: public class URLPartStructure implements
004: org.osid.repository.PartStructure {
005: private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils
006: .getLog(URLPartStructure.class);
007:
008: private org.osid.shared.Id URL_PART_STRUCTURE_ID = null;
009: private org.osid.shared.Type type = new Type("mit.edu",
010: "partStructure", "url", "URL associated with resource");
011: private String displayName = "URL";
012: private String description = "URL associated with resource (i.e. "
013: + "electronic version)";
014: private boolean mandatory = false;
015: private boolean populatedByRepository = false;
016: private boolean repeatable = true;
017:
018: private static URLPartStructure urlPartStructure = new URLPartStructure();
019:
020: protected static URLPartStructure getInstance() {
021: return urlPartStructure;
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 URLPartStructure() {
064: try {
065: this .URL_PART_STRUCTURE_ID = Managers.getIdManager().getId(
066: "92afe2b670108000f4689e10000102");
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 .URL_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: }
|