Examples of OLATResourceable


Examples of org.olat.core.id.OLATResourceable

    // 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());
      if(path.endsWith(":0")) {
        path = path.substring(0, path.length() - 2);
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

   * @return True if target is contained list.
   */
  public boolean targetContainedIn(List olatResourceables) {
    boolean found = false;
    for (Iterator it_ores = olatResourceables.iterator(); it_ores.hasNext();) {
      OLATResourceable aor = (OLATResourceable) it_ores.next();
      String derived = OresHelper.createStringRepresenting(aor);
      if (derived.equals(derivedOres)) {
        found = true;
        break;
      }
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

   * @return OLATResourceable instance
   */
  public static OLATResourceable createOLATResourceableInstance(final String type, final Long key) {
    if (key == null) throw new AssertException("key may not be null; type = "+type);
    if (type.length() > ORES_TYPE_LENGTH) throw new AssertException("Olatresource type may not exceed 50 chars");
    return new OLATResourceable() {
      public String getResourceableTypeName() {
        return type;
      }
      public Long getResourceableId() {
        return key;
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

   * @param subType may only contain a..z and 0..9; and may only be 15 chars long
   * @return OLATResourceable
   */
  public static OLATResourceable lookupType(Class aClass, String subType) {
    final String type = calculateTypeName(aClass, subType);
    OLATResourceable ores = new OLATResourceable() {
      public String getResourceableTypeName() { return type;  }
      public Long getResourceableId() { return null}};
    return ores;
  }
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

    return createOLATResourceableInstanceWithoutCheck(type, new Long(0));
  }

  public static OLATResourceable createOLATResourceableInstanceWithoutCheck(final String type,final Long key) {
    if (key == null) throw new AssertException("key may not be null; type = "+type);
    return new OLATResourceable() {
      public String getResourceableTypeName() {
        return type;
      }
      public Long getResourceableId() {
        return key;
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

    getWindowControl().getWindowBackOffice().addCycleListener(this);
    /*
     * register for locale change events ->
     */
    //move to a i18nModule? languageManger? languageChooserController?
    OLATResourceable wrappedLocale = OresHelper.createOLATResourceableType(Locale.class);
    ureq.getUserSession().getSingleUserEventCenter().registerFor(this, getIdentity(), wrappedLocale);
    /*
     * register for global sticky message changed events
     */
    GlobalStickyMessage.registerForGlobalStickyMessage(this, ureq.getIdentity());
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

        uriPrefix = uriPrefix.substring(0, lastIndex);
      }
      int lastSlashPos = uriPrefix.lastIndexOf("/");
      String feedUriPrefix = uriPrefix.substring(lastSlashPos + 1);
      // String feedUriPrefix = uriPrefix.replaceAll("olat|/", "");
      OLATResourceable feed = null;

      if (path.isCachedAndAccessible()) {
        // Serve request
        path.compile();
        feed = OLATResourceManager.getInstance().findResourceable(path.getFeedId(), resourceTypes.get(feedUriPrefix));
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

    boolean hasAccess = false;
    Identity identity = getIdentity(path.getIdentityKey());

    if (path.isCourseType()) {
      // A course node is being requested
      OLATResourceable oresCourse = OLATResourceManager.getInstance()
          .findResourceable(path.getCourseId(), CourseModule.getCourseTypeName());
      ICourse course = CourseFactory.loadCourse(oresCourse);
      CourseNode node = course.getEditorTreeModel().getCourseNode(path.getNodeId());
      // Check access
      hasAccess = hasAccess(identity, path.getToken(), course, node);
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

   * Get the repository handler for this repository entry.
   * @param re
   * @return the handler or null if no appropriate handler could be found
   */
  public Indexer getRepositoryEntryIndexer(RepositoryEntry re) {
    OLATResourceable ores = re.getOlatResource();
    if (ores == null) throw new AssertException("RepositoryEntry has no OlatResource [re.getOlatResource()==null].");
    return getRepositoryEntryIndexer(ores.getResourceableTypeName());
  }
View Full Code Here

Examples of org.olat.core.id.OLATResourceable

    menuTree = new MenuTree("cpDisplayTree");
    menuTree.setTreeModel(treeModel);
    menuTree.addListener(this);
   
    OLATResourceable courseOres = null;
    // load course where this scorm package runs in
    if (courseIdNodeId != null) {
      String courseId = courseIdNodeId;
      int delimiterPos = courseId.indexOf("-");
      if (delimiterPos != -1) {
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.