Wiki Word Transformation

The WikiWord transformation is used to automatically generate links for WikiWords. A WikiWord consists of two or more words composed of at least two letters each, without white spaces, where the first letter of each component word is capitalized and the remaining letters are in lowercase. 

The WikiWord Transformation is disabled by default, but when it is activated it automatically generates links for WikiWords which are pointing to wiki pages. If the referred pages don't exist, a question mark will appear on the link, allowing you to create the new page by clicking on it. To enable the WikiWord transformation, edit the "WEB-INF/" file, un-comment the line #-#rendering.transformations = macro, icon, add value "wikiword"

#-#rendering.transformations = macro, icon, wikiword

then restart the server.

In order to discover WikiWords, this transformation needs to check every rendered word in the page and it can affect the overall performance.

Example of Usage

// Initialize Rendering components and allow getting instances
final EmbeddableComponentManager cm = new EmbeddableComponentManager();

 XDOM xdom = new XDOM(
    Arrays.<Block>asList(new ParagraphBlock(Arrays.asList((Block) new WordBlock("WikiWord")))));

 Transformation transformation = cm.lookup(Transformation.class, "wikiword");
 TransformationContext txContext = new TransformationContext();
 transformation.transform(xdom, txContext);

 WikiPrinter printer = new DefaultWikiPrinter();
 BlockRenderer renderer = cm.lookup(BlockRenderer.class, Syntax.XWIKI_2_0.toIdString());
 renderer.render(xdom, printer);

 String expected = "[[WikiWord]]";

 Assert.assertEquals(expected, printer.toString());


Related Pages

Search this space


Most popular tags

Failed to execute the [groovy] macro
  1. access rights
  2. activity stream
  3. annotation
  4. attachment
  5. comment
  6. Document Tree Macro
  7. export
  8. Extension Manager
  9. Flamingo skin
  10. global user
  11. Groovy event listener
  12. group
  13. nested page
  14. search
  15. skin
  16. syntax
  17. user
  18. user profile
  19. velocity macros
  20. wiki
  21. wysiwyg
  22. XWiki Applications
  23. xwikiattachment_archive table
  24. xwikiattachment table
  25. xwikiattrecyclebin table
  26. xwikiproperties table

[Display all tags from this space]