use of org.olat.core.id.OLATResourceable in project OpenOLAT by OpenOLAT.
the class AssessmentCourseTreeController method doSelectCourseNodeBusinessGroupsView.
private Controller doSelectCourseNodeBusinessGroupsView(UserRequest ureq, CourseNode courseNode) {
OLATResourceable oresGroups = OresHelper.createOLATResourceableInstance("BusinessGroups", 0l);
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(oresGroups, null, getWindowControl());
OLATResourceable oresNode = OresHelper.createOLATResourceableInstance("Node", new Long(courseNode.getIdent()));
WindowControl bbwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(oresNode, null, bwControl);
if (courseNode instanceof AssessableCourseNode && ((AssessableCourseNode) courseNode).isAssessedBusinessGroups()) {
if (courseNode instanceof GTACourseNode) {
CourseEnvironment courseEnv = CourseFactory.loadCourse(courseEntry).getCourseEnvironment();
List<BusinessGroup> coachedGroups;
if (assessmentCallback.isAdmin()) {
coachedGroups = courseEnv.getCourseGroupManager().getAllBusinessGroups();
} else {
coachedGroups = assessmentCallback.getCoachedGroups();
}
businessGroupListCtrl = ((GTACourseNode) courseNode).getCoachedGroupListController(ureq, bbwControl, stackPanel, coachCourseEnv, assessmentCallback.isAdmin(), coachedGroups);
}
} else {
businessGroupListCtrl = new AssessedBusinessGroupCourseNodeListController(ureq, bbwControl, stackPanel, courseEntry, courseNode, coachCourseEnv, toolContainer, assessmentCallback);
}
return businessGroupListCtrl;
}
use of org.olat.core.id.OLATResourceable in project OpenOLAT by OpenOLAT.
the class AssessmentCourseTreeController method doSelectCourseNodeUsersView.
private Controller doSelectCourseNodeUsersView(UserRequest ureq, CourseNode courseNode) {
OLATResourceable oresUsers = OresHelper.createOLATResourceableInstance("Users", 0l);
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(oresUsers, null, getWindowControl());
OLATResourceable oresNode = OresHelper.createOLATResourceableInstance("Node", new Long(courseNode.getIdent()));
WindowControl bbwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(oresNode, null, bwControl);
if (courseNode instanceof AssessableCourseNode) {
identityListCtrl = ((AssessableCourseNode) courseNode).getIdentityListController(ureq, getWindowControl(), stackPanel, courseEntry, null, coachCourseEnv, toolContainer, assessmentCallback);
} else {
identityListCtrl = new IdentityListCourseNodeController(ureq, bbwControl, stackPanel, courseEntry, null, courseNode, coachCourseEnv, toolContainer, assessmentCallback);
}
return identityListCtrl;
}
use of org.olat.core.id.OLATResourceable in project OpenOLAT by OpenOLAT.
the class CertificationWebService method deleteCertificateInfo.
@DELETE
@Path("{identityKey}")
public Response deleteCertificateInfo(@PathParam("identityKey") Long identityKey, @PathParam("resourceKey") Long resourceKey, @Context HttpServletRequest request) {
if (!isAdmin(request)) {
return Response.serverError().status(Status.UNAUTHORIZED).build();
}
CertificatesManager certificatesManager = CoreSpringFactory.getImpl(CertificatesManager.class);
BaseSecurity baseSecurity = CoreSpringFactory.getImpl(BaseSecurity.class);
Identity identity = baseSecurity.loadIdentityByKey(identityKey);
if (identity == null) {
return Response.serverError().status(Response.Status.NOT_FOUND).build();
}
OLATResourceable courseOres = OresHelper.createOLATResourceableInstance("CourseModule", resourceKey);
OLATResourceManager resourceManager = CoreSpringFactory.getImpl(OLATResourceManager.class);
OLATResource resource = resourceManager.findResourceable(courseOres);
if (resource == null) {
resource = resourceManager.findResourceById(resourceKey);
}
if (resource == null) {
return Response.serverError().status(Response.Status.NOT_FOUND).build();
}
Certificate certificate = certificatesManager.getLastCertificate(identity, resource.getKey());
if (certificate == null) {
return Response.serverError().status(Response.Status.NOT_FOUND).build();
}
certificatesManager.deleteCertificate(certificate);
return Response.ok().build();
}
use of org.olat.core.id.OLATResourceable in project OpenOLAT by OpenOLAT.
the class CertificationWebService method getCertificateInfo.
@HEAD
@Path("{identityKey}")
@Produces({ "application/pdf" })
public Response getCertificateInfo(@PathParam("identityKey") Long identityKey, @PathParam("resourceKey") Long resourceKey, @Context HttpServletRequest request) {
if (!isAdmin(request)) {
return Response.serverError().status(Status.UNAUTHORIZED).build();
}
CertificatesManager certificatesManager = CoreSpringFactory.getImpl(CertificatesManager.class);
BaseSecurity baseSecurity = CoreSpringFactory.getImpl(BaseSecurity.class);
Identity identity = baseSecurity.loadIdentityByKey(identityKey);
if (identity == null) {
return Response.serverError().status(Response.Status.NOT_FOUND).build();
}
OLATResourceable courseOres = OresHelper.createOLATResourceableInstance("CourseModule", resourceKey);
OLATResourceManager resourceManager = CoreSpringFactory.getImpl(OLATResourceManager.class);
OLATResource resource = resourceManager.findResourceable(courseOres);
if (resource == null) {
resource = resourceManager.findResourceById(resourceKey);
}
if (resource == null) {
return Response.serverError().status(Response.Status.NOT_FOUND).build();
}
Certificate certificate = certificatesManager.getLastCertificate(identity, resource.getKey());
if (certificate == null) {
return Response.serverError().status(Response.Status.NOT_FOUND).build();
}
VFSLeaf certificateFile = certificatesManager.getCertificateLeaf(certificate);
if (certificateFile == null || !certificateFile.exists()) {
return Response.serverError().status(Response.Status.NOT_FOUND).build();
}
return Response.ok().build();
}
use of org.olat.core.id.OLATResourceable in project OpenOLAT by OpenOLAT.
the class CertificateAndEfficiencyStatementController method doOpenCourse.
private void doOpenCourse(UserRequest ureq) {
if (courseRepoEntry != null) {
List<ContextEntry> ces = new ArrayList<ContextEntry>(1);
OLATResourceable ores = OresHelper.createOLATResourceableInstance("RepositoryEntry", courseRepoEntry.getKey());
ces.add(BusinessControlFactory.getInstance().createContextEntry(ores));
BusinessControl bc = BusinessControlFactory.getInstance().createFromContextEntries(ces);
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(bc, getWindowControl());
NewControllerFactory.getInstance().launch(ureq, bwControl);
}
}
Aggregations