Package org.olat.modules.wiki

Examples of org.olat.modules.wiki.Wiki


   *      java.lang.String, boolean, java.lang.Object)
   */
  public Topic lookupTopic(String virtualWiki, String topicName, boolean deleteOK, Object transactionObject) throws Exception {
    String decodedName = null;

    Wiki wiki = WikiManager.getInstance().getOrLoadWiki(ores);
    try {
      decodedName = URLDecoder.decode(topicName, "utf-8");
    } catch (UnsupportedEncodingException e) {
      //
    }
    if (Tracing.isDebugEnabled(OlatWikiDataHandler.class)) {
      Tracing.logDebug("page name not normalized: " + topicName, OlatWikiDataHandler.class);
      Tracing.logDebug("page name normalized: " + FilterUtil.normalizeWikiLink(topicName), OlatWikiDataHandler.class);
      try {
        Tracing.logDebug("page name urldecoded name: " + URLDecoder.decode(topicName, "utf-8"), OlatWikiDataHandler.class);
        Tracing.logDebug("page name urldecoded and normalized: " + FilterUtil.normalizeWikiLink(URLDecoder.decode(topicName, "utf-8")),
            OlatWikiDataHandler.class);
        Tracing.logDebug("page name urldecoded normalized and transformed to id: "
            + wiki.generatePageId(FilterUtil.normalizeWikiLink(decodedName)), OlatWikiDataHandler.class);
      } catch (UnsupportedEncodingException e) {
        //
      }
    }
    Topic topic = new Topic();
    if (decodedName.startsWith(IMAGE_NAMESPACE)) {
      String imageName = topicName.substring(IMAGE_NAMESPACE.length());
      if (!wiki.mediaFileExists(imageName)) return null;
      topic.setName(imageName);
      topic.setTopicType(Topic.TYPE_IMAGE);
      return topic;
    } else if (decodedName.startsWith(MEDIA_NAMESPACE)) {
      String mediaName = topicName.substring(MEDIA_NAMESPACE.length(), topicName.length());
      if (!wiki.mediaFileExists(mediaName)) return null;
      topic.setName(mediaName);
      topic.setTopicType(Topic.TYPE_FILE);
      return topic;
    }
    if (wiki.pageExists(wiki.generatePageId(FilterUtil.normalizeWikiLink(decodedName)))) {
      topic.setName(topicName);
      return topic;
    }
    return null;
  }
View Full Code Here


//      Utilities.validateTopicName(topic);
//    } catch (WikiException e) {
//      throw new OLATRuntimeException(this.getClass(), "invalid topic name!", e);
//    }
   
    Wiki wiki = WikiManager.getInstance().getOrLoadWiki(ores);
    if (topic.startsWith(IMAGE_NAMESPACE) || topic.startsWith(MEDIA_NAMESPACE)) {
      return wiki.pageExists(topic);
    }
    String pageId = WikiManager.generatePageId(FilterUtil.normalizeWikiLink(topic));
    return wiki.pageExists(pageId);
  }
View Full Code Here

    // Index Group Wiki
    if (log.isDebug()) log.debug("Analyse Wiki for Group=" + businessGroup);
    CollaborationTools collabTools = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(businessGroup);
    if (collabTools.isToolEnabled(CollaborationTools.TOOL_WIKI) ) {
      try {
        Wiki wiki = WikiManager.getInstance().getOrLoadWiki(businessGroup);
          // loop over all wiki pages
          List<WikiPage> wikiPageList = wiki.getAllPagesWithContent();
          for (WikiPage wikiPage : wikiPageList) {
            SearchResourceContext wikiResourceContext = new SearchResourceContext(parentResourceContext);
            wikiResourceContext.setBusinessControlFor(BusinessGroupMainRunController.ORES_TOOLWIKI);
            wikiResourceContext.setDocumentType(TYPE);
            wikiResourceContext.setDocumentContext(businessGroup.getKey() + " ");
View Full Code Here

    if (log.isDebug()) log.debug("Index wiki...");
    String repoEntryName = "*name not available*";
    try {
      RepositoryEntry repositoryEntry = courseNode.getReferencedRepositoryEntry();
      repoEntryName = repositoryEntry.getDisplayname();
      Wiki wiki = WikiManager.getInstance().getOrLoadWiki(courseNode.getReferencedRepositoryEntry().getOlatResource());
      // loop over all wiki pages
      List<WikiPage> wikiPageList = wiki.getAllPagesWithContent();
      for (WikiPage wikiPage : wikiPageList) {
        try {
          SearchResourceContext courseNodeResourceContext = new SearchResourceContext(repositoryResourceContext);
          courseNodeResourceContext.setBusinessControlFor(courseNode);
          courseNodeResourceContext.setDocumentType(TYPE);
View Full Code Here

TOP

Related Classes of org.olat.modules.wiki.Wiki

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.