/** * Question Add/Update */ public ims.core.vo.QuestionInformationVo saveQuestion(ims.core.vo.QuestionInformationVo questionInfo) throws ims.domain.exceptions.StaleObjectException, UniqueKeyViolationException { if(questionInfo == null) throw new RuntimeException("Cannot save null value for QuestionInformationVo"); if(!questionInfo.isValidated()) throw new CodingRuntimeException("QuestionInformationVo has not been validated"); DomainFactory factory = getDomainFactory(); QuestionInformation doQuestionInfo = QuestionInformationVoAssembler.extractQuestionInformation(factory, questionInfo); try { factory.save(doQuestionInfo); } catch(UnqViolationUncheckedException e) { String dupMessage = Keywords.checkDuplicateTaxonomy(factory, doQuestionInfo, "taxonomyMap", questionInfo.getTaxonomyMap(), "getText"); if(dupMessage != null) throw new UniqueKeyViolationException(dupMessage); throw new UniqueKeyViolationException(e); } return QuestionInformationVoAssembler.create(doQuestionInfo); }
public ims.core.vo.QuestionInformationVo getQuestion(Integer idQuestion) { if(idQuestion == null) throw new RuntimeException("Cannot get QuestionInformationVo for null id"); DomainFactory factory = getDomainFactory(); return QuestionInformationVoAssembler.create((QuestionInformation) factory.getDomainObject(QuestionInformation.class, idQuestion)); }
public ims.core.vo.QuestionInformationVo saveQuestion(ims.core.vo.QuestionInformationVo questionInfo) throws StaleObjectException { if(!questionInfo.isValidated()) throw new DomainRuntimeException("QuestionInformationVo not validated"); DomainFactory factory = getDomainFactory(); QuestionInformation doQuestionInfo = QuestionInformationVoAssembler.extractQuestionInformation(factory, questionInfo); factory.save(doQuestionInfo); return QuestionInformationVoAssembler.create(doQuestionInfo); }
public QuestionInformationVo getQuestion(Integer questionId) { if(questionId == null) throw new RuntimeException("Cannot get QuestionInformatioVo for null id"); DomainFactory factory = getDomainFactory(); QuestionInformation doQuestionInformation = (QuestionInformation)factory.getDomainObject(QuestionInformation.class, questionId); return QuestionInformationVoAssembler.create(doQuestionInformation); }
public QuestionInformationVo getQuestion(Integer idQuestion) { DomainFactory factory = getDomainFactory(); return QuestionInformationVoAssembler.create((QuestionInformation) factory.getDomainObject(QuestionInformation.class, idQuestion)); }