001: package edu.indiana.lib.osid.base.repository.http;
002:
003: /*******************************************************************************
004: * Copyright (c) 2003, 2004, 2005 The Regents of the University of Michigan,
005: * Trustees of Indiana University, Board of Trustees of the Leland Stanford,
006: * Jr., University, and The MIT Corporation
007: *
008: * Licensed under the Educational Community License Version 1.0 (the "License");
009: * By obtaining, using and/or copying this Original Work, you agree that you
010: * have read, understand, and will comply with the terms and conditions of the
011: * Educational Community License. You may obtain a copy of the License at:
012: *
013: * http://cvs.sakaiproject.org/licenses/license_1_0.html
014: *
015: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
016: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
017: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
018: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
019: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
020: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
021: * SOFTWARE.
022: *
023: *******************************************************************************/
024:
025: public class RightsPartStructure implements
026: org.osid.repository.PartStructure {
027:
028: private static org.apache.commons.logging.Log _log = edu.indiana.lib.twinpeaks.util.LogUtils
029: .getLog(RightsPartStructure.class);
030:
031: private org.osid.shared.Id RIGHTS_PART_STRUCTURE_ID = null;
032: private org.osid.shared.Type type = new Type("mit.edu",
033: "partStructure", "rights", "Rights");
034: private String displayName = "Rights";
035: private String description = "Typically, Rights will contain a rights "
036: + "management statement for the resource, or reference a service "
037: + "providing such information. Rights information often encompasses "
038: + "Intellectual Property Rights (IPR), Copyright, and various "
039: + "Property Rights. If the Rights element is absent, no assumptions "
040: + "may be made about any rights held in or over the resource.";
041: private boolean mandatory = false;
042: private boolean populatedByRepository = false;
043: private boolean repeatable = true;
044:
045: private static RightsPartStructure rightsPartStructure = new RightsPartStructure();
046:
047: protected static RightsPartStructure getInstance() {
048: return rightsPartStructure;
049: }
050:
051: /**
052: * Public method to fetch the PartStructure ID
053: */
054: public static org.osid.shared.Id getPartStructureId() {
055: org.osid.shared.Id id = null;
056:
057: try {
058: id = getInstance().getId();
059: } catch (org.osid.repository.RepositoryException ignore) {
060: }
061:
062: return id;
063: }
064:
065: public String getDisplayName()
066: throws org.osid.repository.RepositoryException {
067: return this .displayName;
068: }
069:
070: public String getDescription()
071: throws org.osid.repository.RepositoryException {
072: return this .description;
073: }
074:
075: public boolean isMandatory()
076: throws org.osid.repository.RepositoryException {
077: return this .mandatory;
078: }
079:
080: public boolean isPopulatedByRepository()
081: throws org.osid.repository.RepositoryException {
082: return this .populatedByRepository;
083: }
084:
085: public boolean isRepeatable()
086: throws org.osid.repository.RepositoryException {
087: return this .repeatable;
088: }
089:
090: protected RightsPartStructure() {
091: try {
092: this .RIGHTS_PART_STRUCTURE_ID = Managers.getIdManager()
093: .getId("5492741f201080006d751920168000100");
094: } catch (Throwable t) {
095: }
096: }
097:
098: public void updateDisplayName(String displayName)
099: throws org.osid.repository.RepositoryException {
100: throw new org.osid.repository.RepositoryException(
101: org.osid.OsidException.UNIMPLEMENTED);
102: }
103:
104: public org.osid.shared.Id getId()
105: throws org.osid.repository.RepositoryException {
106: return this .RIGHTS_PART_STRUCTURE_ID;
107: }
108:
109: public org.osid.shared.Type getType()
110: throws org.osid.repository.RepositoryException {
111: return this .type;
112: }
113:
114: public org.osid.repository.RecordStructure getRecordStructure()
115: throws org.osid.repository.RepositoryException {
116: return RecordStructure.getInstance();
117: }
118:
119: public boolean validatePart(org.osid.repository.Part part)
120: throws org.osid.repository.RepositoryException {
121: return true;
122: }
123:
124: public org.osid.repository.PartStructureIterator getPartStructures()
125: throws org.osid.repository.RepositoryException {
126: return new PartStructureIterator(new java.util.Vector());
127: }
128: }
|