Search in sources :

Example 66 with OLATResourceable

use of org.olat.core.id.OLATResourceable in project OpenOLAT by OpenOLAT.

the class CPManagerImpl method writeToZip.

/**
 * @see org.olat.ims.cp.CPManager#writeToZip(org.olat.ims.cp.ContentPackage)
 */
public VFSLeaf writeToZip(ContentPackage cp) {
    OLATResourceable ores = cp.getResourcable();
    VFSContainer cpRoot = cp.getRootDir();
    VFSContainer oresRoot = FileResourceManager.getInstance().getFileResourceRootImpl(ores);
    RepositoryEntry repoEntry = RepositoryManager.getInstance().lookupRepositoryEntry(ores, false);
    String zipFileName = "imscp.zip";
    if (repoEntry != null) {
        String zipName = repoEntry.getResourcename();
        if (zipName != null && zipName.endsWith(".zip")) {
            zipFileName = zipName;
        }
    }
    // delete old archive and create new one
    VFSItem oldArchive = oresRoot.resolve(zipFileName);
    if (oldArchive != null) {
        // don't versioned the zip
        oldArchive.deleteSilently();
    }
    ZipUtil.zip(cpRoot.getItems(), oresRoot.createChildLeaf(zipFileName), true);
    VFSLeaf zip = (VFSLeaf) oresRoot.resolve(zipFileName);
    return zip;
}
Also used : VFSLeaf(org.olat.core.util.vfs.VFSLeaf) OLATResourceable(org.olat.core.id.OLATResourceable) VFSContainer(org.olat.core.util.vfs.VFSContainer) VFSItem(org.olat.core.util.vfs.VFSItem) RepositoryEntry(org.olat.repository.RepositoryEntry)

Example 67 with OLATResourceable

use of org.olat.core.id.OLATResourceable in project OpenOLAT by OpenOLAT.

the class AssessmentToolController method doSelectUsersView.

private Controller doSelectUsersView(UserRequest ureq, String resName, AssessedIdentityListState state) {
    if (currentCtl != null) {
        stackPanel.popController(currentCtl);
    }
    OLATResourceable ores = OresHelper.createOLATResourceableInstance(resName, 0l);
    WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
    addToHistory(ureq, bwControl);
    Controller treeCtrl = element.createIdentityList(ureq, bwControl, stackPanel, testEntry, assessmentCallback);
    listenTo(treeCtrl);
    stackPanel.pushController(translate("users"), treeCtrl);
    currentCtl = treeCtrl;
    if (treeCtrl instanceof Activateable2) {
        ((Activateable2) treeCtrl).activate(ureq, null, state);
    }
    return currentCtl;
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) OLATResourceable(org.olat.core.id.OLATResourceable) WindowControl(org.olat.core.gui.control.WindowControl) Controller(org.olat.core.gui.control.Controller) MainLayoutBasicController(org.olat.core.gui.control.controller.MainLayoutBasicController)

Example 68 with OLATResourceable

use of org.olat.core.id.OLATResourceable in project OpenOLAT by OpenOLAT.

the class CourseListController method selectCourse.

private void selectCourse(UserRequest ureq, CourseStatEntry courseStat) {
    removeAsListenerAndDispose(courseCtrl);
    courseCtrl = null;
    RepositoryEntry re = repositoryManager.lookupRepositoryEntry(courseStat.getRepoKey(), false);
    if (re != null) {
        OLATResourceable ores = OresHelper.createOLATResourceableInstance(RepositoryEntry.class, re.getKey());
        WindowControl bwControl = addToHistory(ureq, ores, null);
        int index = tableCtr.getIndexOfSortedObject(courseStat);
        courseCtrl = new CourseController(ureq, bwControl, stackPanel, re, courseStat, index, tableCtr.getRowCount());
        listenTo(courseCtrl);
        stackPanel.popUpToRootController(ureq);
        stackPanel.pushController(re.getDisplayname(), courseCtrl);
    }
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) RepositoryEntry(org.olat.repository.RepositoryEntry) WindowControl(org.olat.core.gui.control.WindowControl)

Example 69 with OLATResourceable

use of org.olat.core.id.OLATResourceable in project OpenOLAT by OpenOLAT.

the class GroupListController method selectGroup.

protected void selectGroup(UserRequest ureq, GroupStatEntry groupStatistic) {
    removeAsListenerAndDispose(groupCtrl);
    OLATResourceable ores = OresHelper.createOLATResourceableInstance(BusinessGroup.class, groupStatistic.getGroupKey());
    WindowControl bwControl = addToHistory(ureq, ores, null);
    int index = tableCtr.getIndexOfSortedObject(groupStatistic);
    groupCtrl = new GroupController(ureq, bwControl, stackPanel, groupStatistic, index, tableCtr.getRowCount());
    listenTo(groupCtrl);
    stackPanel.popUpToRootController(ureq);
    stackPanel.pushController(groupStatistic.getGroupName(), groupCtrl);
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) WindowControl(org.olat.core.gui.control.WindowControl)

Example 70 with OLATResourceable

use of org.olat.core.id.OLATResourceable in project OpenOLAT by OpenOLAT.

the class StudentCoursesController method activate.

@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
    if (entries == null || entries.isEmpty())
        return;
    ContextEntry ce = entries.get(0);
    OLATResourceable ores = ce.getOLATResourceable();
    if ("RepositoryEntry".equals(ores.getResourceableTypeName())) {
        Long entryKey = ores.getResourceableId();
        for (EfficiencyStatementEntry entry : model.getObjects()) {
            if (entryKey.equals(entry.getCourse().getKey())) {
                selectDetails(ureq, entry);
                statementCtrl.activate(ureq, entries.subList(1, entries.size()), ce.getTransientState());
                break;
            }
        }
    }
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) EfficiencyStatementEntry(org.olat.modules.coach.model.EfficiencyStatementEntry) ContextEntry(org.olat.core.id.context.ContextEntry)

Aggregations

OLATResourceable (org.olat.core.id.OLATResourceable)924 WindowControl (org.olat.core.gui.control.WindowControl)304 Test (org.junit.Test)158 Identity (org.olat.core.id.Identity)154 RepositoryEntry (org.olat.repository.RepositoryEntry)130 ContextEntry (org.olat.core.id.context.ContextEntry)82 ArrayList (java.util.ArrayList)68 OLATResource (org.olat.resource.OLATResource)60 Controller (org.olat.core.gui.control.Controller)48 Date (java.util.Date)46 AssertException (org.olat.core.logging.AssertException)32 StateSite (org.olat.core.id.context.StateSite)30 SyncerExecutor (org.olat.core.util.coordinate.SyncerExecutor)30 ICourse (org.olat.course.ICourse)30 CourseNode (org.olat.course.nodes.CourseNode)28 DBCheckbox (org.olat.course.nodes.cl.model.DBCheckbox)28 BusinessControl (org.olat.core.id.context.BusinessControl)24 BusinessGroup (org.olat.group.BusinessGroup)24 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)22 BinderSecurityCallback (org.olat.modules.portfolio.BinderSecurityCallback)22