use of org.olat.core.gui.UserRequest in project OpenOLAT by OpenOLAT.
the class PodcastHandler method createLaunchController.
@Override
public MainLayoutController createLaunchController(RepositoryEntry re, RepositoryEntrySecurity reSecurity, UserRequest ureq, WindowControl wControl) {
boolean isAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
boolean isOwner = reSecurity.isOwner();
final FeedSecurityCallback callback = new FeedResourceSecurityCallback(isAdmin, isOwner);
SubscriptionContext subsContext = new SubscriptionContext(re.getOlatResource(), re.getSoftkey());
callback.setSubscriptionContext(subsContext);
return new FeedRuntimeController(ureq, wControl, re, reSecurity, new RuntimeControllerCreator() {
@Override
public Controller create(UserRequest uureq, WindowControl wwControl, TooledStackedPanel toolbarPanel, RepositoryEntry entry, RepositoryEntrySecurity security, AssessmentMode assessmentMode) {
CoreSpringFactory.getImpl(UserCourseInformationsManager.class).updateUserCourseInformations(entry.getOlatResource(), uureq.getIdentity());
return new FeedMainController(entry.getOlatResource(), uureq, wwControl, null, null, PodcastUIFactory.getInstance(uureq.getLocale()), callback, null);
}
});
}
use of org.olat.core.gui.UserRequest in project OpenOLAT by OpenOLAT.
the class TaxonomyLevelOverviewController method initTabPane.
private void initTabPane() {
tabPane.addTab(translate("taxonomy.level.competences"), new TabCreator() {
@Override
public Component create(UserRequest uureq) {
competencesCtrl = new TaxonomyLevelCompetenceController(uureq, getWindowControl(), taxonomyLevel);
listenTo(competencesCtrl);
return competencesCtrl.getInitialComponent();
}
});
tabPane.addTab(translate("taxonomy.level.relations"), new TabCreator() {
@Override
public Component create(UserRequest uureq) {
relationsCtrl = new TaxonomyLevelRelationsController(uureq, getWindowControl(), taxonomyLevel);
listenTo(relationsCtrl);
return relationsCtrl.getInitialComponent();
}
});
}
use of org.olat.core.gui.UserRequest in project OpenOLAT by OpenOLAT.
the class DisplayPortraitController method showUserInfo.
/**
* Method to open the users visiting card in a new tab. Public to call it also from the patrent controller
* @param ureq
*/
public void showUserInfo(UserRequest ureq) {
ControllerCreator ctrlCreator = new ControllerCreator() {
@Override
public Controller createController(UserRequest lureq, WindowControl lwControl) {
return new UserInfoMainController(lureq, lwControl, portraitIdent, true, false);
}
};
// wrap the content controller into a full header layout
ControllerCreator layoutCtrlr = BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq, ctrlCreator);
// open in new browser window
PopupBrowserWindow pbw = getWindowControl().getWindowBackOffice().getWindowManager().createNewPopupBrowserWindowFor(ureq, layoutCtrlr);
pbw.open(ureq);
}
use of org.olat.core.gui.UserRequest in project OpenOLAT by OpenOLAT.
the class CourseDbWebService method getValuePlain.
/**
* Retrieve a value of an authenticated user.
* @response.representation.200.qname {http://www.example.com}keyValuePair
* @response.representation.200.mediaType text/plain, text/html
* @response.representation.200.doc A value of the course
* @response.representation.200.example Green
* @response.representation.404.doc The entry cannot be found
* @param courseId The course resourceable's id
* @param category The name of the database
* @param name The name of the key value pair
* @param request The HTTP request
* @return
*/
@GET
@Path("values/{name}")
@Produces({ MediaType.TEXT_PLAIN, MediaType.TEXT_HTML })
public Response getValuePlain(@PathParam("courseId") Long courseId, @PathParam("category") String category, @PathParam("name") String name, @Context HttpServletRequest request) {
ICourse course = loadCourse(courseId);
UserRequest ureq = RestSecurityHelper.getUserRequest(request);
CourseDBEntry entry = CoreSpringFactory.getImpl(CourseDBManager.class).getValue(course, ureq.getIdentity(), category, name);
if (entry == null) {
return Response.serverError().status(Status.NOT_FOUND).build();
}
Object value = entry.getValue();
String val = value == null ? "" : value.toString();
return Response.ok(val).build();
}
use of org.olat.core.gui.UserRequest in project OpenOLAT by OpenOLAT.
the class CourseDbWebService method getValue.
/**
* Retrieve a value of an authenticated user.
* @response.representation.200.qname {http://www.example.com}keyValuePair
* @response.representation.200.mediaType application/xml, application/json
* @response.representation.200.doc The value in the course
* @response.representation.200.example {@link org.olat.restapi.support.vo.Examples#SAMPLE_KEYVALUEVO}
* @response.representation.404.doc The entry cannot be found
* @param courseId The course resourceable's id
* @param category The name of the database
* @parma name The name of the key value pair
* @param request The HTTP request
* @return
*/
@GET
@Path("values/{name}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response getValue(@PathParam("courseId") Long courseId, @PathParam("category") String category, @PathParam("name") String name, @Context HttpServletRequest request) {
ICourse course = loadCourse(courseId);
UserRequest ureq = RestSecurityHelper.getUserRequest(request);
CourseDBEntry entry = CoreSpringFactory.getImpl(CourseDBManager.class).getValue(course, ureq.getIdentity(), category, name);
if (entry == null) {
return Response.serverError().status(Status.NOT_FOUND).build();
}
Object value = entry.getValue();
KeyValuePair pair = new KeyValuePair(name, value == null ? "" : value.toString());
return Response.ok(pair).build();
}
Aggregations