Source Code Cross Referenced for AssignmentService.java in  » ERP-CRM-Financial » sakai » org » sakaiproject » assignment » api » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ERP CRM Financial » sakai » org.sakaiproject.assignment.api 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**********************************************************************************
002:         * $URL: https://source.sakaiproject.org/svn/assignment/tags/sakai_2-4-1/assignment-api/api/src/java/org/sakaiproject/assignment/api/AssignmentService.java $
003:         * $Id: AssignmentService.java 10870 2006-06-19 14:17:26Z zqian@umich.edu $
004:         ***********************************************************************************
005:         *
006:         * Copyright (c) 2003, 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.assignment.api;
021:
022:        import java.util.Collection;
023:        import java.util.Iterator;
024:        import java.util.List;
025:
026:        import org.sakaiproject.entity.api.EntityProducer;
027:        import org.sakaiproject.exception.IdInvalidException;
028:        import org.sakaiproject.exception.IdUnusedException;
029:        import org.sakaiproject.exception.IdUsedException;
030:        import org.sakaiproject.exception.InUseException;
031:        import org.sakaiproject.exception.PermissionException;
032:        import org.sakaiproject.user.api.User;
033:        import org.w3c.dom.Element;
034:
035:        /**
036:         * <p>
037:         * AssignmentService is the service that handles assignments.
038:         * </p>
039:         * <p>
040:         * Each Assignment has an associated AssignmentContent (an AssignmentContent can belong to more the one Assignment) and a list of AssignmentSubmission (the student responses to the Assignment).
041:         * </p>
042:         */
043:        public interface AssignmentService extends EntityProducer {
044:            /** The type string for this application: should not change over time as it may be stored in various parts of persistent entities. */
045:            static final String APPLICATION_ID = "sakai:assignment";
046:
047:            /** This string starts the references to resources in this service. */
048:            public static final String REFERENCE_ROOT = "/assignment";
049:
050:            /** Security lock for adding an assignment. */
051:            public static final String SECURE_ADD_ASSIGNMENT = "asn.new";
052:
053:            /** Security lock for adding an assignment. */
054:            public static final String SECURE_ADD_ASSIGNMENT_CONTENT = "asn.new";
055:
056:            /** Security lock for adding an assignment submission. */
057:            public static final String SECURE_ADD_ASSIGNMENT_SUBMISSION = "asn.submit";
058:
059:            /** Security lock for removing an assignment. */
060:            public static final String SECURE_REMOVE_ASSIGNMENT = "asn.delete";
061:
062:            /** Security lock for removing an assignment content. */
063:            public static final String SECURE_REMOVE_ASSIGNMENT_CONTENT = "asn.delete";
064:
065:            /** Security lock for removing an assignment submission. */
066:            public static final String SECURE_REMOVE_ASSIGNMENT_SUBMISSION = "asn.delete";
067:
068:            /** Security lock for accessing an assignment. */
069:            public static final String SECURE_ACCESS_ASSIGNMENT = "asn.read";
070:
071:            /** Security lock for accessing an assignment content. */
072:            public static final String SECURE_ACCESS_ASSIGNMENT_CONTENT = "asn.read";
073:
074:            /** Security lock for accessing an assignment submission. */
075:            public static final String SECURE_ACCESS_ASSIGNMENT_SUBMISSION = "asn.submit";
076:
077:            /** Security lock for updating an assignment. */
078:            public static final String SECURE_UPDATE_ASSIGNMENT = "asn.revise";
079:
080:            /** Security lock for updating an assignment content. */
081:            public static final String SECURE_UPDATE_ASSIGNMENT_CONTENT = "asn.revise";
082:
083:            /** Security lock for updating an assignment submission. */
084:            public static final String SECURE_UPDATE_ASSIGNMENT_SUBMISSION = "asn.submit";
085:
086:            /** Security lock for grading submission */
087:            public static final String SECURE_GRADE_ASSIGNMENT_SUBMISSION = "asn.grade";
088:
089:            /** Security function giving the user permission to all groups, if granted to at the site level. */
090:            public static final String SECURE_ALL_GROUPS = "asn.all.groups";
091:
092:            /** The Reference type for a site where site groups are to be considered in security computation. */
093:            public static final String REF_TYPE_SITE_GROUPS = "site-groups";
094:
095:            /** The Reference type for an assignment. */
096:            public static final String REF_TYPE_ASSIGNMENT = "a";
097:
098:            /** The Reference type for an assignment where site groups are to be considered in security computation. */
099:            public static final String REF_TYPE_ASSIGNMENT_GROUPS = "a-groups";
100:
101:            /** The Reference type for a submission. */
102:            public static final String REF_TYPE_SUBMISSION = "s";
103:
104:            /** The Reference type for a content. */
105:            public static final String REF_TYPE_CONTENT = "c";
106:
107:            /** The Reference type for a grade spreadsheet. */
108:            public static final String REF_TYPE_GRADES = "grades";
109:
110:            /** The Reference type for a submissions zip. */
111:            public static final String REF_TYPE_SUBMISSIONS = "submissions";
112:
113:            /**
114:             * Check permissions for adding an Assignment.
115:             * 
116:             * @param context -
117:             *        Describes the portlet context - generated with DefaultId.getChannel().
118:             * @return True if the current User is allowed to add an Assignment, false if not.
119:             */
120:            public boolean allowAddAssignment(String context);
121:
122:            /**
123:             * Check if the user has permission to add a site-wide (not grouped) assignment.
124:             * 
125:             * @param context -
126:             *        Describes the portlet context - generated with DefaultId.getChannel().
127:             * @return true if the user has permission to add a channel-wide (not grouped) assignment.
128:             */
129:            boolean allowAddSiteAssignment(String context);
130:
131:            /**
132:             * Check permissions for reading an Assignment.
133:             * 
134:             * @param assignmentReference -
135:             *        The Assignment's reference.
136:             * @return True if the current User is allowed to get the Assignment, false if not.
137:             */
138:            public boolean allowGetAssignment(String assignmentReference);
139:
140:            /**
141:             * Get the collection of Groups defined for the context of this site that the end user has add assignment permissions in.
142:             * 
143:             * @param context -
144:             *        Describes the portlet context - generated with DefaultId.getChannel().
145:             * @return The Collection (Group) of groups defined for the context of this site that the end user has add assignment permissions in, empty if none.
146:             */
147:            Collection getGroupsAllowAddAssignment(String context);
148:
149:            /**
150:             * Check permissions for updating an Assignment.
151:             * 
152:             * @param assignmentReference -
153:             *        The Assignment's reference.
154:             * @return True if the current User is allowed to update the Assignment, false if not.
155:             */
156:            public boolean allowUpdateAssignment(String assignmentReference);
157:
158:            /**
159:             * Check permissions for removing an Assignment.
160:             * 
161:             * @param assignmentReference -
162:             *        The Assignment's reference.
163:             * @return True if the current User is allowed to remove the Assignment, false if not.
164:             */
165:            public boolean allowRemoveAssignment(String assignmentReference);
166:
167:            /**
168:             * Check permissions for adding an AssignmentContent.
169:             * 
170:             * @param context -
171:             *        Describes the portlet context - generated with DefaultId.getChannel().
172:             * @return True if the current User is allowed to add an AssignmentContent, false if not.
173:             */
174:            public boolean allowAddAssignmentContent(String context);
175:
176:            /**
177:             * Check permissions for get AssignmentContent
178:             * 
179:             * @param contentReference -
180:             *        The AssignmentContent reference.
181:             * @return True if the current User is allowed to get the AssignmentContent, false if not.
182:             */
183:            public boolean allowGetAssignmentContent(String contentReference);
184:
185:            /**
186:             * Check permissions for updating AssignmentContent
187:             * 
188:             * @param contentReference -
189:             *        The AssignmentContent reference.
190:             * @return True if the current User is allowed to update the AssignmentContent, false if not.
191:             */
192:            public boolean allowUpdateAssignmentContent(String contentReference);
193:
194:            /**
195:             * Check permissions for remove Assignment content
196:             * 
197:             * @param contentReference -
198:             *        The AssignmentContent reference.
199:             * @return True if the current User is allowed to remove the AssignmentContent, false if not.
200:             */
201:            public boolean allowRemoveAssignmentContent(String contentReference);
202:
203:            /**
204:             * Check permissions for add AssignmentSubmission
205:             * 
206:             * @param context -
207:             *        Describes the portlet context - generated with DefaultId.getChannel().
208:             * @return True if the current User is allowed to add an AssignmentSubmission, false if not.
209:             */
210:            public boolean allowAddSubmission(String context);
211:
212:            /**
213:             * Get the List of Users who can addSubmission() for this assignment.
214:             * 
215:             * @param assignmentReference -
216:             *        a reference to an assignment
217:             * @return the List (User) of users who can addSubmission() for this assignment.
218:             */
219:            public List allowAddSubmissionUsers(String assignmentReference);
220:
221:            /**
222:             * Get the List of Users who can add assignment
223:             * 
224:             * @param context -
225:             *        Describes the portlet context - generated with DefaultId.getChannel().
226:             * @return the List (User) of users who can add assignment
227:             */
228:            public List allowAddAssignmentUsers(String context);
229:
230:            /**
231:             * Check permissions for reading a Submission.
232:             * 
233:             * @param submissionReference -
234:             *        The Submission's reference.
235:             * @return True if the current User is allowed to get the AssignmentSubmission, false if not.
236:             */
237:            public boolean allowGetSubmission(String submissionReference);
238:
239:            /**
240:             * Check permissions for updating Submission.
241:             * 
242:             * @param submissionReference -
243:             *        The Submission's reference.
244:             * @return True if the current User is allowed to update the AssignmentSubmission, false if not.
245:             */
246:            public boolean allowUpdateSubmission(String submissionReference);
247:
248:            /**
249:             * Check permissions for remove Submission
250:             * 
251:             * @param submissionReference -
252:             *        The Submission's reference.
253:             * @return True if the current User is allowed to remove the AssignmentSubmission, false if not.
254:             */
255:            public boolean allowRemoveSubmission(String submissionReference);
256:
257:            /**
258:             * Check permissions for grading Submission
259:             * 
260:             * @param submissionReference -
261:             *        The Submission's reference.
262:             * @return True if the current User is allowed to grade the AssignmentSubmission, false if not.
263:             */
264:            public boolean allowGradeSubmission(String submissionReference);
265:
266:            /**
267:             * Creates and adds a new Assignment to the service.
268:             * 
269:             * @param context -
270:             *        Describes the portlet context - generated with DefaultId.getChannel().
271:             * @return AssignmentEdit The new Assignment object.
272:             * @throws IdInvalidException
273:             *         if the id contains prohibited characers.
274:             * @throws IdUsedException
275:             *         if the id is already used in the service.
276:             * @throws PermissionException
277:             *         if current User does not have permission to do this.
278:             */
279:            public AssignmentEdit addAssignment(String context)
280:                    throws PermissionException;
281:
282:            /**
283:             * Add a new assignment to the directory, from a definition in XML. Must commitEdit() to make official, or cancelEdit() when done!
284:             * 
285:             * @param el
286:             *        The XML DOM Element defining the assignment.
287:             * @return A locked AssignmentEdit object (reserving the id).
288:             * @exception IdInvalidException
289:             *            if the assignment id is invalid.
290:             * @exception IdUsedException
291:             *            if the assignment id is already used.
292:             * @exception PermissionException
293:             *            if the current user does not have permission to add an assignnment.
294:             */
295:            public AssignmentEdit mergeAssignment(Element el)
296:                    throws IdInvalidException, IdUsedException,
297:                    PermissionException;
298:
299:            /**
300:             * Creates and adds a new Assignment to the service which is a copy of an existing Assignment.
301:             * 
302:             * @param context -
303:             *        From DefaultId.getChannel(RunData)
304:             * @param assignmentReference -
305:             *        The reference of the Assignment to be duplicated.
306:             * @return The new AssignmentEdit object, or null if the original Assignment does not exist.
307:             * @throws PermissionException
308:             *         if current User does not have permission to do this.
309:             */
310:            public AssignmentEdit addDuplicateAssignment(String context,
311:                    String assignmentReference) throws IdInvalidException,
312:                    PermissionException, IdUsedException, IdUnusedException;
313:
314:            /**
315:             * Removes this Assignment and all references to it.
316:             * 
317:             * @param assignment -
318:             *        The Assignment to remove.
319:             * @throws PermissionException
320:             *         if current User does not have permission to do this.
321:             */
322:            public void removeAssignment(AssignmentEdit assignment)
323:                    throws PermissionException;
324:
325:            /**
326:             * Get a locked assignment object for editing. Must commitEdit() to make official, or cancelEdit() when done!
327:             * 
328:             * @param id
329:             *        The assignment id string.
330:             * @return A AssignmentEdit object for editing.
331:             * @exception IdUnusedException
332:             *            if not found, or if not an AssignmentEdit object
333:             * @exception PermissionException
334:             *            if the current user does not have permission to edit this assignment.
335:             * @exception InUseException
336:             *            if the Assignment object is locked by someone else.
337:             */
338:            public AssignmentEdit editAssignment(String id)
339:                    throws IdUnusedException, PermissionException,
340:                    InUseException;
341:
342:            /**
343:             * Commit the changes made to a AssignmentEdit object, and release the lock. The AssignmentEdit is disabled, and not to be used after this call.
344:             * 
345:             * @param assignment
346:             *        The AssignmentEdit object to commit.
347:             */
348:            public void commitEdit(AssignmentEdit assignment);
349:
350:            /**
351:             * Cancel the changes made to a AssignmentEdit object, and release the lock. The AssignmentEdit is disabled, and not to be used after this call.
352:             * 
353:             * @param assignment
354:             *        The AssignmentEdit object to commit.
355:             */
356:            public void cancelEdit(AssignmentEdit assignment);
357:
358:            /**
359:             * Creates and adds a new AssignmentContent to the service.
360:             * 
361:             * @param context -
362:             *        Describes the portlet context - generated with DefaultId.getChannel().
363:             * @return AssignmentContentEdit The new AssignmentContent object.
364:             * @throws PermissionException
365:             *         if current User does not have permission to do this.
366:             */
367:            public AssignmentContentEdit addAssignmentContent(String context)
368:                    throws PermissionException;
369:
370:            /**
371:             * Add a new AssignmentContent to the directory, from a definition in XML. Must commitEdit() to make official, or cancelEdit() when done!
372:             * 
373:             * @param el
374:             *        The XML DOM Element defining the AssignmentContent.
375:             * @return A locked AssignmentContentEdit object (reserving the id).
376:             * @exception IdInvalidException
377:             *            if the AssignmentContent id is invalid.
378:             * @exception IdUsedException
379:             *            if the AssignmentContent id is already used.
380:             * @exception PermissionException
381:             *            if the current user does not have permission to add an AssignnmentContent.
382:             */
383:            public AssignmentContentEdit mergeAssignmentContent(Element el)
384:                    throws IdInvalidException, IdUsedException,
385:                    PermissionException;
386:
387:            /**
388:             * Creates and adds a new AssignmentContent to the service which is a copy of an existing AssignmentContent.
389:             * 
390:             * @param context -
391:             *        From DefaultId.getChannel(RunData)
392:             * @param contentId -
393:             *        The id of the AssignmentContent to be duplicated.
394:             * @return AssignmentContentEdit The new AssignmentContentEdit object, or null if the original does not exist.
395:             * @throws PermissionException
396:             *         if current User does not have permission to do this.
397:             */
398:            public AssignmentContentEdit addDuplicateAssignmentContent(
399:                    String context, String contentReference)
400:                    throws IdInvalidException, PermissionException,
401:                    IdUnusedException;
402:
403:            /**
404:             * Removes an AssignmentContent
405:             * 
406:             * @param content -
407:             *        the AssignmentContent to remove.
408:             * @throws an
409:             *         AssignmentContentNotEmptyException if this content still has related Assignments.
410:             * @throws PermissionException
411:             *         if current User does not have permission to do this.
412:             */
413:            public void removeAssignmentContent(AssignmentContentEdit content)
414:                    throws AssignmentContentNotEmptyException,
415:                    PermissionException;
416:
417:            /**
418:             * Get a locked AssignmentContent object for editing. Must commitEdit() to make official, or cancelEdit() when done!
419:             * 
420:             * @param id
421:             *        The content id string.
422:             * @return An AssignmentContentEdit object for editing.
423:             * @exception IdUnusedException
424:             *            if not found, or if not an AssignmentContentEdit object
425:             * @exception PermissionException
426:             *            if the current user does not have permission to edit this content.
427:             * @exception InUseException
428:             *            if the AssignmentContent object is locked by someone else.
429:             */
430:            public AssignmentContentEdit editAssignmentContent(String id)
431:                    throws IdUnusedException, PermissionException,
432:                    InUseException;
433:
434:            /**
435:             * Commit the changes made to a AssignmentContentEdit object, and release the lock. The AssignmentContentEdit is disabled, and not to be used after this call.
436:             * 
437:             * @param content
438:             *        The AssignmentContentEdit object to commit.
439:             */
440:            public void commitEdit(AssignmentContentEdit content);
441:
442:            /**
443:             * Cancel the changes made to a AssignmentContentEdit object, and release the lock. The AssignmentContentEdit is disabled, and not to be used after this call.
444:             * 
445:             * @param content
446:             *        The AssignmentContentEdit object to commit.
447:             */
448:            public void cancelEdit(AssignmentContentEdit content);
449:
450:            /**
451:             * Adds an AssignmentSubmission to the service.
452:             * 
453:             * @param context -
454:             *        Describes the portlet context - generated with DefaultId.getChannel().
455:             * @return The new AssignmentSubmissionEdit.
456:             * @exception IdInvalidException
457:             *            if the submission id is invalid.
458:             * @exception IdUsedException
459:             *            if the submission id is already used.
460:             * @throws PermissionException
461:             *         if the current User does not have permission to do this.
462:             */
463:            public AssignmentSubmissionEdit addSubmission(String context,
464:                    String assignmentId) throws PermissionException;
465:
466:            /**
467:             * Add a new AssignmentSubmission to the directory, from a definition in XML. Must commitEdit() to make official, or cancelEdit() when done!
468:             * 
469:             * @param el
470:             *        The XML DOM Element defining the submission.
471:             * @return A locked AssignmentSubmissionEdit object (reserving the id).
472:             * @exception IdInvalidException
473:             *            if the submission id is invalid.
474:             * @exception IdUsedException
475:             *            if the submission id is already used.
476:             * @exception PermissionException
477:             *            if the current user does not have permission to add a submission.
478:             */
479:            public AssignmentSubmissionEdit mergeSubmission(Element el)
480:                    throws IdInvalidException, IdUsedException,
481:                    PermissionException;
482:
483:            /**
484:             * Removes an AssignmentSubmission and all references to it
485:             * 
486:             * @param submission -
487:             *        the AssignmentSubmission to remove.
488:             * @throws PermissionException
489:             *         if current User does not have permission to do this.
490:             */
491:            public void removeSubmission(AssignmentSubmissionEdit submission)
492:                    throws PermissionException;
493:
494:            /**
495:             * Get a locked AssignmentSubmission object for editing. Must commitEdit() to make official, or cancelEdit() when done!
496:             * 
497:             * @param id
498:             *        The submission id string.
499:             * @return An AssignmentSubmissionEdit object for editing.
500:             * @exception IdUnusedException
501:             *            if not found, or if not an AssignmentSubmissionEdit object
502:             * @exception PermissionException
503:             *            if the current user does not have permission to edit this submission.
504:             * @exception InUseException
505:             *            if the AssignmentSubmission object is locked by someone else.
506:             */
507:            public AssignmentSubmissionEdit editSubmission(String id)
508:                    throws IdUnusedException, PermissionException,
509:                    InUseException;
510:
511:            /**
512:             * Commit the changes made to a AssignmentSubmissionEdit object, and release the lock. The AssignmentSubmissionEdit is disabled, and not to be used after this call.
513:             * 
514:             * @param submission
515:             *        The AssignmentSubmissionEdit object to commit.
516:             */
517:            public void commitEdit(AssignmentSubmissionEdit submission);
518:
519:            /**
520:             * Cancel the changes made to a AssignmentSubmissionEdit object, and release the lock. The AssignmentSubmissionEdit is disabled, and not to be used after this call.
521:             * 
522:             * @param submission
523:             *        The AssignmentSubmissionEdit object to commit.
524:             */
525:            public void cancelEdit(AssignmentSubmissionEdit submission);
526:
527:            /**
528:             * Access list of all AssignmentContents created by the User.
529:             * 
530:             * @param owner -
531:             *        The User who's AssignmentContents are requested.
532:             * @return Iterator over all AssignmentContents owned by this User.
533:             */
534:            public Iterator getAssignmentContents(User owner);
535:
536:            /**
537:             * Access the Assignment with the specified id.
538:             * 
539:             * @param assignmentId -
540:             *        The id of the Assignment.
541:             * @return The Assignment corresponding to the id, or null if it does not exist.
542:             * @throws IdUnusedException
543:             *         if there is no object with this id.
544:             * @throws PermissionException
545:             *         if the current user is not allowed to read this.
546:             */
547:            public Assignment getAssignment(String assignmentId)
548:                    throws IdUnusedException, PermissionException;
549:
550:            /**
551:             * Access the AssignmentContent with the specified id.
552:             * 
553:             * @param contentId -
554:             *        The id of the AssignmentContent.
555:             * @return The AssignmentContent corresponding to the id, or null if it does not exist.
556:             * @throws IdUnusedException
557:             *         if there is no object with this id.
558:             * @throws PermissionException
559:             *         if the current user does not have permission to see this.
560:             */
561:            public AssignmentContent getAssignmentContent(String contentId)
562:                    throws IdUnusedException, PermissionException;
563:
564:            /**
565:             * Access the AssignmentSubmission with the specified id.
566:             * 
567:             * @param submissionId -
568:             *        The id of the AssignmentSubmission.
569:             * @return The AssignmentSubmission corresponding to the id, or null if it does not exist.
570:             * @throws IdUnusedException
571:             *         if there is no object with this id.
572:             * @throws PermissionException
573:             *         if the current user is not allowed to read this.
574:             */
575:            public AssignmentSubmission getSubmission(String submissionId)
576:                    throws IdUnusedException, PermissionException;
577:
578:            /**
579:             * Access all the Assignments which have the specified AssignmentContent.
580:             * 
581:             * @param content -
582:             *        The particular AssignmentContent.
583:             * @return Iterator over all the Assignments with the specified AssignmentContent.
584:             */
585:            public Iterator getAssignments(AssignmentContent content);
586:
587:            /**
588:             * Access all the Assignemnts associated with a group.
589:             * 
590:             * @param context -
591:             *        Describes the portlet context - generated with DefaultId.getChannel().
592:             * @return Iterator over all the Assignments associated with a group.
593:             */
594:            public Iterator getAssignmentsForContext(String context);
595:
596:            /**
597:             * Access all the Assignemnts that are not deleted and self-drafted ones
598:             * 
599:             * @param context -
600:             *        Describes the portlet context - generated with DefaultId.getChannel().
601:             * @return List All the Assignments will be listed
602:             */
603:            public List getListAssignmentsForContext(String context);
604:
605:            /**
606:             * Access a User's AssignmentSubmission to a particular Assignment.
607:             * 
608:             * @param assignmentId -
609:             *        The id of the assignment.
610:             * @param person -
611:             *        The User who's Submission you would like.
612:             * @return AssignmentSubmission The user's submission for that Assignment, or null if one does not exist.
613:             * @throws IdUnusedException
614:             *         if the assignmentId does not correspond to an existing Assignment.
615:             * @throws PermissionException
616:             *         if the current user is not allowed to read this.
617:             */
618:            public AssignmentSubmission getSubmission(String assignmentId,
619:                    User person) throws IdUnusedException, PermissionException;
620:
621:            /**
622:             * Get the submissions for an assignment.
623:             * 
624:             * @param assignment -
625:             *        the Assignment who's submissions you would like.
626:             * @return Iterator over all the submissions for an Assignment.
627:             */
628:            public Iterator getSubmissions(Assignment assignment);
629:
630:            /**
631:             * Access the grades spreadsheet for the reference, either for an assignment or all assignments in a context.
632:             * 
633:             * @param ref
634:             *        The reference, either to a specific assignment, or just to an assignment context.
635:             * @return The grades spreadsheet bytes.
636:             * @throws IdUnusedException
637:             *         if there is no object with this id.
638:             * @throws PermissionException
639:             *         if the current user is not allowed to access this.
640:             */
641:            public byte[] getGradesSpreadsheet(String ref)
642:                    throws IdUnusedException, PermissionException;
643:
644:            /**
645:             * Access the submissions zip for the assignment reference.
646:             * 
647:             * @param ref
648:             *        The assignment reference.
649:             * @return The submissions zip bytes.
650:             * @throws IdUnusedException
651:             *         if there is no object with this id.
652:             * @throws PermissionException
653:             *         if the current user is not allowed to access this.
654:             */
655:            public byte[] getSubmissionsZip(String ref)
656:                    throws IdUnusedException, PermissionException;
657:
658:            /**
659:             * Access the internal reference which can be used to assess security clearance.
660:             * 
661:             * @param id
662:             *        The assignment id string.
663:             * @return The the internal reference which can be used to access the resource from within the system.
664:             */
665:            public String assignmentReference(String context, String id);
666:
667:            /**
668:             * Access the internal reference which can be used to access the resource from within the system.
669:             * 
670:             * @param id
671:             *        The content id string.
672:             * @return The the internal reference which can be used to access the resource from within the system.
673:             */
674:            public String contentReference(String context, String id);
675:
676:            /**
677:             * Access the internal reference which can be used to access the resource from within the system.
678:             * 
679:             * @param id
680:             *        The submission id string.
681:             * @return The the internal reference which can be used to access the resource from within the system.
682:             */
683:            public String submissionReference(String context, String id,
684:                    String assignmentId);
685:
686:            /**
687:             * Get the String to form an assignment grade spreadsheet
688:             * 
689:             * @param context
690:             *        The assignment context String
691:             * @param assignmentId
692:             *        The id for the assignment object; when null, indicates all assignment in that context
693:             */
694:            public String gradesSpreadsheetReference(String context,
695:                    String assignmentId);
696:
697:            /**
698:             * Get the string to form an assignment submissions zip file
699:             * 
700:             * @param context
701:             *        The assignment context String
702:             * @param assignmentId
703:             *        The id for the assignment object;
704:             */
705:            public String submissionsZipReference(String context,
706:                    String assignmentId);
707:
708:            /**
709:             * Whether assignment could be assigned to groups
710:             */
711:            public boolean getAllowGroupAssignments();
712:
713:            /**
714:             * Whether assignment with group access can be added to gradebook
715:             */
716:            public boolean getAllowGroupAssignmentsInGradebook();
717:
718:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.