use of org.olat.course.assessment.EfficiencyStatement in project OpenOLAT by OpenOLAT.
the class CertificateAndEfficiencyStatementListController method doCollectArtefact.
private void doCollectArtefact(UserRequest ureq, String title, Long efficiencyStatementKey) {
EPArtefactHandler<?> artHandler = portfolioModule.getArtefactHandler(EfficiencyStatementArtefact.ARTEFACT_TYPE);
if (artHandler != null && artHandler.isEnabled() && assessedIdentity.equals(getIdentity())) {
AbstractArtefact artefact = artHandler.createArtefact();
// only author can create artefact
artefact.setAuthor(getIdentity());
// no business path becouse we cannot launch an efficiency statement
artefact.setCollectionDate(new Date());
artefact.setTitle(translate("artefact.title", new String[] { title }));
EfficiencyStatement fullStatement = esm.getUserEfficiencyStatementByKey(efficiencyStatementKey);
artHandler.prefillArtefactAccordingToSource(artefact, fullStatement);
ePFCollCtrl = new ArtefactWizzardStepsController(ureq, getWindowControl(), artefact, (VFSContainer) null);
listenTo(ePFCollCtrl);
}
}
use of org.olat.course.assessment.EfficiencyStatement in project OpenOLAT by OpenOLAT.
the class CertificateAndEfficiencyStatementListController method doCollectMedia.
private void doCollectMedia(UserRequest ureq, String title, Long efficiencyStatementKey) {
if (collectorCtrl != null)
return;
EfficiencyStatement fullStatement = esm.getUserEfficiencyStatementByKey(efficiencyStatementKey);
collectorCtrl = new CollectArtefactController(ureq, getWindowControl(), fullStatement, mediaHandler, "");
listenTo(collectorCtrl);
cmc = new CloseableModalController(getWindowControl(), null, collectorCtrl.getInitialComponent(), true, title, true);
cmc.addControllerListener(this);
cmc.activate();
}
use of org.olat.course.assessment.EfficiencyStatement in project openolat by klemens.
the class EfficiencyStatementArtefactHandler method prefillArtefactAccordingToSource.
/**
* @see org.olat.portfolio.EPAbstractHandler#prefillArtefactAccordingToSource(org.olat.portfolio.model.artefacts.AbstractArtefact, java.lang.Object)
*/
@Override
public void prefillArtefactAccordingToSource(AbstractArtefact artefact, Object source) {
super.prefillArtefactAccordingToSource(artefact, source);
if (source instanceof EfficiencyStatement) {
EfficiencyStatement statement = (EfficiencyStatement) source;
if (artefact.getTitle() == null) {
artefact.setTitle(statement.getCourseTitle());
}
String efficiencyStatementX = myXStream.toXML(statement);
artefact.setSource(statement.getCourseTitle());
artefact.setFulltextContent(efficiencyStatementX);
artefact.setSignature(90);
}
}
use of org.olat.course.assessment.EfficiencyStatement in project openolat by klemens.
the class EfficiencyStatementMediaHandler method getMediaController.
@Override
public Controller getMediaController(UserRequest ureq, WindowControl wControl, Media media, MediaRenderingHints hints) {
String statementXml = media.getContent();
EfficiencyStatement statement = null;
if (StringHelper.containsNonWhitespace(statementXml)) {
try {
statement = (EfficiencyStatement) myXStream.fromXML(statementXml);
} catch (Exception e) {
log.error("Cannot load efficiency statement from artefact", e);
}
}
CertificateAndEfficiencyStatementController ctrl = new CertificateAndEfficiencyStatementController(wControl, ureq, statement);
ctrl.disableMediaCollector();
return ctrl;
}
use of org.olat.course.assessment.EfficiencyStatement in project OpenOLAT by OpenOLAT.
the class OLATUpgrade_8_1_0 method createStatement.
private void createStatement(Property property) {
String repoKeyStr = property.getName();
Long repoKey = new Long(repoKeyStr);
RepositoryEntry re = repositoryManager.lookupRepositoryEntry(repoKey, false);
UserEfficiencyStatementImpl impl = efficiencyStatementManager.getUserEfficiencyStatementFull(re, property.getIdentity());
if (impl != null) {
return;
}
UserEfficiencyStatementImpl statement = new UserEfficiencyStatementImpl();
statement.setIdentity(property.getIdentity());
statement.setStatementXml(property.getTextValue());
if (re != null) {
statement.setResource(re.getOlatResource());
statement.setCourseRepoKey(re.getKey());
}
EfficiencyStatement s = (EfficiencyStatement) XStreamHelper.createXStreamInstance().fromXML(property.getTextValue());
efficiencyStatementManager.fillEfficiencyStatement(s, null, statement);
statement.setLastModified(property.getLastModified());
dbInstance.saveObject(statement);
dbInstance.commitAndCloseSession();
}
Aggregations