Search in sources :

Example 6 with EfficiencyStatement

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);
    }
}
Also used : ArtefactWizzardStepsController(org.olat.portfolio.ui.artefacts.collect.ArtefactWizzardStepsController) VFSContainer(org.olat.core.util.vfs.VFSContainer) AbstractArtefact(org.olat.portfolio.model.artefacts.AbstractArtefact) Date(java.util.Date) EfficiencyStatement(org.olat.course.assessment.EfficiencyStatement) CertificateAndEfficiencyStatement(org.olat.course.certificate.ui.CertificateAndEfficiencyStatementListModel.CertificateAndEfficiencyStatement)

Example 7 with EfficiencyStatement

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();
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) CollectArtefactController(org.olat.modules.portfolio.ui.wizard.CollectArtefactController) EfficiencyStatement(org.olat.course.assessment.EfficiencyStatement) CertificateAndEfficiencyStatement(org.olat.course.certificate.ui.CertificateAndEfficiencyStatementListModel.CertificateAndEfficiencyStatement)

Example 8 with EfficiencyStatement

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);
    }
}
Also used : EfficiencyStatement(org.olat.course.assessment.EfficiencyStatement)

Example 9 with EfficiencyStatement

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;
}
Also used : CertificateAndEfficiencyStatementController(org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController) EfficiencyStatement(org.olat.course.assessment.EfficiencyStatement)

Example 10 with EfficiencyStatement

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();
}
Also used : RepositoryEntry(org.olat.repository.RepositoryEntry) UserEfficiencyStatementImpl(org.olat.course.assessment.model.UserEfficiencyStatementImpl) EfficiencyStatement(org.olat.course.assessment.EfficiencyStatement)

Aggregations

EfficiencyStatement (org.olat.course.assessment.EfficiencyStatement)26 UserEfficiencyStatement (org.olat.course.assessment.UserEfficiencyStatement)8 UserEfficiencyStatementImpl (org.olat.course.assessment.model.UserEfficiencyStatementImpl)6 CertificateAndEfficiencyStatementController (org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController)6 CertificateAndEfficiencyStatement (org.olat.course.certificate.ui.CertificateAndEfficiencyStatementListModel.CertificateAndEfficiencyStatement)6 RepositoryEntry (org.olat.repository.RepositoryEntry)6 Date (java.util.Date)4 ArrayList (java.util.ArrayList)2 Map (java.util.Map)2 Consumes (javax.ws.rs.Consumes)2 PUT (javax.ws.rs.PUT)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2 BaseSecurity (org.olat.basesecurity.BaseSecurity)2 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)2 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)2 Identity (org.olat.core.id.Identity)2 OLATResourceable (org.olat.core.id.OLATResourceable)2 VFSContainer (org.olat.core.util.vfs.VFSContainer)2 AssessmentChangedEvent (org.olat.course.assessment.AssessmentChangedEvent)2