Examples of OLATResourceable


Examples of org.olat.core.id.OLATResourceable

    this.listeningController = listeningController;
  }

  public void run() {
    //o_clusterOK by guido
    OLATResourceable syncOres = OresHelper.createOLATResourceableInstance("GroupChatJoinTask",ores.getResourceableId());
    CoordinatorManager.getCoordinator().getSyncer().doInSync(syncOres, new SyncerExecutor() {
      public void execute() {
        if (connection != null && connection.isAuthenticated()) {
          try {
            RoomInfo info = MultiUserChat.getRoomInfo(connection, roomJID);
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

      if (theForum == null) { throw new OLATRuntimeException(FOCourseNode.class, "Tried to load forum with key " + forumKey.longValue() + " in course "
        + userCourseEnv.getCourseEnvironment().getCourseResourceableId() + " for node " + thisCourseNode.getIdent()
        + " as defined in course node property but forum manager could not load forum.", null); }
    } else {
      //creates resourceable from FOCourseNode.class and the current node id as key
      OLATResourceable courseNodeResourceable = OresHelper.createOLATResourceableInstance(FOCourseNode.class, new Long(this.getIdent()));
      Codepoint.codepoint(FOCourseNode.class, "beforeDoInSync");   
      //System.out.println("System.out.println - beforeDoInSync");
      //o_clusterOK by:ld
      theForum = CoordinatorManager.getCoordinator().getSyncer().doInSync(courseNodeResourceable, new SyncerCallback<Forum>(){
        public Forum execute() {
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

    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) ) ) {
      // it is message => check message access
      Long resourceableId = ores.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.OLATResourceable

    resId = ores.getResourceableId();
    resType = ores.getResourceableTypeName();
  }

  public OLATResourceable getOres() {
    return new OLATResourceable(){

      public Long getResourceableId() {
        return resId;
      }
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

   *
   * @param ce
   * @return the identity or NULL if not found
   */
  private Identity extractIdentity(ContextEntry ce) {
    OLATResourceable resource = ce.getOLATResourceable();
    Long key = resource.getResourceableId();
    if (key == null || key.equals(0)) {
      log.error("Can not load identity with key::" + key);
      return null;
    }
    Identity identity = ManagerFactory.getManager().loadIdentityByKey(key);
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

    VFSContainer destination = wikiExportContainer.createChildContainer(exportDirName);
    if (destination==null) {
      Tracing.logError("archiveNodeData: Could not create destination directory: wikiExportContainer="+wikiExportContainer+", exportDirName="+exportDirName, getClass());
    }
    String repoRef = (String)this.getModuleConfiguration().get("reporef");
    OLATResourceable ores = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(repoRef, true).getOlatResource();
   
    VFSContainer container = WikiManager.getInstance().getWikiContainer(ores, WikiManager.WIKI_RESOURCE_FOLDER_NAME);
    if(container!=null) { //the container could be null if the wiki is an old empty one - so nothing to archive
      VFSContainer parent = container.getParentContainer();
      VFSLeaf wikiZip = WikiToZipUtils.getWikiAsZip(parent);
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

  private void createOrUpdateNote(String content) {
    n.setNoteText(content);
    if (n.getKey() == null) {
      nm.saveNote(n);
      Long newKey = n.getKey();
      OLATResourceable ores = OresHelper.createOLATResourceableInstance(Note.class, newKey);
      ChangeManager.changed(ChangeManager.ACTION_CREATE, ores);
    } else {
      nm.updateNote(n);
    }
  }
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

      langLayout.contextPut("selectLanguage", translate("select.language"));
     
      if(fireStandardEvent) {
        fireEvent(ureq, mue);
      } else {
        OLATResourceable wrappedLocale = OresHelper.createOLATResourceableType(Locale.class);
        ureq.getUserSession().getSingleUserEventCenter().fireEventToListenersOf(mue, wrappedLocale);
      }
    }
  }
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

   */
  public boolean correspondsTo(ContextEntry ce) {
    if (ce==null) {
      return false;
    }
    OLATResourceable ceResourceable = ce.getOLATResourceable();
    if (ceResourceable==null) {
      return false;
    }
   
    if (resourceable_!=null) {
      if (ceResourceable.getResourceableTypeName().equals(resourceable_.getResourceableTypeName()) &&
          ceResourceable.getResourceableId().equals(resourceable_.getResourceableId())) {
        return true;
      }
      if (ceResourceable instanceof RepositoryEntry) {
        RepositoryEntry re = (RepositoryEntry) ceResourceable;
       
        OLATResource ores = re.getOlatResource();
        if (ores!=null &&
            ores.getResourceableTypeName().equals(resourceable_.getResourceableTypeName()) &&
            ores.getResourceableId().equals(resourceable_.getResourceableId())) {
          return true;
        }
      } else if (OresHelper.calculateTypeName(RepositoryEntry.class).equals(ceResourceable.getResourceableTypeName())) {
        // @TODO: Performance hit! Speed optimize this!
        // OLAT-4996
        // OLAT-4955
        // that's the jump-in case where the ContextEntry says it has a [RepositoryEntry:123212321] but
        // the actual class of ceResourceable is not a RepositoryEntry but an OresHelper$3 ...
       
        // in which case all we have is the key of the repositoryentry and we must make a DB lookup to
        // map the repo key to the corresponding olatresource
       
        RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntry(ceResourceable.getResourceableId());
        if (re!=null) {
          OLATResource ores = re.getOlatResource();
          if (ores!=null &&
              ores.getResourceableTypeName().equals(resourceable_.getResourceableTypeName()) &&
              ores.getResourceableId().equals(resourceable_.getResourceableId())) {
            return true;
          }
        }
       
      }
      return ceResourceable.equals(resourceable_);
    }
   
    // if resourceable_ is null it's rather difficult to compare us with the contextentry
    // we still try...
    if (type_.equals(StringResourceableType.targetIdentity.name())  &&
        ceResourceable.getResourceableTypeName()=="Identity") {
      return id_.equals(String.valueOf(ceResourceable.getResourceableId()));
    }
    return false;
  }
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

                resName = CourseModule.ORES_TYPE_COURSE;
              }
              if (subidentifier.equals(CalendarController.ACTION_CALENDAR_GROUP)) {
                resName = BusinessGroupManagerImpl.getInstance().loadBusinessGroup(pub.getResId(), true).getResourceableTypeName();
              }
              OLATResourceable ores = OresHelper.createOLATResourceableInstance(resName, resId);
              String title = NotificationsManager.getInstance().getNotificationsHandler(pub).createTitleInfo(sub, getLocale());
              DTabs dts = (DTabs)Windows.getWindows(ureq).getWindow(ureq).getAttribute("DTabs");
              //was brasato:: DTabs dts = getWindowControl().getDTabs();
              DTab dt = dts.getDTab(ores);
              if (dt == null) {
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.