Examples of ContextEntry


Examples of org.olat.core.id.context.ContextEntry

    selTree = new SelectionTree("seltree", getTranslator());
    selTree.addListener(this);
    folderContainer.put("seltree", selTree);

    // jump to either the forum or the folder if the business-launch-path says so.
    ContextEntry ce = bc.popLauncherContextEntry();
    if ( ce != null ) { // a context path is left for me           
      if (log.isDebug()) log.debug("businesscontrol (for further jumps) would be:"+bc);
      OLATResourceable ores = ce.getOLATResourceable();     
      if (log.isDebug()) log.debug("OLATResourceable=" + ores);
      String typeName = ores.getResourceableTypeName();
      // typeName format: 'path=/test1/test2/readme.txt'
      // First remove prefix 'path='
      String path = typeName.substring("path=".length());
View Full Code Here

Examples of org.olat.core.id.context.ContextEntry

  public String getSupportedTypeName() {
    return SUPPORTED_TYPE_NAME;
  }
 
  public boolean checkAccess(ContextEntry contextEntry, BusinessControl businessControl, Identity identity, Roles roles)  {
    ContextEntry ce = businessControl.popLauncherContextEntry();
    OLATResourceable ores = ce.getOLATResourceable();
    if(log.isDebug()) log.debug("OLATResourceable=" + ores);
    if ( (ores != null) && (ores.getResourceableTypeName().startsWith("path=")) ) {
      // => it is a file element, typeName format: 'path=/test1/test2/readme.txt'
      return true;
    } else if ((ores != null) && ores.getResourceableTypeName().equals( OresHelper.calculateTypeName(Message.class) ) ) {
View Full Code Here

Examples of org.olat.core.id.context.ContextEntry

    // jump to either the forum or the folder if the business-launch-path says
    // so.
    boolean showAssessmentTool = false;
   
    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
View Full Code Here

Examples of org.olat.core.id.context.ContextEntry

      listenTo(bookmarkController);
      contentP.pushContent(bookmarkController.getInitialComponent());
    } else if (cmd.equals(ACTION_CALENDAR)) { // popup calendar
      ControllerCreator ctrlCreator = new ControllerCreator() {
        public Controller createController(UserRequest lureq, WindowControl lwControl) {
          ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(courseRepositoryEntry);
          WindowControl llwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, lwControl);
          CourseCalendarController calendarController = new CourseCalendarController(lureq, llwControl, course);         
          // use a one-column main layout
          LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(lureq, llwControl, null, null, calendarController.getInitialComponent(), null);
          layoutCtr.setCustomCSS(CourseFactory.getCustomCourseCss(lureq.getUserSession(), uce.getCourseEnvironment()));
View Full Code Here

Examples of org.olat.core.id.context.ContextEntry

  /**
   *
   * @param olatResource
   */
  public void setBusinessControlFor(OLATResourceable olatResource) {
    ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(olatResource);
    myBusinessControl = BusinessControlFactory.getInstance().createBusinessControl(ce,parentBusinessControl);
  }
View Full Code Here

Examples of org.olat.core.id.context.ContextEntry

        ForumCallback forumCallback = new WikiForumCallback(ureq.getUserSession().getRoles().isGuestOnly(), isModerator);
       
        // calculate the new businesscontext for the coursenode being called.
        //FIXME:pb:mannheim discussion should not be "this.ores" -> may be the "forum" should go in here.
        //
        ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(forum);
        WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, getWindowControl());
       
        discussionContent.put("articleforum", ForumUIFactory.getStandardForumController(ureq, bwControl, forum, forumCallback).getInitialComponent());
      }
    } else if (source == wikiEditForm) {
View Full Code Here

Examples of org.olat.core.id.context.ContextEntry

   *
   * @see org.olat.search.service.indexer.Indexer#checkAccess(org.olat.core.id.context.ContextEntry, org.olat.core.id.context.BusinessControl, org.olat.core.id.Identity, org.olat.core.id.Roles)
   */
  public boolean checkAccess(ContextEntry contextEntry, BusinessControl businessControl, Identity identity, Roles roles) {
    //   TODO:chg: check with collabTools if forum is enabled
    ContextEntry ce = businessControl.popLauncherContextEntry();
    Long resourceableId = ce.getOLATResourceable().getResourceableId();
    Message message = ForumManager.getInstance().loadMessage(resourceableId);
    Message threadtop = message.getThreadtop();
    if(threadtop==null) {
      threadtop = message;
    }
View Full Code Here

Examples of org.olat.core.id.context.ContextEntry

   * @param roles
   * @return
   */
  public boolean checkAccess(BusinessControl businessControl, Identity identity, Roles roles) {
    if (log.isDebug()) log.debug("checkAccess for businessControl=" + businessControl + "  identity=" + identity + "  roles=" + roles);
    ContextEntry contextEntry = businessControl.popLauncherContextEntry();
    if (contextEntry != null) {
      // there is an other context-entry => go further
      OLATResourceable ores = contextEntry.getOLATResourceable();
      String type = ores.getResourceableTypeName();
      Indexer indexer = this.childIndexers.get(type);
      return indexer.checkAccess(contextEntry, businessControl, identity, roles);
    } else {
      // rearch the end context entry list
View Full Code Here

Examples of org.olat.core.id.context.ContextEntry

        throw new StartupException("Configured indexer is not of type RepositoryEntryIndexer", cce);
    }
  }

  public boolean checkAccess(ContextEntry contextEntry, BusinessControl businessControl, Identity identity, Roles roles) {
    ContextEntry bcContextEntry = businessControl.popLauncherContextEntry();
    if (bcContextEntry == null) {
      // no context-entry anymore, the repository entry itself is the context entry,
      // not a course node of course we have access to the course metadata
      return true;
    }
    if (log.isDebug()) log.debug("Start identity=" + identity + "  roles=" + roles);
    Long repositoryKey = contextEntry.getOLATResourceable().getResourceableId();
    RepositoryEntry repositoryEntry = repositoryManager.lookupRepositoryEntry(repositoryKey);
    if (log.isDebug()) log.debug("repositoryEntry=" + repositoryEntry );

    Long nodeId = bcContextEntry.getOLATResourceable().getResourceableId();
    if (log.isDebug()) log.debug("nodeId=" + nodeId );
   
    ICourse course = CourseFactory.loadCourse(repositoryEntry.getOlatResource());
    IdentityEnvironment ienv = new IdentityEnvironment();
    ienv.setIdentity(identity);
View Full Code Here

Examples of org.olat.core.id.context.ContextEntry

   
    // Default view
    forumPanel = putInitialPanel(vcListTitles);
    // jump to either the forum or the folder if the business-launch-path says so.
    BusinessControl bc = getWindowControl().getBusinessControl();
    ContextEntry ce = bc.popLauncherContextEntry();
    if ( ce != null) { // a context path is left for me
      if (isLogDebugEnabled()) logDebug("businesscontrol (for further jumps) would be: ", bc.toString());
      OLATResourceable ores = ce.getOLATResourceable();
      if (isLogDebugEnabled()) logDebug("OLATResourceable= " , ores.toString());
      Long resId = ores.getResourceableId();
      if (resId.longValue() != 0) {
        if (isLogDebugEnabled()) logDebug("messageId=" , ores.getResourceableId().toString());
        currentMsg = fm.findMessage(ores.getResourceableId());
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.