use of org.olat.core.commons.services.notifications.ui.ContextualSubscriptionController in project openolat by klemens.
the class EPChangelogController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
/* the subscription context + component */
if (logger.isDebug())
logger.debug("creating subscriptionContext for Map: " + map.getTitle() + ", getResourceableId: ->" + map.getResourceableId() + ", key: " + map.getKey());
subsContext = new SubscriptionContext(EPNotificationsHandler.TYPENNAME, map.getResourceableId(), EPNotificationsHandler.TYPENNAME);
if (subsContext != null) {
String businessPath = "[EPDefaultMap:" + map.getKey() + "]";
PublisherData data = new PublisherData(EPNotificationsHandler.TYPENNAME, null, businessPath);
cSubscriptionCtrl = new ContextualSubscriptionController(ureq, getWindowControl(), subsContext, data);
listenTo(cSubscriptionCtrl);
flc.put("subscription", cSubscriptionCtrl.getInitialComponent());
}
/* the datechooser */
dateChooser = uifactory.addDateChooser("dateChooser", "news.since", null, formLayout);
dateChooser.setDate(new Date());
dateChooser.addActionListener(FormEvent.ONCHANGE);
/* display the changelog */
updateChangelogDisplay();
}
use of org.olat.core.commons.services.notifications.ui.ContextualSubscriptionController in project openolat by klemens.
the class HistoryController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
if (!ureq.getUserSession().getRoles().isGuestOnly()) {
subsContext = new SubscriptionContext(PortfolioNotificationsHandler.TYPE_NAME, binder.getKey(), PortfolioNotificationsHandler.TYPE_NAME);
if (subsContext != null) {
String businessPath = "[Binder:" + binder.getKey() + "]";
PublisherData data = new PublisherData(PortfolioNotificationsHandler.TYPE_NAME, null, businessPath);
cSubscriptionCtrl = new ContextualSubscriptionController(ureq, getWindowControl(), subsContext, data);
listenTo(cSubscriptionCtrl);
flc.put("subscription", cSubscriptionCtrl.getInitialComponent());
}
}
dateChooser = uifactory.addDateChooser("dateChooser", "changes.since", null, formLayout);
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
cal.set(Calendar.DATE, -8);
dateChooser.setDate(cal.getTime());
dateChooser.addActionListener(FormEvent.ONCHANGE);
}
use of org.olat.core.commons.services.notifications.ui.ContextualSubscriptionController in project openolat by klemens.
the class GTAAbstractController method process.
protected final void process(UserRequest ureq) {
Task task;
if (businessGroupTask) {
task = gtaManager.getTask(assessedGroup, taskList);
} else {
task = gtaManager.getTask(assessedIdentity, taskList);
}
if (withSubscription && subsContext != null) {
contextualSubscriptionCtr = new ContextualSubscriptionController(ureq, getWindowControl(), subsContext, publisherData);
listenTo(contextualSubscriptionCtr);
mainVC.put("contextualSubscription", contextualSubscriptionCtr.getInitialComponent());
}
boolean assignment = config.getBooleanSafe(GTACourseNode.GTASK_ASSIGNMENT);
mainVC.contextPut("assignmentEnabled", assignment);
if (assignment) {
task = stepAssignment(ureq, task);
} else if (task == null) {
TaskProcess firstStep = gtaManager.firstStep(gtaNode);
task = gtaManager.createTask(null, taskList, firstStep, assessedGroup, assessedIdentity, gtaNode);
}
boolean submit = config.getBooleanSafe(GTACourseNode.GTASK_SUBMIT);
mainVC.contextPut("submitEnabled", submit);
if (submit) {
task = stepSubmit(ureq, task);
} else if (task != null && task.getTaskStatus() == TaskProcess.submit) {
task = gtaManager.nextStep(task, gtaNode, Role.auto);
}
boolean reviewAndCorrection = config.getBooleanSafe(GTACourseNode.GTASK_REVIEW_AND_CORRECTION);
mainVC.contextPut("reviewAndCorrectionEnabled", reviewAndCorrection);
if (reviewAndCorrection) {
task = stepReviewAndCorrection(ureq, task);
} else if (task != null && task.getTaskStatus() == TaskProcess.review) {
task = gtaManager.nextStep(task, gtaNode, Role.auto);
}
boolean revision = config.getBooleanSafe(GTACourseNode.GTASK_REVISION_PERIOD);
mainVC.contextPut("revisionEnabled", reviewAndCorrection && revision);
if (reviewAndCorrection && revision) {
task = stepRevision(ureq, task);
} else if (task != null && (task.getTaskStatus() == TaskProcess.revision || task.getTaskStatus() == TaskProcess.correction)) {
task = gtaManager.nextStep(task, gtaNode, Role.auto);
}
boolean solution = config.getBooleanSafe(GTACourseNode.GTASK_SAMPLE_SOLUTION);
mainVC.contextPut("solutionEnabled", solution);
if (solution) {
stepSolution(ureq, task);
} else if (task != null && task.getTaskStatus() == TaskProcess.solution) {
task = gtaManager.nextStep(task, gtaNode, Role.auto);
}
boolean grading = config.getBooleanSafe(GTACourseNode.GTASK_GRADING);
mainVC.contextPut("gradingEnabled", grading);
if (grading) {
stepGrading(ureq, task);
} else if (task != null && task.getTaskStatus() == TaskProcess.grading) {
task = gtaManager.nextStep(task, gtaNode, Role.auto);
}
mainVC.contextPut("changelogconfig", courseModule.isDisplayChangeLog());
resetTask(ureq, task);
nodeLog();
collapsedContents(task);
}
use of org.olat.core.commons.services.notifications.ui.ContextualSubscriptionController in project openolat by klemens.
the class AbstractTaskNotificationHandler method createContextualSubscriptionController.
public static ContextualSubscriptionController createContextualSubscriptionController(UserRequest ureq, WindowControl wControl, String folderPath, SubscriptionContext subsContext, Class<?> callerClass) {
String businessPath = wControl.getBusinessControl().getAsString();
PublisherData pdata = new PublisherData(OresHelper.calculateTypeName(callerClass), folderPath, businessPath);
ContextualSubscriptionController contextualSubscriptionCtr = new ContextualSubscriptionController(ureq, wControl, subsContext, pdata);
return contextualSubscriptionCtr;
}
Aggregations