org.sakaiproject.tool.assessment.facade
Class AssessmentFacadeQueries

java.lang.Object
  extended byorg.springframework.dao.support.DaoSupport
      extended byorg.springframework.orm.hibernate.support.HibernateDaoSupport
          extended byorg.sakaiproject.tool.assessment.facade.AssessmentFacadeQueries
All Implemented Interfaces:
AssessmentFacadeQueriesAPI, InitializingBean

public class AssessmentFacadeQueries
extends HibernateDaoSupport
implements AssessmentFacadeQueriesAPI


Field Summary
static String LASTMODIFIEDDATE
           
static String TITLE
           
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
AssessmentFacadeQueries()
           
 
Method Summary
 Long addAssessment(Long assessmentTemplateId)
           
 SectionFacade addSection(Long assessmentId)
           
 Long addTemplate()
           
 boolean assessmentTitleIsUnique(Long assessmentBaseId, String title, Boolean isTemplate)
           
 void checkForQuestionPoolItem(AssessmentData assessment, HashMap qpItemHash)
           
 void checkForQuestionPoolItem(SectionData section, HashMap qpItemHash)
           
 AssessmentData cloneAssessmentFromTemplate(AssessmentTemplateData t)
           
 AssessmentFacade createAssessment(String title, String description, Long typeId, Long templateId)
           
 AssessmentFacade createAssessmentWithoutDefaultSection(String title, String description, Long typeId, Long templateId)
          This method is the same as createAssessment() except that no default section will be created with the assessment.
 void deleteTemplate(Long templateId)
           
 ArrayList getAllActiveAssessments(String orderBy)
           
 ArrayList getAllActiveAssessmentTemplates()
           
 ArrayList getAllAssessments(int pageSize, int pageNumber, String orderBy)
           
 ArrayList getAllAssessments(String orderBy)
           
 ArrayList getAllAssessmentTemplates()
           
 AssessmentFacade getAssessment(Long assessmentId)
           
 List getAssessmentByTemplate(Long templateId)
           
 IdImpl getAssessmentId(long id)
           
 IdImpl getAssessmentId(Long id)
           
 IdImpl getAssessmentId(String id)
           
 AssessmentTemplateFacade getAssessmentTemplate(Long assessmentTemplateId)
           
 IdImpl getAssessmentTemplateId(long id)
           
 IdImpl getAssessmentTemplateId(Long id)
           
 IdImpl getAssessmentTemplateId(String id)
           
 ArrayList getBasicInfoOfAllActiveAssessments(String orderBy, boolean ascending)
           
 ArrayList getBasicInfoOfAllActiveAssessmentsByAgent(String orderBy, String siteAgentId)
           
 ArrayList getBasicInfoOfAllActiveAssessmentsByAgent(String orderBy, String siteAgentId, boolean ascending)
           
 ArrayList getBasicInfoOfAllActiveAssessmentTemplates(String orderBy)
           
 AssessmentFacade getBasicInfoOfAnAssessment(Long assessmentId)
           
 List getDefaultMetaDataSet()
           
 IdImpl getId(long id)
           
 IdImpl getId(Long id)
           
 IdImpl getId(String id)
           
 int getQuestionSize(Long assessmentId)
           
 SectionFacade getSection(Long sectionId)
           
 ArrayList getSettingsOfAllActiveAssessments(String orderBy)
           
 ArrayList getTitleOfAllActiveAssessmentTemplates()
           
 AssessmentBaseData load(Long id)
           
 AssessmentData loadAssessment(Long assessmentId)
           
 SectionData loadSection(Long sectionId)
           
 AssessmentTemplateData loadTemplate(Long assessmentTemplateId)
           
static void main(String[] args)
           
 void moveAllItems(Long sourceSectionId, Long destSectionId)
          This method move a set of questions form one section to another
static void print(AssessmentBaseData a)
           
static void printFacade(AssessmentTemplateFacade a)
           
 void removeAllItems(Long sourceSectionId)
          This method remove a set of questions form one section that is random draw
 void removeAssessment(Long assessmentId)
           
 void removeSection(Long sectionId)
           
 void removeTemplate(Long assessmentId)
           
 void saveOrUpdate(AssessmentFacade assessment)
           
 void saveOrUpdate(AssessmentTemplateData template)
           
 void saveOrUpdateSection(SectionFacade section)
           
 
Methods inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport
checkDaoConfig, closeSessionIfNecessary, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LASTMODIFIEDDATE

public static String LASTMODIFIEDDATE

TITLE

public static String TITLE
Constructor Detail

AssessmentFacadeQueries

public AssessmentFacadeQueries()
Method Detail

getId

public IdImpl getId(String id)
Specified by:
getId in interface AssessmentFacadeQueriesAPI

getId

public IdImpl getId(Long id)
Specified by:
getId in interface AssessmentFacadeQueriesAPI

getId

public IdImpl getId(long id)
Specified by:
getId in interface AssessmentFacadeQueriesAPI

getAssessmentId

public IdImpl getAssessmentId(String id)
Specified by:
getAssessmentId in interface AssessmentFacadeQueriesAPI

getAssessmentId

public IdImpl getAssessmentId(Long id)
Specified by:
getAssessmentId in interface AssessmentFacadeQueriesAPI

getAssessmentId

public IdImpl getAssessmentId(long id)
Specified by:
getAssessmentId in interface AssessmentFacadeQueriesAPI

getAssessmentTemplateId

public IdImpl getAssessmentTemplateId(String id)
Specified by:
getAssessmentTemplateId in interface AssessmentFacadeQueriesAPI

getAssessmentTemplateId

public IdImpl getAssessmentTemplateId(Long id)
Specified by:
getAssessmentTemplateId in interface AssessmentFacadeQueriesAPI

getAssessmentTemplateId

public IdImpl getAssessmentTemplateId(long id)
Specified by:
getAssessmentTemplateId in interface AssessmentFacadeQueriesAPI

main

public static void main(String[] args)
                 throws DataFacadeException
Throws:
DataFacadeException

print

public static void print(AssessmentBaseData a)

printFacade

public static void printFacade(AssessmentTemplateFacade a)

addTemplate

public Long addTemplate()
Specified by:
addTemplate in interface AssessmentFacadeQueriesAPI

removeTemplate

public void removeTemplate(Long assessmentId)
Specified by:
removeTemplate in interface AssessmentFacadeQueriesAPI

addAssessment

public Long addAssessment(Long assessmentTemplateId)
Specified by:
addAssessment in interface AssessmentFacadeQueriesAPI

load

public AssessmentBaseData load(Long id)
Specified by:
load in interface AssessmentFacadeQueriesAPI

loadTemplate

public AssessmentTemplateData loadTemplate(Long assessmentTemplateId)
Specified by:
loadTemplate in interface AssessmentFacadeQueriesAPI

loadAssessment

public AssessmentData loadAssessment(Long assessmentId)
Specified by:
loadAssessment in interface AssessmentFacadeQueriesAPI

getAssessmentTemplate

public AssessmentTemplateFacade getAssessmentTemplate(Long assessmentTemplateId)
Specified by:
getAssessmentTemplate in interface AssessmentFacadeQueriesAPI

getAllAssessmentTemplates

public ArrayList getAllAssessmentTemplates()
Specified by:
getAllAssessmentTemplates in interface AssessmentFacadeQueriesAPI

getAllActiveAssessmentTemplates

public ArrayList getAllActiveAssessmentTemplates()
Specified by:
getAllActiveAssessmentTemplates in interface AssessmentFacadeQueriesAPI

getTitleOfAllActiveAssessmentTemplates

public ArrayList getTitleOfAllActiveAssessmentTemplates()
Specified by:
getTitleOfAllActiveAssessmentTemplates in interface AssessmentFacadeQueriesAPI
Returns:
a list of AssessmentTemplateFacade. However, it is IMPORTANT to note that it is not a full object, it contains merely assessmentBaseId (which is the templateId) & title. This methods is used when a list of template titles is required for displaying purposes. In Sakai2.0, template are scoped by creator, i.e. users can only see their own template plus the "Default Template"

getAssessment

public AssessmentFacade getAssessment(Long assessmentId)
Specified by:
getAssessment in interface AssessmentFacadeQueriesAPI

removeAssessment

public void removeAssessment(Long assessmentId)
Specified by:
removeAssessment in interface AssessmentFacadeQueriesAPI

cloneAssessmentFromTemplate

public AssessmentData cloneAssessmentFromTemplate(AssessmentTemplateData t)
Specified by:
cloneAssessmentFromTemplate in interface AssessmentFacadeQueriesAPI

createAssessmentWithoutDefaultSection

public AssessmentFacade createAssessmentWithoutDefaultSection(String title,
                                                              String description,
                                                              Long typeId,
                                                              Long templateId)
                                                       throws Exception
This method is the same as createAssessment() except that no default section will be created with the assessment.

Specified by:
createAssessmentWithoutDefaultSection in interface AssessmentFacadeQueriesAPI
Throws:
Exception

createAssessment

public AssessmentFacade createAssessment(String title,
                                         String description,
                                         Long typeId,
                                         Long templateId)
                                  throws Exception
Specified by:
createAssessment in interface AssessmentFacadeQueriesAPI
Throws:
Exception

getAllAssessments

public ArrayList getAllAssessments(String orderBy)
Specified by:
getAllAssessments in interface AssessmentFacadeQueriesAPI

getAllActiveAssessments

public ArrayList getAllActiveAssessments(String orderBy)
Specified by:
getAllActiveAssessments in interface AssessmentFacadeQueriesAPI

getBasicInfoOfAllActiveAssessments

public ArrayList getBasicInfoOfAllActiveAssessments(String orderBy,
                                                    boolean ascending)
Specified by:
getBasicInfoOfAllActiveAssessments in interface AssessmentFacadeQueriesAPI

getBasicInfoOfAllActiveAssessmentsByAgent

public ArrayList getBasicInfoOfAllActiveAssessmentsByAgent(String orderBy,
                                                           String siteAgentId,
                                                           boolean ascending)
Specified by:
getBasicInfoOfAllActiveAssessmentsByAgent in interface AssessmentFacadeQueriesAPI

getBasicInfoOfAllActiveAssessmentsByAgent

public ArrayList getBasicInfoOfAllActiveAssessmentsByAgent(String orderBy,
                                                           String siteAgentId)
Specified by:
getBasicInfoOfAllActiveAssessmentsByAgent in interface AssessmentFacadeQueriesAPI

getBasicInfoOfAnAssessment

public AssessmentFacade getBasicInfoOfAnAssessment(Long assessmentId)
Specified by:
getBasicInfoOfAnAssessment in interface AssessmentFacadeQueriesAPI

getSettingsOfAllActiveAssessments

public ArrayList getSettingsOfAllActiveAssessments(String orderBy)
Specified by:
getSettingsOfAllActiveAssessments in interface AssessmentFacadeQueriesAPI

getAllAssessments

public ArrayList getAllAssessments(int pageSize,
                                   int pageNumber,
                                   String orderBy)
Specified by:
getAllAssessments in interface AssessmentFacadeQueriesAPI

getQuestionSize

public int getQuestionSize(Long assessmentId)
Specified by:
getQuestionSize in interface AssessmentFacadeQueriesAPI

saveOrUpdate

public void saveOrUpdate(AssessmentFacade assessment)
Specified by:
saveOrUpdate in interface AssessmentFacadeQueriesAPI

saveOrUpdate

public void saveOrUpdate(AssessmentTemplateData template)
Specified by:
saveOrUpdate in interface AssessmentFacadeQueriesAPI

deleteTemplate

public void deleteTemplate(Long templateId)
Specified by:
deleteTemplate in interface AssessmentFacadeQueriesAPI

addSection

public SectionFacade addSection(Long assessmentId)
Specified by:
addSection in interface AssessmentFacadeQueriesAPI

getSection

public SectionFacade getSection(Long sectionId)
Specified by:
getSection in interface AssessmentFacadeQueriesAPI

removeSection

public void removeSection(Long sectionId)
Specified by:
removeSection in interface AssessmentFacadeQueriesAPI

loadSection

public SectionData loadSection(Long sectionId)
Specified by:
loadSection in interface AssessmentFacadeQueriesAPI

saveOrUpdateSection

public void saveOrUpdateSection(SectionFacade section)
Specified by:
saveOrUpdateSection in interface AssessmentFacadeQueriesAPI

moveAllItems

public void moveAllItems(Long sourceSectionId,
                         Long destSectionId)
This method move a set of questions form one section to another

Specified by:
moveAllItems in interface AssessmentFacadeQueriesAPI
Parameters:
sourceSectionId -
destSectionId -

removeAllItems

public void removeAllItems(Long sourceSectionId)
This method remove a set of questions form one section that is random draw

Specified by:
removeAllItems in interface AssessmentFacadeQueriesAPI
Parameters:
sourceSectionId -

getBasicInfoOfAllActiveAssessmentTemplates

public ArrayList getBasicInfoOfAllActiveAssessmentTemplates(String orderBy)
Specified by:
getBasicInfoOfAllActiveAssessmentTemplates in interface AssessmentFacadeQueriesAPI

checkForQuestionPoolItem

public void checkForQuestionPoolItem(AssessmentData assessment,
                                     HashMap qpItemHash)
Specified by:
checkForQuestionPoolItem in interface AssessmentFacadeQueriesAPI

checkForQuestionPoolItem

public void checkForQuestionPoolItem(SectionData section,
                                     HashMap qpItemHash)
Specified by:
checkForQuestionPoolItem in interface AssessmentFacadeQueriesAPI

assessmentTitleIsUnique

public boolean assessmentTitleIsUnique(Long assessmentBaseId,
                                       String title,
                                       Boolean isTemplate)
Specified by:
assessmentTitleIsUnique in interface AssessmentFacadeQueriesAPI

getAssessmentByTemplate

public List getAssessmentByTemplate(Long templateId)
Specified by:
getAssessmentByTemplate in interface AssessmentFacadeQueriesAPI

getDefaultMetaDataSet

public List getDefaultMetaDataSet()
Specified by:
getDefaultMetaDataSet in interface AssessmentFacadeQueriesAPI