Examples of OLATResourceable


Examples of org.olat.core.id.OLATResourceable

      if (DialogBoxUIFactory.isYesEvent(event)) {
        // delete is ok
        nm.deleteNote(chosenN);
        // fire local event (for the same user)
        //TODO:fj:a make Note (and all persistables) olatresourceables: problem: type is then NoteImpl instead of Note
        OLATResourceable ores = OresHelper.createOLATResourceableInstance(Note.class, chosenN.getKey());
        ureq.getUserSession().getSingleUserEventCenter().fireEventToListenersOf(new OLATResourceableJustBeforeDeletedEvent(ores), ores);
        getWindowControl().setInfo(translate("note.delete.successfull"));
        populateNLTable();
        chosenN = null;
      } else {
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

   
    BusinessControl bc = getWindowControl().getBusinessControl();
    ContextEntry ce = bc.popLauncherContextEntry();
    if (ce != null) {
      logDebug("businesscontrol (for further jumps) would be:" + bc, null);
      OLATResourceable ores = ce.getOLATResourceable();
      logDebug("OLATResourceable=" + ores, null);
      if (OresHelper.isOfType(ores, CourseNode.class)) {
        // TODO, don't use CourseNode.class, but a lookup using the ClassToId
        // class
        // jump to the coursenode with id
        Long nodeId = ores.getResourceableId();
        String nodeIdS = nodeId.toString();
        currentCourseNode = course.getRunStructure().getNode(nodeIdS);
        if (currentCourseNode == null) {
          // (e.g. a coursenode that no longer is accessible or existing)
          // -> fallback to root node (automatically done later), and drop wrong
          // remaining contexts
          logDebug("currentCourseNode=null => dropLauncherEntries for nodeIdS=" + nodeIdS, null);
          bc.dropLauncherEntries();
        }
      } else if ("assessmentTool".equals(ores.getResourceableTypeName())) {
        showAssessmentTool = true;
      }
    }
    /*
     * ContextEntry curCe = bc.getCurrentEntryAndAdvance(); if (curCe != null) { //
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

          glossaryMarkerCtr.getInitialComponent().setDirty(true);
        }
       
        //re set current user count but not every click
        if (currentUserCount != null && event.hashCode() % 2 == 0) {
          OLATResourceable courseRunOres = OresHelper.createOLATResourceableInstance(RunMainController.ORES_TYPE_COURSE_RUN, course.getResourceableId());
          int cUsers = CoordinatorManager.getCoordinator().getEventBus().getListeningIdentityCntFor(courseRunOres);
          if (cUsers == 0) cUsers = 1;
          currentUserCount.setCustomDisplayText("    "+String.valueOf(cUsers)+" "+getTranslator().translate("participants.in.course"));
          currentUserCount.setEnabled(false);
        }
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

  }

  private void addCurrentUserCount(ToolController myTool) {
    //add currentUser count to toolbox but only if not yet the chatRoom above provides this info
    if ((courseChatManagerCtr == null) || (courseChatManagerCtr != null && courseChatManagerCtr.isLazyCreateChat())) {
      OLATResourceable courseRunOres = OresHelper.createOLATResourceableInstance(RunMainController.ORES_TYPE_COURSE_RUN, course.getResourceableId());
      int cUsers = CoordinatorManager.getCoordinator().getEventBus().getListeningIdentityCntFor(courseRunOres);
      if (cUsers == 0) cUsers = 1;
      VelocityContainer currentUsers = createVelocityContainer("currentUsers");
      currentUsers.contextPut("currentUsers", cUsers);
      currentUserCount = LinkFactory.createCustomLink("currentUsers", "cUsers", "", Link.NONTRANSLATED, currentUsers, this);
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

          DispatcherAction.sendNotFound(request.getRequestURI(), response);
          return;
        }
       
        // handler found e.g. for repo/go or cata/go or alike
        OLATResourceable ores = jh.getOLATResourceable();     
        String title = jh.getTitle();

        // get main window and dynamic tabs
        // brasato:: ChiefController cc = Windows.getWindows(usess).getMainOlatChiefController();
        ChiefController cc = (ChiefController) Windows.getWindows(usess).getAttribute(AUTHCHIEFCONTROLLER);

        if (cc == null) throw new AssertException("logged in, but no window/Chiefcontroller 'olatmain' found!");
        WindowControl wControl = cc.getWindowControl();

        // add to tabs
        DTabs dts = (DTabs)wControl.getWindowBackOffice().getWindow().getAttribute(D_TABS);
        synchronized (dts) { //o_clusterok per:fj user session
          DTab dt = dts.getDTab(ores);
          if (dt == null) {
            // no dynamic tab found, lets see if the ores implements the SiteInstance interface.
            boolean isSiteInstance;
            try {
              // try to load class from ores resource type name and try to cast it to SiteInstance
              Class site = ores.getClass().getClassLoader().loadClass(ores.getResourceableTypeName());
              site.asSubclass(SiteInstance.class);
              // ok, casting did not fail, must be a site then
              isSiteInstance = true;
            } catch (Exception e) {
              // casting failed, not a site
              isSiteInstance = false;
            }
           
            if (isSiteInstance) {
              // case A) is a site: create view identifyer for this jump in to the site
              JumpInResult jres = jh.createJumpInResult(ureq, cc.getWindowControl());
              dts.activateStatic(ureq, ores.getResourceableTypeName(), jres.getInitialViewIdentifier());             
            } else {
              // case B) no site and no opened tab -> create and add
              dt = dts.createDTab(ores, title);
              if (dt == null) { // tabs are full
                //create dtabs already issues a warning message 
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

    RepositoryManager rm = RepositoryManager.getInstance();
    List courseEntries = rm.queryByOwner(identity, CourseModule.getCourseTypeName());
   
    for (Iterator iter = courseEntries.iterator(); iter.hasNext();) {
      RepositoryEntry re = (RepositoryEntry) iter.next();
      OLATResourceable res = re.getOlatResource();
      ICourse course = CourseFactory.loadCourse(res.getResourceableId());
      VFSContainer courseFolder = course.getCourseFolderContainer();
      //NamedContainerImpl cfContainer = new NamedContainerImpl(Formatter.makeStringFilesystemSave(course.getCourseTitle()), courseFolder);
      NamedContainerImpl cfContainer;
      cfContainer = new NamedContainerImpl(Formatter.makeStringFilesystemSave(course.getCourseTitle()), courseFolder);
      cfRoot.addContainer(cfContainer);
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

   * @param ureq
   * @return the copy
   */
  public OLATResourceable createCopy(OLATResourceable res, UserRequest ureq) {
    FileResourceManager frm = FileResourceManager.getInstance();
    OLATResourceable copy = frm.createCopy(res, INTERNAL_FOLDER_NAME);
    return copy;
  }
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

  String assemblePublishConfirmation() {
    List<String> nodeIdsToPublish = this.originalNodeIdsToPublish;
   
    StringBuffer msg = new StringBuffer();

    OLATResourceable courseRunOres = OresHelper.createOLATResourceableInstance(RunMainController.ORES_TYPE_COURSE_RUN, repositoryEntry.getOlatResource().getResourceableId());
    int cnt = CoordinatorManager.getCoordinator().getEventBus().getListeningIdentityCntFor(courseRunOres) -1; // -1: Remove myself from list
    if (cnt < 0 ) {
      cnt = 0;// do not show any negative value
    }
    //if (cnt > 0) {
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

    SubscriptionInfo si;
    // there could be news for me, investigate deeper
    logDebug("compareDate=" + compareDate + " ; latestNews=" + latestNews, null);
    try {
      if (NotificationsManager.getInstance().isPublisherValid(p) && compareDate.before(latestNews)) {
        OLATResourceable ores = null;
        if (p.getResName().equals( CourseModule.getCourseTypeName() ) ) {
          // resId = CourseResourceableId           p.getSubidentifier() = wikiCourseNode.getIdent()
          ICourse course = CourseFactory.loadCourse(resId);
          CourseEnvironment cenv = course.getCourseEnvironment();
          CourseNode courseNode = cenv.getRunStructure().getNode(p.getSubidentifier());
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

   */
  public String getJumpInLink() {
    String jumpInLink = null;
    RepositoryManager resMgr = RepositoryManager.getInstance();
    if (courseId != null && nodeId != null) {
      OLATResourceable oresCourse = OLATResourceManager.getInstance().findResourceable(courseId, CourseModule.getCourseTypeName());
      RepositoryEntry repositoryEntry = resMgr.lookupRepositoryEntry(oresCourse, false);
      jumpInLink = RepoJumpInHandlerFactory.buildRepositoryDispatchURI(repositoryEntry, nodeId);
    } else {
      RepositoryEntry repositoryEntry = resMgr.lookupRepositoryEntry(feed, false);
      jumpInLink = RepoJumpInHandlerFactory.buildRepositoryDispatchURI(repositoryEntry);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.