use of org.olat.core.id.context.ContextEntry in project OpenOLAT by OpenOLAT.
the class SharedBindersController method activate.
@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
if (entries.isEmpty())
return;
Long resId = entries.get(0).getOLATResourceable().getResourceableId();
String resName = entries.get(0).getOLATResourceable().getResourceableTypeName();
if ("Binder".equalsIgnoreCase(resName)) {
SharedItemRow activatedRow = null;
List<SharedItemRow> rows = model.getObjects();
for (SharedItemRow row : rows) {
if (row.getBinderKey().equals(resId)) {
activatedRow = row;
break;
}
}
if (activatedRow != null) {
Activateable2 activeateable = doSelectBinder(ureq, activatedRow);
if (activeateable != null) {
List<ContextEntry> subEntries = entries.subList(1, entries.size());
activeateable.activate(ureq, subEntries, entries.get(0).getTransientState());
}
}
}
}
use of org.olat.core.id.context.ContextEntry in project OpenOLAT by OpenOLAT.
the class EPCollectStepForm00 method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
title = uifactory.addTextElement("title", "artefact.title", 500, artefact.getTitle(), formLayout);
title.setElementCssClass("o_sel_ep_artefact_metadata_title");
title.setMandatory(true);
title.setNotEmptyCheck("artefact.title.not.empty");
title.setNotLongerThanCheck(512, "artefact.title.too.long");
title.setVisible(!simpleMode);
descript = uifactory.addRichTextElementForStringDataMinimalistic("description", "artefact.description", artefact.getDescription(), 7, -1, formLayout, getWindowControl());
descript.setMaxLength(4000);
descript.setNotLongerThanCheck(4000, "artefact.description.too.long");
String artSource = artefact.getSource();
if (StringHelper.containsNonWhitespace(artSource) && !simpleMode) {
uifactory.addStaticTextElement("artefact.source", artSource, formLayout);
}
Date artDate = artefact.getCreationDate();
if (artDate == null)
artDate = new Date();
StaticTextElement date = uifactory.addStaticTextElement("artefact.date", Formatter.getInstance(getLocale()).formatDateAndTime(artDate), formLayout);
date.setVisible(!simpleMode);
String busPath = artefact.getBusinessPath();
if (StringHelper.containsNonWhitespace(busPath) && !simpleMode) {
BusinessControlFactory bCF = BusinessControlFactory.getInstance();
List<ContextEntry> ceList = bCF.createCEListFromString(busPath);
String busLink = bCF.getAsURIString(ceList, true);
if (StringHelper.containsNonWhitespace(busLink)) {
String finalPath = "<a href=\"" + busLink + "\">" + busLink + "</a>";
uifactory.addStaticTextElement("artefact.link", finalPath, formLayout);
}
}
if (!isUsedInStepWizzard()) {
// add form buttons
uifactory.addFormSubmitButton("stepform.submit", formLayout);
}
}
use of org.olat.core.id.context.ContextEntry in project OpenOLAT by OpenOLAT.
the class UsersSubscriptionManagerImpl method getNewUsersPublisherData.
public PublisherData getNewUsersPublisherData() {
ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(new OLATResourceable() {
@Override
public Long getResourceableId() {
return 0l;
}
@Override
public String getResourceableTypeName() {
return "NewIdentityCreated";
}
});
PublisherData publisherData = new PublisherData(RES_NAME, NEW, ce.toString());
return publisherData;
}
use of org.olat.core.id.context.ContextEntry in project OpenOLAT by OpenOLAT.
the class BusinessGroupMainRunController method doFolder.
private Activateable2 doFolder(UserRequest ureq) {
addLoggingResourceable(LoggingResourceable.wrap(ORES_TOOLFOLDER, OlatResourceableType.sharedFolder));
SubscriptionContext sc = new SubscriptionContext(businessGroup, INITVIEW_TOOLFOLDER);
ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(ORES_TOOLFOLDER);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ce.getOLATResourceable()));
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, getWindowControl());
addToHistory(ureq, bwControl);
CollaborationTools collabTools = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(businessGroup);
collabToolCtr = collabTools.createFolderController(ureq, bwControl, businessGroup, isAdmin, sc);
listenTo(collabToolCtr);
mainPanel.setContent(collabToolCtr.getInitialComponent());
return (Activateable2) collabToolCtr;
}
use of org.olat.core.id.context.ContextEntry in project OpenOLAT by OpenOLAT.
the class BusinessGroupMainRunController method doForum.
private Activateable2 doForum(UserRequest ureq) {
addLoggingResourceable(LoggingResourceable.wrap(ORES_TOOLFORUM, OlatResourceableType.forum));
SubscriptionContext sc = new SubscriptionContext(businessGroup, INITVIEW_TOOLFORUM);
// calculate the new businesscontext for the forum clicked
ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(ORES_TOOLFORUM);
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, getWindowControl());
addToHistory(ureq, bwControl);
CollaborationTools collabTools = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(businessGroup);
collabToolCtr = collabTools.createForumController(ureq, bwControl, isAdmin, ureq.getUserSession().getRoles().isGuestOnly(), sc);
listenTo(collabToolCtr);
mainPanel.setContent(collabToolCtr.getInitialComponent());
return (Activateable2) collabToolCtr;
}
Aggregations