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;
}
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;
}
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);
}
}
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);
}
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;
}
}
}
}
Aggregations