001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/sam/tags/sakai_2-4-1/samigo-hibernate/src/java/org/sakaiproject/tool/assessment/data/dao/grading/MediaData.java $
003: * $Id: MediaData.java 15083 2006-09-20 20:03:55Z lydial@stanford.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2004, 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the"License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.tool.assessment.data.dao.grading;
021:
022: import org.sakaiproject.tool.assessment.data.ifc.grading.MediaIfc;
023: import org.sakaiproject.tool.assessment.data.ifc.grading.ItemGradingIfc;
024: import java.io.Serializable;
025: import java.util.Date;
026:
027: public class MediaData implements Serializable, MediaIfc {
028: /**
029: *
030: */
031: private static final long serialVersionUID = -437737678404198607L;
032: private Long mediaId;
033: private ItemGradingIfc itemGradingData;
034: private byte[] media;
035: private Long fileSize; // in kilobyte
036: private String mimeType;
037: private String description;
038: private String location;
039: private String filename;
040: private boolean isLink;
041: private boolean isHtmlInline;
042: private Integer status;
043: private String createdBy;
044: private Date createdDate;
045: private String lastModifiedBy;
046: private Date lastModifiedDate;
047: private String duration;
048:
049: public MediaData() {
050: }
051:
052: public MediaData(ItemGradingIfc itemGradingData, byte[] media,
053: Long fileSize, String mimeType, String description,
054: String location, String filename, boolean isLink,
055: boolean isHtmlInline, Integer status, String createdBy,
056: Date createdDate, String lastModifiedBy,
057: Date lastModifiedDate, String duration) {
058: this .itemGradingData = itemGradingData;
059: this .media = media;
060: this .fileSize = fileSize;
061: this .mimeType = mimeType;
062: this .description = description;
063: this .location = location;
064: this .filename = filename;
065: this .isLink = isLink;
066: this .isHtmlInline = isHtmlInline;
067: this .status = status;
068: this .createdBy = createdBy;
069: this .createdDate = createdDate;
070: this .lastModifiedBy = lastModifiedBy;
071: this .lastModifiedDate = lastModifiedDate;
072: this .duration = duration;
073: }
074:
075: public MediaData(Long mediaId, ItemGradingIfc itemGradingData,
076: Long fileSize, String mimeType, String description,
077: String location, String filename, boolean isLink,
078: boolean isHtmlInline, Integer status, String createdBy,
079: Date createdDate, String lastModifiedBy,
080: Date lastModifiedDate, String duration) {
081: this .mediaId = mediaId;
082: this .itemGradingData = itemGradingData;
083: this .fileSize = fileSize;
084: this .mimeType = mimeType;
085: this .description = description;
086: this .location = location;
087: this .filename = filename;
088: this .isLink = isLink;
089: this .isHtmlInline = isHtmlInline;
090: this .status = status;
091: this .createdBy = createdBy;
092: this .createdDate = createdDate;
093: this .lastModifiedBy = lastModifiedBy;
094: this .lastModifiedDate = lastModifiedDate;
095: this .duration = duration;
096: }
097:
098: public MediaData(byte[] media, String mimeType) {
099: setMimeType(mimeType);
100: setMedia(media);
101: setFileSize(new Long(media.length));
102: }
103:
104: public Long getMediaId() {
105: return mediaId;
106: }
107:
108: public void setMediaId(Long mediaId) {
109: this .mediaId = mediaId;
110: }
111:
112: public ItemGradingIfc getItemGradingData() {
113: return itemGradingData;
114: }
115:
116: public void setItemGradingData(ItemGradingIfc itemGradingData) {
117: this .itemGradingData = itemGradingData;
118: }
119:
120: public byte[] getMedia() {
121: return media;
122: }
123:
124: public void setMedia(byte[] media) {
125: this .media = media;
126: }
127:
128: public Long getFileSize() {
129: return fileSize;
130: }
131:
132: public void setFileSize(Long fileSize) {
133: this .fileSize = fileSize;
134: }
135:
136: public void setMimeType(String mimeType) {
137: this .mimeType = mimeType;
138: }
139:
140: public String getMimeType() {
141: return mimeType;
142: }
143:
144: public String getDescription() {
145: return description;
146: }
147:
148: public void setDescription(String pdescription) {
149: description = pdescription;
150: }
151:
152: public String getLocation() {
153: return location;
154: }
155:
156: public void setLocation(String location) {
157: this .location = location;
158: }
159:
160: public String getFilename() {
161: return filename;
162: }
163:
164: public void setFilename(String filename) {
165: this .filename = filename;
166: }
167:
168: public boolean getIsLink() {
169: return isLink;
170: }
171:
172: public void setIsLink(boolean isLink) {
173: this .isLink = isLink;
174: }
175:
176: public boolean getIsHtmlInline() {
177: return isHtmlInline;
178: }
179:
180: public void setIsHtmlInline(boolean isHtmlInline) {
181: this .isHtmlInline = isHtmlInline;
182: }
183:
184: public Integer getStatus() {
185: return this .status;
186: }
187:
188: public void setStatus(Integer status) {
189: this .status = status;
190: }
191:
192: public String getCreatedBy() {
193: return this .createdBy;
194: }
195:
196: public void setCreatedBy(String createdBy) {
197: this .createdBy = createdBy;
198: }
199:
200: public Date getCreatedDate() {
201: return this .createdDate;
202: }
203:
204: public void setCreatedDate(Date createdDate) {
205: this .createdDate = createdDate;
206: }
207:
208: public String getLastModifiedBy() {
209: return this .lastModifiedBy;
210: }
211:
212: public void setLastModifiedBy(String lastModifiedBy) {
213: this .lastModifiedBy = lastModifiedBy;
214: }
215:
216: public Date getLastModifiedDate() {
217: return this .lastModifiedDate;
218: }
219:
220: public void setLastModifiedDate(Date lastModifiedDate) {
221: this .lastModifiedDate = lastModifiedDate;
222: }
223:
224: public String getDuration() {
225: return duration;
226: }
227:
228: public void setDuration(String duration) {
229: this .duration = duration;
230: }
231:
232: // convenient method
233: private boolean durationIsOver;
234:
235: public boolean getDurationIsOver() {
236: return durationIsOver;
237: }
238:
239: public void setDurationIsOver(boolean durationIsOver) {
240: this .durationIsOver = durationIsOver;
241: }
242:
243: private String timeAllowed;
244:
245: public String getTimeAllowed() {
246: return timeAllowed;
247: }
248:
249: public void setTimeAllowed(String timeAllowed) {
250: this.timeAllowed = timeAllowed;
251: }
252: }
|