Package org.olat.modules.wiki.versioning

Examples of org.olat.modules.wiki.versioning.ChangeInfo


   * showdelete        Part of printout.
   * Expects printoldline is at a deletion.
   */
  private void showDelete(List result) {
    if (printstatus != delete) {
      ChangeInfo info = new ChangeInfo(ChangeInfo.DELETE, printoldline, printoldline);
      setLast(info, result);
    }
    printstatus = delete;
    lines.add(oldInfo.symbol[printoldline].getSymbol());
    anyprinted = true;
View Full Code Here


   */
  private void showInsert(List result) {
    if (printstatus == change) {
      // result.add(">>>>     CHANGED TO");
    } else if (printstatus != insert) {
      ChangeInfo info = new ChangeInfo(ChangeInfo.INSERT, printoldline, printoldline);
      setLast(info, result);
    }
    printstatus = insert;
    lines.add(newInfo.symbol[printnewline].getSymbol());
    anyprinted = true;
View Full Code Here

   * Expects printnewline is an insertion.
   *  Expects printoldline is a deletion.
   */
  private void showChange(List result) {
    if (printstatus != change) {
      ChangeInfo info = new ChangeInfo(ChangeInfo.CHANGE, printoldline, printoldline);
      setLast(info, result);
    }
    printstatus = change;
    lines.add(oldInfo.symbol[printoldline].getSymbol());
    anyprinted = true;
View Full Code Here

    if (newblock < 0)
      skipNew();         // already printed.
    else if (oldblock >= newblock) {     // assume new's blk moved.
      blocklen[newother] = -1;         // stamp block as "printed".
      ChangeInfo info = new ChangeInfo(ChangeInfo.MOVE, newother, printoldline);
      setLast(info, result);
      for (; newblock > 0; newblock--, printnewline++)
        lines.add(newInfo.symbol[printnewline].getSymbol());
      anyprinted = true;
      printstatus = idle;
View Full Code Here

    assertEquals("Content of loaded wiki page is not the same after loading from filesystem", WIKI_CONTENT, page1.getContent());
   
    page1.setContent(WIKI_CONTENT+"\nThis is a new line");
    wikiMgr.saveWikiPage(ores, page1, true, wiki);
    List diffs = wiki.getDiff(page1, page1.getVersion() -1, page1.getVersion());
    ChangeInfo change = (ChangeInfo)diffs.get(0);
   
    assertEquals("INSERT", change.getType());
    assertEquals("This is a new line", change.getLines()[0]);
   
    //remove page and reloading should result in error page
    wiki.removePage(page1);
    wikiMgr.deleteWikiPage(ores, page1);
    wiki = wikiMgr.getOrLoadWiki(ores);
View Full Code Here

    String text1 = "Line1\nLine2\nDies ist ein Text.";
    String text2 = text1 + "Text2";
    List diffList = differenceService.diff(text1,text2);
    int i = 1;
    for (Iterator iter = diffList.iterator(); iter.hasNext();) {
      ChangeInfo changeInfo = (ChangeInfo) iter.next();
      assertEquals("Type must be CHANGE",changeInfo.getType(),ChangeInfo.CHANGE);
      assertEquals("Wrong line content.",changeInfo.getLines()[0],"Dies ist ein Text.");
      assertEquals("Wrong line content.",changeInfo.getLines()[1],"Dies ist ein Text.Text2");
    }
  }
View Full Code Here

    String text1 = "Line1\nLine2\nDies ist ein Text.\nbla bla\nText2 Text2.1 Text2.2";
    String text2 = "Line1\nLine2\nDies ist ein Text.\nText2 Text2.1 Text2.2\nbla bla";
    List diffList = differenceService.diff(text1,text2);
    int i = 1;
    for (Iterator iter = diffList.iterator(); iter.hasNext();) {
      ChangeInfo changeInfo = (ChangeInfo) iter.next();
      assertEquals("Type must be MOVE",changeInfo.getType(),ChangeInfo.MOVE);
      assertEquals("Wrong line content.",changeInfo.getLines()[0],"Text2 Text2.1 Text2.2");
    }
  }
View Full Code Here

TOP

Related Classes of org.olat.modules.wiki.versioning.ChangeInfo

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.