001: package org.sakaibrary.osid.repository.xserver;
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: private static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
028: .getLog("org.sakaibrary.osid.repository.xserver.RightsPartStructure");
029:
030: private org.osid.shared.Id RIGHTS_PART_STRUCTURE_ID = null;
031: private org.osid.shared.Type type = new Type("mit.edu",
032: "partStructure", "rights", "Rights");
033: private String displayName = "Rights";
034: private String description = "Typically, Rights will contain a rights "
035: + "management statement for the resource, or reference a service "
036: + "providing such information. Rights information often encompasses "
037: + "Intellectual Property Rights (IPR), Copyright, and various "
038: + "Property Rights. If the Rights element is absent, no assumptions "
039: + "may be made about any rights held in or over the resource.";
040: private boolean mandatory = false;
041: private boolean populatedByRepository = false;
042: private boolean repeatable = true;
043:
044: private static RightsPartStructure rightsPartStructure;
045:
046: private RightsPartStructure() {
047: try {
048: this .RIGHTS_PART_STRUCTURE_ID = Managers.getIdManager()
049: .getId("5492741f201080006d751920168000100");
050: } catch (Throwable t) {
051: LOG
052: .warn("RightsPartStructure() failed to get partStructure id: "
053: + t.getMessage());
054: }
055: }
056:
057: protected static synchronized RightsPartStructure getInstance() {
058: if (rightsPartStructure == null) {
059: rightsPartStructure = new RightsPartStructure();
060: }
061: return rightsPartStructure;
062: }
063:
064: public String getDisplayName()
065: throws org.osid.repository.RepositoryException {
066: return this .displayName;
067: }
068:
069: public String getDescription()
070: throws org.osid.repository.RepositoryException {
071: return this .description;
072: }
073:
074: public boolean isMandatory()
075: throws org.osid.repository.RepositoryException {
076: return this .mandatory;
077: }
078:
079: public boolean isPopulatedByRepository()
080: throws org.osid.repository.RepositoryException {
081: return this .populatedByRepository;
082: }
083:
084: public boolean isRepeatable()
085: throws org.osid.repository.RepositoryException {
086: return this .repeatable;
087: }
088:
089: public void updateDisplayName(String displayName)
090: throws org.osid.repository.RepositoryException {
091: throw new org.osid.repository.RepositoryException(
092: org.osid.OsidException.UNIMPLEMENTED);
093: }
094:
095: public org.osid.shared.Id getId()
096: throws org.osid.repository.RepositoryException {
097: return this .RIGHTS_PART_STRUCTURE_ID;
098: }
099:
100: public org.osid.shared.Type getType()
101: throws org.osid.repository.RepositoryException {
102: return this .type;
103: }
104:
105: public org.osid.repository.RecordStructure getRecordStructure()
106: throws org.osid.repository.RepositoryException {
107: return RecordStructure.getInstance();
108: }
109:
110: public boolean validatePart(org.osid.repository.Part part)
111: throws org.osid.repository.RepositoryException {
112: return true;
113: }
114:
115: public org.osid.repository.PartStructureIterator getPartStructures()
116: throws org.osid.repository.RepositoryException {
117: return new PartStructureIterator(new java.util.Vector());
118: }
119: }
|