use of org.olat.portfolio.ui.structel.EPStructureEvent in project OpenOLAT by OpenOLAT.
the class EPStructureDetailsController method formOK.
/**
* @see org.olat.core.gui.components.form.flexible.impl.FormBasicController#formOK(org.olat.core.gui.UserRequest)
*/
@Override
protected void formOK(final UserRequest ureq) {
editStructure = ePFMgr.reloadPortfolioStructure(editStructure);
editStructure.setTitle(titleEl.getValue());
editStructure.setDescription(descriptionEl.getValue());
editStructure.setArtefactRepresentationMode(viewRadio.getSelectedKey());
if (rootStructure instanceof EPStructuredMapTemplate && restrictionElements != null) {
clearErrors();
editStructure.getCollectRestrictions().clear();
setCollectRestrictions();
for (final SingleSelection restrictionElement : restrictionElements) {
final CollectRestriction restriction = (CollectRestriction) restrictionElement.getUserObject();
if (restriction.isValid()) {
final CollectRestriction cr = new CollectRestriction(restriction);
editStructure.getCollectRestrictions().add(cr);
}
}
}
ePFMgr.savePortfolioStructure(editStructure);
fireEvent(ureq, new EPStructureEvent(EPStructureEvent.CHANGE, editStructure));
}
use of org.olat.portfolio.ui.structel.EPStructureEvent in project OpenOLAT by OpenOLAT.
the class EPTOCReadOnlyController method event.
/**
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
* org.olat.core.gui.components.Component,
* org.olat.core.gui.control.Event)
*/
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if (source == artOnOffLink) {
displayArtefactsInTOC = !displayArtefactsInTOC;
artOnOffLink.setCustomDisplayText(translate("artOnOffLink." + !displayArtefactsInTOC));
refreshTOC(ureq);
} else if (source instanceof Link) {
// could be a TOC-Link
Link link = (Link) source;
String cmd = link.getCommand();
PortfolioStructure parentStruct = (PortfolioStructure) link.getUserObject();
if (cmd.equals(LINK_CMD_OPEN_STRUCT)) {
fireEvent(ureq, new EPStructureEvent(EPStructureEvent.SELECT, parentStruct));
} else if (cmd.equals(LINK_CMD_OPEN_ARTEFACT)) {
// open the parent structure
fireEvent(ureq, new EPStructureEvent(EPStructureEvent.SELECT, parentStruct));
} else if (cmd.equals(LINK_CMD_OPEN_COMMENTS)) {
fireEvent(ureq, new EPStructureEvent(EPStructureEvent.SELECT_WITH_COMMENTS, parentStruct));
}
}
}
use of org.olat.portfolio.ui.structel.EPStructureEvent in project openolat by klemens.
the class EPStructureDetailsController method formOK.
/**
* @see org.olat.core.gui.components.form.flexible.impl.FormBasicController#formOK(org.olat.core.gui.UserRequest)
*/
@Override
protected void formOK(final UserRequest ureq) {
editStructure = ePFMgr.reloadPortfolioStructure(editStructure);
editStructure.setTitle(titleEl.getValue());
editStructure.setDescription(descriptionEl.getValue());
editStructure.setArtefactRepresentationMode(viewRadio.getSelectedKey());
if (rootStructure instanceof EPStructuredMapTemplate && restrictionElements != null) {
clearErrors();
editStructure.getCollectRestrictions().clear();
setCollectRestrictions();
for (final SingleSelection restrictionElement : restrictionElements) {
final CollectRestriction restriction = (CollectRestriction) restrictionElement.getUserObject();
if (restriction.isValid()) {
final CollectRestriction cr = new CollectRestriction(restriction);
editStructure.getCollectRestrictions().add(cr);
}
}
}
ePFMgr.savePortfolioStructure(editStructure);
fireEvent(ureq, new EPStructureEvent(EPStructureEvent.CHANGE, editStructure));
}
use of org.olat.portfolio.ui.structel.EPStructureEvent in project openolat by klemens.
the class EPTOCReadOnlyController method event.
/**
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
* org.olat.core.gui.components.Component,
* org.olat.core.gui.control.Event)
*/
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if (source == artOnOffLink) {
displayArtefactsInTOC = !displayArtefactsInTOC;
artOnOffLink.setCustomDisplayText(translate("artOnOffLink." + !displayArtefactsInTOC));
refreshTOC(ureq);
} else if (source instanceof Link) {
// could be a TOC-Link
Link link = (Link) source;
String cmd = link.getCommand();
PortfolioStructure parentStruct = (PortfolioStructure) link.getUserObject();
if (cmd.equals(LINK_CMD_OPEN_STRUCT)) {
fireEvent(ureq, new EPStructureEvent(EPStructureEvent.SELECT, parentStruct));
} else if (cmd.equals(LINK_CMD_OPEN_ARTEFACT)) {
// open the parent structure
fireEvent(ureq, new EPStructureEvent(EPStructureEvent.SELECT, parentStruct));
} else if (cmd.equals(LINK_CMD_OPEN_COMMENTS)) {
fireEvent(ureq, new EPStructureEvent(EPStructureEvent.SELECT_WITH_COMMENTS, parentStruct));
}
}
}
Aggregations