Package fitnesse.wiki

Examples of fitnesse.wiki.WikiPageProperty


  }

  @Test
  public void testRemoval() throws Exception {
    PageData data = pageOne.getData();
    WikiPageProperty symLinks = data.getProperties().set(SymbolicPage.PROPERTY_NAME);
    symLinks.set("SymLink", "PageTwo");
    pageOne.commit(data);
    assertNotNull(pageOne.getChildPage("SymLink"));

    request.addInput("removal", "SymLink");
    Response response = invokeResponder();
View Full Code Here


    assertSubString("WikiWord", content);
  }

  private void prepareSymlinkOnPageOne() {
    PageData data = pageOne.getData();
    WikiPageProperty symLinks = data.getProperties().set(SymbolicPage.PROPERTY_NAME);
    symLinks.set("SymLink", "PageTwo");
    pageOne.commit(data);
    assertNotNull(pageOne.getChildPage("SymLink"));

    request.addInput("rename", "SymLink");
  }
View Full Code Here

    WikiPage pageOne = WikiPageUtil.addPage(root, PathParser.parse("PageOne"), ""); //...page must exist!
    WikiPageUtil.addPage(pageOne, PathParser.parse("ChildOne"), "");                //...page must exist!

    PageData data = page.getData();
    WikiPageProperties props = data.getProperties();
    WikiPageProperty symProp = props.set(SymbolicPage.PROPERTY_NAME);
    symProp.set("InternalAbsPage", ".PageOne.ChildOne");
    symProp.set("InternalRelPage", "PageOne.ChildOne");
    symProp.set("InternalSubPage", ">SomeChild");
    symProp.set("ExternalPage", "file://some/page");
    page.commit(data);

    getPropertiesContentFromPage(page);

    assertSubString("<input type=\"text\" name=\"InternalAbsPage\"", content);
View Full Code Here

    WikiPage child = WikiPageUtil.addPage(page, PathParser.parse("SomeChild"), "");
    WikiPageUtil.addPage(page, PathParser.parse("OtherChild"), "");

    PageData data = child.getData();
    WikiPageProperties props = data.getProperties();
    WikiPageProperty symProp = props.set(SymbolicPage.PROPERTY_NAME);
    symProp.set("InternalBackPage", "<SomePage.OtherChild");
    page.commit(data);

    getPropertiesContentFromPage(page);

    assertSubString("InternalBackPage", content);
View Full Code Here

    WikiPageUtil.addPage(root, PathParser.parse("PageOne.ChildOne"), "");
    WikiPageUtil.addPage(root, PathParser.parse("PageTwo"), "");

    PageData data = pageOne.getData();
    WikiPageProperties properties = data.getProperties();
    WikiPageProperty symLinks = properties.set(SymbolicPage.PROPERTY_NAME);
    symLinks.set("SymPage", "PageTwo");
    pageOne.commit(data);

    request.setResource("root");
    request.addInput("type", "pages");
    Responder responder = new SerializedPageResponder();
View Full Code Here

  private void removeSymbolicLink(Request request, WikiPage page) {
    String linkToRemove = (String) request.getInput("removal");

    PageData data = page.getData();
    WikiPageProperties properties = data.getProperties();
    WikiPageProperty symLinks = getSymLinkProperty(properties);
    symLinks.remove(linkToRemove);
    if (symLinks.keySet().size() == 0)
      properties.remove(SymbolicPage.PROPERTY_NAME);
    page.commit(data);
    setRedirect(resource);
  }
View Full Code Here

    newName = (String) request.getInput("newname");

    if (isValidWikiPageName(newName)) {
      PageData data = page.getData();
      WikiPageProperties properties = data.getProperties();
      WikiPageProperty symLinks = getSymLinkProperty(properties);
      String currentPath = symLinks.get(linkToRename);
      symLinks.remove(linkToRename);
      symLinks.set(newName, currentPath);
      page.commit(data);
      setRedirect(resource);
    }
  }
View Full Code Here

    String linkPath = StringUtils.trim((String) request.getInput("linkPath"));

    if (isValidLinkPathName(linkPath) && isValidWikiPageName(linkName)) {
      PageData data = page.getData();
      WikiPageProperties properties = data.getProperties();
      WikiPageProperty symLinks = getSymLinkProperty(properties);
      symLinks.set(linkName, linkPath);
      page.commit(data);
      setRedirect(resource);
    }
  }
View Full Code Here

    WikiPage start = path.isRelativePath() ? page.getParent() : page; //TODO -AcD- a better way?
    return !start.getPageCrawler().pageExists(path);
  }

  private WikiPageProperty getSymLinkProperty(WikiPageProperties properties) {
    WikiPageProperty symLinks = properties.getProperty(SymbolicPage.PROPERTY_NAME);
    if (symLinks == null)
      symLinks = properties.set(SymbolicPage.PROPERTY_NAME);
    return symLinks;
  }
View Full Code Here

    }

    protected List<WikiPage> getSymlinkChildren(BaseWikiPage page) {
      List<WikiPage> children = new LinkedList<WikiPage>();
      WikiPageProperties props = page.getData().getProperties();
      WikiPageProperty symLinksProperty = props.getProperty(SymbolicPage.PROPERTY_NAME);
      if (symLinksProperty != null) {
        for (String linkName : symLinksProperty.keySet()) {
          WikiPage linkedPage = createSymbolicPage(page, linkName);
          if (linkedPage != null && !children.contains(linkedPage))
            children.add(linkedPage);
        }
      }
View Full Code Here

TOP

Related Classes of fitnesse.wiki.WikiPageProperty

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.