public abstract class BaseHibernateManager
extends org.springframework.orm.hibernate3.support.HibernateDaoSupport
| Modifier and Type | Field and Description |
|---|---|
protected Authn |
authn |
protected EventTrackingService |
eventTrackingService |
protected GradebookExternalAssessmentService |
externalAssessmentService |
static int |
MAX_NUMBER_OF_SQL_PARAMETERS_IN_LIST |
protected Map |
propertiesMap |
protected SectionAwareness |
sectionAwareness |
protected ServerConfigurationService |
serverConfigurationService |
| Constructor and Description |
|---|
BaseHibernateManager() |
| Modifier and Type | Method and Description |
|---|---|
Long |
addPermission(Long gradebookId,
String userId,
String function,
Long categoryId,
String groupId) |
protected boolean |
assignmentNameExists(org.hibernate.Session session,
String name,
Gradebook gradebook) |
protected Double |
calculateEquivalentPercent(Double doublePointsPossible,
Double doublePointsEarned) |
protected Double |
calculateEquivalentPointValueForPercent(Double doublePointsPossible,
Double doublePercentEarned) |
protected List |
convertPointsToLetterGrade(Gradebook gradebook,
List studentRecordsFromDB)
Converts points to letter grade for the given AssignmentGradeRecords
|
protected List |
convertPointsToPercentage(Gradebook gradebook,
List studentRecordsFromDB)
Converts points to percentage for the given AssignmentGradeRecords
|
Long |
createAssignment(Long gradebookId,
String name,
Double points,
Date dueDate,
Boolean isNotCounted,
Boolean isReleased,
Boolean isExtraCredit) |
Long |
createAssignmentForCategory(Long gradebookId,
Long categoryId,
String name,
Double points,
Date dueDate,
Boolean isNotCounted,
Boolean isReleased,
Boolean isExtraCredit) |
Long |
createCategory(Long gradebookId,
String name,
Double weight,
Integer drop_lowest,
Integer dropHighest,
Integer keepHighest,
Boolean is_extra_credit) |
Long |
createCategory(Long gradebookId,
String name,
Double weight,
Integer drop_lowest,
Integer dropHighest,
Integer keepHighest,
Boolean is_extra_credit,
Integer categoryOrder) |
void |
createDefaultLetterGradePercentMapping(Map gradeMap) |
void |
createOrUpdateDefaultLetterGradePercentMapping(Map gradeMap) |
Long |
createUngradedAssignment(Long gradebookId,
String name,
Date dueDate,
Boolean isNotCounted,
Boolean isReleased) |
Long |
createUngradedAssignmentForCategory(Long gradebookId,
Long categoryId,
String name,
Date dueDate,
Boolean isNotCounted,
Boolean isReleased) |
void |
deletePermission(Permission perm)
Deprecated.
|
protected List |
filterGradeRecordsByStudents(Collection gradeRecords,
Collection studentUids)
Oracle has a low limit on the maximum length of a parameter list
in SQL queries of the form "WHERE tbl.col IN (:paramList)".
|
protected void |
finalizeNullGradeRecords(Gradebook gradebook) |
protected Set |
getAllStudentUids(String gradebookUid) |
Assignment |
getAssignment(Long gradableObjectId) |
protected AssignmentGradeRecord |
getAssignmentGradeRecord(Assignment assignment,
String studentUid,
org.hibernate.Session session) |
protected List |
getAssignments(Long gradebookId,
org.hibernate.Session session) |
CommentDefinition |
getAssignmentScoreComment(String gradebookUid,
Long assignmentId,
String studentUid) |
List |
getAssignmentsForCategory(Long categoryId) |
protected Assignment |
getAssignmentWithoutStats(String gradebookUid,
Long assignmentId,
org.hibernate.Session session) |
protected Assignment |
getAssignmentWithoutStats(String gradebookUid,
String assignmentName,
org.hibernate.Session session)
Deprecated.
|
Authn |
getAuthn() |
List |
getCategories(Long gradebookId) |
List |
getCategoriesWithAssignments(Long gradebookId) |
Category |
getCategory(Long categoryId) |
List |
getComments(Assignment assignment,
Collection studentIds) |
protected List |
getCountedStudentGradeRecords(Long gradebookId,
String studentId,
org.hibernate.Session session) |
CourseGrade |
getCourseGrade(Long gradebookId) |
protected List<CourseGradeRecord> |
getCourseGradeOverrides(Gradebook gradebook,
org.hibernate.Session session)
Get's all course grade overrides for a given gradebook
|
protected CourseGradeRecord |
getCourseGradeRecord(Gradebook gradebook,
String studentId,
org.hibernate.Session session)
Gets the course grade record for a student, or null if it does not yet exist.
|
LetterGradePercentMapping |
getDefaultLetterGradePercentMapping() |
protected EventTrackingService |
getEventTrackingService() |
Gradebook |
getGradebook(String uid) |
protected GradebookExternalAssessmentService |
getGradebookExternalAssessmentService() |
String |
getGradebookUid(Long id) |
LetterGradePercentMapping |
getLetterGradePercentMapping(Gradebook gradebook) |
List |
getPermissionsForGB(Long gradebookId)
Deprecated.
|
List |
getPermissionsForGBForCategoryIds(Long gradebookId,
List cateIds) |
List<Permission> |
getPermissionsForUser(Long gradebookId,
String userId) |
List<Permission> |
getPermissionsForUserAnyCategory(Long gradebookId,
String userId) |
List<Permission> |
getPermissionsForUserAnyGroup(Long gradebookId,
String userId) |
List |
getPermissionsForUserAnyGroupAnyCategory(Long gradebookId,
String userId) |
List<Permission> |
getPermissionsForUserAnyGroupForCategory(Long gradebookId,
String userId,
List cateIds) |
List<Permission> |
getPermissionsForUserForCategory(Long gradebookId,
String userId,
List cateIds) |
List |
getPermissionsForUserForGoupsAnyCategory(Long gradebookId,
String userId,
List groupIds) |
List |
getPermissionsForUserForGroup(Long gradebookId,
String userId,
List groupIds) |
protected Map |
getPropertiesMap() |
String |
getPropertyValue(String name) |
protected SectionAwareness |
getSectionAwareness() |
protected ServerConfigurationService |
getServerConfigurationService() |
protected String |
getUserUid() |
protected Map<String,Set<Assignment>> |
getVisibleExternalAssignments(Gradebook gradebook,
Collection<String> studentIds,
List<Assignment> assignments) |
boolean |
isAssignmentDefined(Long gradableObjectId) |
boolean |
isExplicitlyEnteredCourseGradeRecords(Long gradebookId) |
boolean |
isGradebookDefined(String gradebookUid) |
void |
postEvent(String message,
String objectReference) |
void |
removeCategory(Long categoryId) |
protected Long |
saveNewAssignment(Long gradebookId,
Long categoryId,
Assignment asn) |
void |
saveOrUpdateLetterGradePercentMapping(Map gradeMap,
Gradebook gradebook) |
void |
setAssignmentScoreComment(String gradebookUid,
Long assignmentId,
String studentUid,
String commentText) |
void |
setAuthn(Authn authn) |
void |
setEventTrackingService(EventTrackingService eventTrackingService) |
void |
setGradebookExternalAssessmentService(GradebookExternalAssessmentService externalAssessmentService) |
void |
setPropertyValue(String name,
String value) |
void |
setSectionAwareness(SectionAwareness sectionAwareness) |
void |
setServerConfigurationService(ServerConfigurationService serverConfigurationService) |
protected boolean |
studentCanView(String studentId,
Assignment assignment) |
protected void |
updateAssignment(Assignment assignment,
org.hibernate.Session session) |
void |
updateCategory(Category category) |
protected void |
updateCategory(Category category,
org.hibernate.Session session) |
void |
updateGradebook(Gradebook gradebook) |
void |
updateGradeMapping(Long gradeMappingId,
Map<String,Double> gradeMap) |
void |
updatePermission(Collection perms)
Deprecated.
|
void |
updatePermission(Permission perm)
Deprecated.
|
protected boolean |
validateLetterGradeMapping(Map gradeMap) |
public static int MAX_NUMBER_OF_SQL_PARAMETERS_IN_LIST
protected SectionAwareness sectionAwareness
protected Authn authn
protected EventTrackingService eventTrackingService
protected ServerConfigurationService serverConfigurationService
protected GradebookExternalAssessmentService externalAssessmentService
protected Map propertiesMap
public Gradebook getGradebook(String uid) throws GradebookNotFoundException
GradebookNotFoundExceptionpublic boolean isGradebookDefined(String gradebookUid)
protected List getAssignments(Long gradebookId, org.hibernate.Session session) throws org.hibernate.HibernateException
org.hibernate.HibernateExceptionprotected List getCountedStudentGradeRecords(Long gradebookId, String studentId, org.hibernate.Session session) throws org.hibernate.HibernateException
org.hibernate.HibernateExceptionpublic CourseGrade getCourseGrade(Long gradebookId)
protected CourseGradeRecord getCourseGradeRecord(Gradebook gradebook, String studentId, org.hibernate.Session session) throws org.hibernate.HibernateException
studentId - The student IDsession - The hibernate sessionorg.hibernate.HibernateExceptionprotected Map getPropertiesMap()
protected List filterGradeRecordsByStudents(Collection gradeRecords, Collection studentUids)
@Deprecated protected Assignment getAssignmentWithoutStats(String gradebookUid, String assignmentName, org.hibernate.Session session) throws org.hibernate.HibernateException
org.hibernate.HibernateExceptionprotected Assignment getAssignmentWithoutStats(String gradebookUid, Long assignmentId, org.hibernate.Session session) throws org.hibernate.HibernateException
org.hibernate.HibernateExceptionprotected void updateAssignment(Assignment assignment, org.hibernate.Session session) throws ConflictingAssignmentNameException, org.hibernate.HibernateException
ConflictingAssignmentNameExceptionorg.hibernate.HibernateExceptionprotected AssignmentGradeRecord getAssignmentGradeRecord(Assignment assignment, String studentUid, org.hibernate.Session session) throws org.hibernate.HibernateException
org.hibernate.HibernateExceptionpublic Long createAssignment(Long gradebookId, String name, Double points, Date dueDate, Boolean isNotCounted, Boolean isReleased, Boolean isExtraCredit) throws ConflictingAssignmentNameException, StaleObjectModificationException
public Long createAssignmentForCategory(Long gradebookId, Long categoryId, String name, Double points, Date dueDate, Boolean isNotCounted, Boolean isReleased, Boolean isExtraCredit) throws ConflictingAssignmentNameException, StaleObjectModificationException, IllegalArgumentException
protected Long saveNewAssignment(Long gradebookId, Long categoryId, Assignment asn) throws ConflictingAssignmentNameException
public void updateGradebook(Gradebook gradebook) throws StaleObjectModificationException
StaleObjectModificationExceptionpublic boolean isExplicitlyEnteredCourseGradeRecords(Long gradebookId)
public Authn getAuthn()
public void setAuthn(Authn authn)
protected String getUserUid()
protected SectionAwareness getSectionAwareness()
public void setSectionAwareness(SectionAwareness sectionAwareness)
protected ServerConfigurationService getServerConfigurationService()
public void setServerConfigurationService(ServerConfigurationService serverConfigurationService)
protected EventTrackingService getEventTrackingService()
public void setEventTrackingService(EventTrackingService eventTrackingService)
protected GradebookExternalAssessmentService getGradebookExternalAssessmentService()
public void setGradebookExternalAssessmentService(GradebookExternalAssessmentService externalAssessmentService)
public Long createCategory(Long gradebookId, String name, Double weight, Integer drop_lowest, Integer dropHighest, Integer keepHighest, Boolean is_extra_credit)
public Long createCategory(Long gradebookId, String name, Double weight, Integer drop_lowest, Integer dropHighest, Integer keepHighest, Boolean is_extra_credit, Integer categoryOrder) throws ConflictingCategoryNameException, StaleObjectModificationException
public List getCategories(Long gradebookId) throws org.hibernate.HibernateException
org.hibernate.HibernateExceptionpublic List getAssignmentsForCategory(Long categoryId) throws org.hibernate.HibernateException
org.hibernate.HibernateExceptionpublic Category getCategory(Long categoryId) throws org.hibernate.HibernateException
org.hibernate.HibernateExceptionprotected void updateCategory(Category category, org.hibernate.Session session) throws ConflictingAssignmentNameException, org.hibernate.HibernateException
ConflictingAssignmentNameExceptionorg.hibernate.HibernateExceptionpublic void updateCategory(Category category) throws ConflictingCategoryNameException, StaleObjectModificationException
public void removeCategory(Long categoryId) throws StaleObjectModificationException
StaleObjectModificationExceptionpublic LetterGradePercentMapping getDefaultLetterGradePercentMapping()
public void createOrUpdateDefaultLetterGradePercentMapping(Map gradeMap)
public void createDefaultLetterGradePercentMapping(Map gradeMap)
public LetterGradePercentMapping getLetterGradePercentMapping(Gradebook gradebook)
public void saveOrUpdateLetterGradePercentMapping(Map gradeMap, Gradebook gradebook)
protected boolean validateLetterGradeMapping(Map gradeMap)
public Long createUngradedAssignment(Long gradebookId, String name, Date dueDate, Boolean isNotCounted, Boolean isReleased) throws ConflictingAssignmentNameException, StaleObjectModificationException
public Long createUngradedAssignmentForCategory(Long gradebookId, Long categoryId, String name, Date dueDate, Boolean isNotCounted, Boolean isReleased) throws ConflictingAssignmentNameException, StaleObjectModificationException, IllegalArgumentException
public Long addPermission(Long gradebookId, String userId, String function, Long categoryId, String groupId) throws IllegalArgumentException
IllegalArgumentException@Deprecated public List getPermissionsForGB(Long gradebookId) throws IllegalArgumentException
IllegalArgumentException@Deprecated public void updatePermission(Collection perms)
@Deprecated public void updatePermission(Permission perm) throws IllegalArgumentException
IllegalArgumentException@Deprecated public void deletePermission(Permission perm) throws IllegalArgumentException
IllegalArgumentExceptionpublic List<Permission> getPermissionsForUser(Long gradebookId, String userId) throws IllegalArgumentException
IllegalArgumentExceptionpublic List<Permission> getPermissionsForUserForCategory(Long gradebookId, String userId, List cateIds) throws IllegalArgumentException
IllegalArgumentExceptionpublic List<Permission> getPermissionsForUserAnyCategory(Long gradebookId, String userId) throws IllegalArgumentException
IllegalArgumentExceptionpublic List<Permission> getPermissionsForUserAnyGroup(Long gradebookId, String userId) throws IllegalArgumentException
IllegalArgumentExceptionpublic List<Permission> getPermissionsForUserAnyGroupForCategory(Long gradebookId, String userId, List cateIds) throws IllegalArgumentException
IllegalArgumentExceptionpublic List getPermissionsForGBForCategoryIds(Long gradebookId, List cateIds) throws IllegalArgumentException
IllegalArgumentExceptionpublic List getPermissionsForUserAnyGroupAnyCategory(Long gradebookId, String userId) throws IllegalArgumentException
IllegalArgumentExceptionpublic List getPermissionsForUserForGoupsAnyCategory(Long gradebookId, String userId, List groupIds) throws IllegalArgumentException
IllegalArgumentExceptionpublic List getPermissionsForUserForGroup(Long gradebookId, String userId, List groupIds) throws IllegalArgumentException
IllegalArgumentExceptionpublic boolean isAssignmentDefined(Long gradableObjectId)
public Assignment getAssignment(Long gradableObjectId)
gradableObjectId - protected Double calculateEquivalentPercent(Double doublePointsPossible, Double doublePointsEarned)
doublePointsPossible - doublePointsEarned - protected List convertPointsToPercentage(Gradebook gradebook, List studentRecordsFromDB)
gradebook - studentRecordsFromDB - protected List convertPointsToLetterGrade(Gradebook gradebook, List studentRecordsFromDB)
gradebook - studentRecordsFromDB - protected Double calculateEquivalentPointValueForPercent(Double doublePointsPossible, Double doublePercentEarned)
public List getComments(Assignment assignment, Collection studentIds)
protected Map<String,Set<Assignment>> getVisibleExternalAssignments(Gradebook gradebook, Collection<String> studentIds, List<Assignment> assignments)
protected boolean studentCanView(String studentId, Assignment assignment)
protected void finalizeNullGradeRecords(Gradebook gradebook)
protected boolean assignmentNameExists(org.hibernate.Session session,
String name,
Gradebook gradebook)
session - an active Hibernate sessionname - the assignment name (will not be trimmed)gradebook - the gradebook to checkpublic CommentDefinition getAssignmentScoreComment(String gradebookUid, Long assignmentId, String studentUid) throws GradebookNotFoundException, AssessmentNotFoundException
public void setAssignmentScoreComment(String gradebookUid, Long assignmentId, String studentUid, String commentText) throws GradebookNotFoundException, AssessmentNotFoundException
protected List<CourseGradeRecord> getCourseGradeOverrides(Gradebook gradebook, org.hibernate.Session session) throws org.hibernate.HibernateException
gradebook - The gradebooksession - The hibernate sessionCourseGradeRecord that have overridesorg.hibernate.HibernateExceptionCopyright © 2003–2017 Sakai Project. All rights reserved.