Package org.jamwiki.model

Examples of org.jamwiki.model.Topic


    change.setTopicVersionId(rs.getTopicVersionId());
    change.setPreviousTopicVersionId(rs.getPreviousTopicVersionId());
    Key<Topic> topicId = rs.getTopicOKey();
    change.setTopicOKey(topicId);

    Topic topic = rs.getTopicId();
    change.setTopicName(topic.getName());
    change.setCharactersChanged(rs.getCharactersChanged());
    change.setChangeDate(rs.getEditDate());
    change.setChangeComment(rs.getEditComment());

    change.setAuthorId(rs.getAuthorId());

    change.setAuthorName(rs.getAuthorDisplay());
    int editType = rs.getEditType();
    if (editType > 0) {
      change.setEditType(editType);
      // change.initChangeWikiMessageForVersion(editType,
      // .getString("log_params"));
    }
    // int logType = rs.getInt("log_type");
    // if (logType > 0) {
    // change.setLogType(logType);
    // change.initChangeWikiMessageForLog(logType, rs.getString("log_params"));
    // }
    change.setVirtualWiki(topic.getVirtualWiki());
    return change;
  }
View Full Code Here


  }

  @Override
  public List<RecentChange> getTopicHistory(String virtualWiki, String topicName, Pagination pagination, boolean descending)
      throws DataAccessException {
    Topic topic = this.lookupTopic(virtualWiki, topicName, true, null);
    if (topic == null) {
      return new ArrayList<RecentChange>();
    }
    QueryResultIterable<TopicVersion> list = TopicVersionService.findByTopic(topic);
    List<RecentChange> recentChanges = new ArrayList<RecentChange>();
View Full Code Here

  /**
   * The slice and splice parser code is very similar, so this method simply consolidates
   * that code to avoid duplication.
   */
  private static String[] executeSliceOrSplice(ParserOutput parserOutput, String context, Locale locale, String virtualWiki, String topicName, int targetSection, String replacementText, boolean isSlice) throws ParserException {
    Topic topic = null;
    try {
      topic = WikiBase.getDataHandler().lookupTopic(virtualWiki, topicName, false, null);
    } catch (DataAccessException e) {
      throw new ParserException(e);
    }
    if (topic == null || topic.getTopicContent() == null) {
      return null;
    }
    ParserInput parserInput = new ParserInput();
    parserInput.setContext(context);
    parserInput.setLocale(locale);
    parserInput.setTopicName(topicName);
    parserInput.setVirtualWiki(virtualWiki);
    AbstractParser parser = ParserUtil.parserInstance(parserInput);
    String content = null;
    if (isSlice) {
      content = parser.parseSlice(parserOutput, topic.getTopicContent(), targetSection);
    } else {
      content = parser.parseSplice(parserOutput, topic.getTopicContent(), targetSection, replacementText);
    }
    String sectionName = parserOutput.getSectionName();
    return new String[]{sectionName, content};
  }
View Full Code Here

    // || name.equals(MAGIC_ARTICLE_PAGE_NAME_E)) {
    // return Utilities.encodeAndEscapeTopicName(WikiUtil
    // .extractTopicLink(parserInput.getTopicName()));
    // }

    Topic topic = WikiBase.getDataHandler().lookupTopic(
        parserInput.getVirtualWiki(), parserInput.getTopicName(), false, null);
    // TopicVersion topicVersion = null;
     Date revision = null;
    // null check needed for the test data handler, which does not implement
    // topic versions
View Full Code Here

      if (name.startsWith(NamespaceHandler.NAMESPACE_SEPARATOR)) {
        name = name.substring(1);
        inclusion = true;
      }
      // get the parsed template body
      Topic templateTopic = WikiBase.getDataHandler().lookupTopic(
          lexer.getParserInput().getVirtualWiki(), name, false, null);
      this.processTemplateMetadata(lexer.getParserInput(), lexer
          .getParserOutput(), templateTopic, raw, name);
      if (lexer.getMode() <= JFlexParser.MODE_MINIMAL) {
        lexer.getParserInput().decrementTemplateDepth();
View Full Code Here

    if (result != null) {
      return result;
    }
    try {
      topicName = topicName.replaceAll("_", " ");
      Topic topic = WikiBase.getDataHandler().lookupTopic(
          fParserInput.getVirtualWiki(), namespace + ':' + topicName, false,
          null);
      if (topic == null) {
        return null;
      }
      return topic.getTopicContent();
    } catch (Exception e) {
      e.printStackTrace();
    }
    return result;
  }
View Full Code Here

TOP

Related Classes of org.jamwiki.model.Topic

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.