Search in sources :

Example 46 with ContextEntry

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());
            }
        }
    }
}
Also used : SharedItemRow(org.olat.modules.portfolio.model.SharedItemRow) Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 47 with ContextEntry

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);
    }
}
Also used : StaticTextElement(org.olat.core.gui.components.form.flexible.elements.StaticTextElement) BusinessControlFactory(org.olat.core.id.context.BusinessControlFactory) Date(java.util.Date) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 48 with ContextEntry

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;
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) PublisherData(org.olat.core.commons.services.notifications.PublisherData) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 49 with ContextEntry

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;
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) CollaborationTools(org.olat.collaboration.CollaborationTools) SubscriptionContext(org.olat.core.commons.services.notifications.SubscriptionContext) WindowControl(org.olat.core.gui.control.WindowControl) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 50 with ContextEntry

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;
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) CollaborationTools(org.olat.collaboration.CollaborationTools) SubscriptionContext(org.olat.core.commons.services.notifications.SubscriptionContext) WindowControl(org.olat.core.gui.control.WindowControl) ContextEntry(org.olat.core.id.context.ContextEntry)

Aggregations

ContextEntry (org.olat.core.id.context.ContextEntry)270 OLATResourceable (org.olat.core.id.OLATResourceable)78 WindowControl (org.olat.core.gui.control.WindowControl)58 Activateable2 (org.olat.core.gui.control.generic.dtabs.Activateable2)44 ArrayList (java.util.ArrayList)42 TreeNode (org.olat.core.gui.components.tree.TreeNode)30 Controller (org.olat.core.gui.control.Controller)26 RepositoryEntry (org.olat.repository.RepositoryEntry)24 List (java.util.List)22 Identity (org.olat.core.id.Identity)22 BusinessControl (org.olat.core.id.context.BusinessControl)22 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)20 BusinessControlFactory (org.olat.core.id.context.BusinessControlFactory)18 HistoryPoint (org.olat.core.id.context.HistoryPoint)18 CollaborationTools (org.olat.collaboration.CollaborationTools)16 GenericTreeNode (org.olat.core.gui.components.tree.GenericTreeNode)14 UserSession (org.olat.core.util.UserSession)14 CourseNode (org.olat.course.nodes.CourseNode)14 SubscriptionContext (org.olat.core.commons.services.notifications.SubscriptionContext)12 Translator (org.olat.core.gui.translator.Translator)12