use of org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController in project OpenOLAT by OpenOLAT.
the class EfficiencyStatementArtefactHandler method createDetailsController.
@Override
public Controller createDetailsController(UserRequest ureq, WindowControl wControl, AbstractArtefact artefact, boolean readOnlyMode) {
EPFrontendManager ePFMgr = CoreSpringFactory.getImpl(EPFrontendManager.class);
String statementXml = ePFMgr.getArtefactFullTextContent(artefact);
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 efficiencyCtrl = new CertificateAndEfficiencyStatementController(wControl, ureq, statement);
return new LayoutMain3ColsController(ureq, wControl, efficiencyCtrl);
}
use of org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController in project OpenOLAT by OpenOLAT.
the class EfficiencyStatementsPortletRunController method event.
/**
* @see org.olat.core.gui.control.ControllerEventListener#dispatchEvent(org.olat.core.gui.UserRequest, org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
*/
public void event(UserRequest ureq, Controller source, Event event) {
super.event(ureq, source, event);
if (source == tableCtr) {
if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
TableEvent te = (TableEvent) event;
String actionid = te.getActionId();
if (actionid.equals(CMD_LAUNCH)) {
int rowid = te.getRowId();
final UserEfficiencyStatementLight statement = efficiencyStatementsListModel.getEfficiencyStatementAt(rowid);
// will not be disposed on course run dispose, popus up as new browserwindow
ControllerCreator ctrlCreator = new ControllerCreator() {
public Controller createController(UserRequest lureq, WindowControl lwControl) {
CertificateAndEfficiencyStatementController efficiencyCtrl = new CertificateAndEfficiencyStatementController(lwControl, lureq, statement.getArchivedResourceKey());
return new LayoutMain3ColsController(lureq, getWindowControl(), efficiencyCtrl);
}
};
// wrap the content controller into a full header layout
ControllerCreator layoutCtrlr = BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq, ctrlCreator);
// open in new browser window
PopupBrowserWindow pbw = getWindowControl().getWindowBackOffice().getWindowManager().createNewPopupBrowserWindowFor(ureq, layoutCtrlr);
pbw.open(ureq);
//
}
}
}
}
use of org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController in project OpenOLAT by OpenOLAT.
the class UserDetailsController method doOpenEfficiencyStatementController.
private CertificateAndEfficiencyStatementController doOpenEfficiencyStatementController(UserRequest ureq) {
if (statementCtrl == null || hasChanged) {
removeAsListenerAndDispose(statementCtrl);
RepositoryEntry entry = statementEntry.getCourse();
UserEfficiencyStatement statement = statementEntry.getUserEfficencyStatement();
EfficiencyStatement efficiencyStatement = null;
if (statement != null) {
RepositoryEntry re = statementEntry.getCourse();
efficiencyStatement = efficiencyStatementManager.getUserEfficiencyStatementByCourseRepositoryEntry(re, assessedIdentity);
}
statementCtrl = new CertificateAndEfficiencyStatementController(getWindowControl(), ureq, assessedIdentity, null, entry.getOlatResource().getKey(), entry, efficiencyStatement, true);
listenTo(statementCtrl);
hasChanged = false;
}
mainVC.put("segmentCmp", statementCtrl.getInitialComponent());
segmentView.select(efficiencyStatementLink);
return statementCtrl;
}
use of org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController in project openolat by klemens.
the class EfficiencyStatementArtefactHandler method createDetailsController.
@Override
public Controller createDetailsController(UserRequest ureq, WindowControl wControl, AbstractArtefact artefact, boolean readOnlyMode) {
EPFrontendManager ePFMgr = CoreSpringFactory.getImpl(EPFrontendManager.class);
String statementXml = ePFMgr.getArtefactFullTextContent(artefact);
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 efficiencyCtrl = new CertificateAndEfficiencyStatementController(wControl, ureq, statement);
return new LayoutMain3ColsController(ureq, wControl, efficiencyCtrl);
}
use of org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController in project openolat by klemens.
the class UserDetailsController method doOpenEfficiencyStatementController.
private CertificateAndEfficiencyStatementController doOpenEfficiencyStatementController(UserRequest ureq) {
if (statementCtrl == null || hasChanged) {
removeAsListenerAndDispose(statementCtrl);
RepositoryEntry entry = statementEntry.getCourse();
UserEfficiencyStatement statement = statementEntry.getUserEfficencyStatement();
EfficiencyStatement efficiencyStatement = null;
if (statement != null) {
RepositoryEntry re = statementEntry.getCourse();
efficiencyStatement = efficiencyStatementManager.getUserEfficiencyStatementByCourseRepositoryEntry(re, assessedIdentity);
}
statementCtrl = new CertificateAndEfficiencyStatementController(getWindowControl(), ureq, assessedIdentity, null, entry.getOlatResource().getKey(), entry, efficiencyStatement, true);
listenTo(statementCtrl);
hasChanged = false;
}
mainVC.put("segmentCmp", statementCtrl.getInitialComponent());
segmentView.select(efficiencyStatementLink);
return statementCtrl;
}
Aggregations