Package org.olat.core.id

Examples of org.olat.core.id.OLATResourceable


        doCloseResource(ureq);
        return;
      } else if (cmd.equals(ACTION_DELETE)) { // delete
        if (!isOwner) throw new OLATSecurityException("Trying to delete, but not allowed: user = " + ureq.getIdentity());
        // show how many users are currently using this resource
        OLATResourceable ores = repositoryEntry.getOlatResource();
       
        String dialogTitle = translate("del.header", repositoryEntry.getDisplayname());
        OLATResourceable courseRunOres = OresHelper.createOLATResourceableInstance(RunMainController.ORES_TYPE_COURSE_RUN, repositoryEntry.getOlatResource().getResourceableId());
        int cnt = CoordinatorManager.getCoordinator().getEventBus().getListeningIdentityCntFor(courseRunOres);
       
        String dialogText = translate("del.confirm", String.valueOf(cnt));
        deleteDialogController = activateYesNoDialog(ureq, dialogTitle, dialogText, deleteDialogController);
        return;
View Full Code Here


      controller = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
    } else {
      AssessmentManager am = userCourseEnv.getCourseEnvironment().getAssessmentManager();
      IQSecurityCallback sec = new CourseIQSecurityCallback(this, am, ureq.getIdentity());
      RepositoryEntry repositoryEntry = ne.getCourseNode().getReferencedRepositoryEntry();
      OLATResourceable ores = repositoryEntry.getOlatResource();
      Long resId = ores.getResourceableId();
      TestFileResource fr = new TestFileResource();
      fr.overrideResourceableId(resId);
      if(!CoordinatorManager.getCoordinator().getLocker().isLocked(fr, null)) {
        //QTI1
        controller = new IQRunController(userCourseEnv, this.getModuleConfiguration(), sec, ureq, wControl, this);
View Full Code Here

    putInitialPanel(main);
   
    BusinessControl bc = getWindowControl().getBusinessControl();
    ContextEntry ce = bc.popLauncherContextEntry();
    if (ce != null) {
      OLATResourceable oresNode = ce.getOLATResourceable();
      if (OresHelper.isOfType(oresNode, CourseNode.class)) {
        Long courseNodeId = oresNode.getResourceableId();
        Structure runStructure = assessedUserCourseEnvironment.getCourseEnvironment().getRunStructure();
        CourseNode courseNode = runStructure.getNode(courseNodeId.toString());
        if(courseNode instanceof AssessableCourseNode) {
          doEditNodeAssessment(ureq, (AssessableCourseNode)courseNode);
        }
View Full Code Here

  public DENStatus doEnroll(final Identity identity, final KalendarEvent event, final OLATResourceable ores, final DENCourseNode courseNode,
      final boolean allowOverfill) {
    final DENStatus status = new DENStatus();
    ICourse course = CourseFactory.loadCourse(ores);
    final Kalendar cal = calManager.getCourseCalendar(course).getKalendar();
    OLATResourceable calRes = calManager.getOresHelperFor(cal);
    CoordinatorManager.getCoordinator().getSyncer().doInSync(calRes, new SyncerExecutor() {
      public void execute() {
        boolean error = false;
        Collection<KalendarEvent> collEvents = cal.getEvents();
        // check if date is already full
View Full Code Here

   */
  public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl,
      UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    NodeRunConstructionResult ncr;
    updateModuleConfigDefaults(false);
    OLATResourceable ores = OresHelper.createOLATResourceableInstance(ICourse.class, userCourseEnv.getCourseEnvironment().getCourseResourceableId());
    CPRunController cprunC = new CPRunController(getModuleConfiguration(), ureq, userCourseEnv, wControl, this, nodecmd, ores);
    ncr = cprunC.createNodeRunConstructionResult(ureq);
    return ncr;
  }
View Full Code Here

          sb.append(": No launcher for repository entry: ");
          sb.append(repositoryEntry.getKey());
          throw new OLATRuntimeException(RepositoryDetailsController.class, sb.toString(), null);
        }
        // do skip the increment launch counter, this is only a preview!
        OLATResourceable ores = repositoryEntry.getOlatResource();
       
        if (previewCtr != null) {
          previewCtr.dispose();
        }
        if (previewModalCtr != null) {
View Full Code Here

  /**
   * @see org.olat.bookmark.handler.BookmarkLaunchHandler#tryToLaunch(org.olat.bookmark.Bookmark, org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)
   */
  public boolean tryToLaunch(Bookmark bookmark, UserRequest ureq, WindowControl wControl) {
    OLATResourceable reores = BookmarkManager.getInstance().getLaunchOlatResourceable(bookmark);
    RepositoryManager rm = RepositoryManager.getInstance();
   
    RepositoryEntry re = rm.lookupRepositoryEntry(reores.getResourceableId());
    if (re == null) {
      // we can't launch this bookmark, exit with false
      return false;
    }
    // ok, this bookmark represents a repo entry, try to launch
    if (!rm.isAllowedToLaunch(ureq, re)) {
      Translator trans = Util.createPackageTranslator(Bookmark.class, ureq.getLocale());
      wControl.setWarning(trans.translate("warn.cantlaunch"));
    } else {
      // get the OLAT resource from this repo entry
      OLATResourceable ores = re.getOlatResource();
      //was brasato:: DTabs dts = getWindowControl().getDTabs();
      DTabs dts = (DTabs)Windows.getWindows(ureq).getWindow(ureq).getAttribute("DTabs");
      DTab dt = dts.getDTab(ores);
      if (dt == null) {
        // does not yet exist -> create and add
View Full Code Here

  /**
   * @see org.olat.bookmark.handler.BookmarkHandler#createJumpInURL(org.olat.bookmark.Bookmark)
   */
  public String createJumpInURL(Bookmark bookmark) {
    OLATResourceable reores = BookmarkManager.getInstance().getLaunchOlatResourceable(bookmark);
    RepositoryManager rm = RepositoryManager.getInstance();
   
    RepositoryEntry re = rm.lookupRepositoryEntry(reores.getResourceableId());
    // only create jump in urls for bookmarks of type repo entry
    if (re != null) {
      return RepoJumpInHandlerFactory.buildRepositoryDispatchURI(re);
    }
    return null;
View Full Code Here

   * @see org.olat.core.id.context.ContextEntryControllerCreator#createController(org.olat.core.id.context.ContextEntry,
   *      org.olat.core.gui.UserRequest,
   *      org.olat.core.gui.control.WindowControl)
   */
  public Controller createController(ContextEntry ce, UserRequest ureq, WindowControl wControl) {
    OLATResourceable ores = ce.getOLATResourceable();

    RepositoryManager repom = RepositoryManager.getInstance();
    RepositoryEntry re = repom.lookupRepositoryEntry(ores.getResourceableId());
    Controller ctrl = RepositoyUIFactory.createLaunchController(re, null, ureq, wControl);
    return ctrl;

  }
View Full Code Here

  /**
   * @see org.olat.core.id.context.ContextEntryControllerCreator#getTabName(org.olat.core.id.context.ContextEntry)
   */
  public String getTabName(ContextEntry ce) {
    OLATResourceable ores = ce.getOLATResourceable();

    RepositoryManager repom = RepositoryManager.getInstance();
    RepositoryEntry re = repom.lookupRepositoryEntry(ores.getResourceableId());
    return re.getDisplayname();
  }
View Full Code Here

TOP

Related Classes of org.olat.core.id.OLATResourceable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.