Package org.apache.lenya.cms.site

Examples of org.apache.lenya.cms.site.Label


        TreeSiteManager manager = (TreeSiteManager) publication.getSiteManager(map);
        SiteTree destinationTree = manager.getTree(destinationArea);
        SiteTreeNode destinationNode = destinationTree.getNode(_destinationDocumentId);
        assertNotNull(destinationNode);
        Label destinationLabel = destinationNode.getLabel(_destinationLanguage);
        assertNotNull(destinationLabel);

        SiteTreeNode sourceNode = destinationTree.getNode(_sourceDocumentId);
        Label sourceLabel = sourceNode.getLabel(_sourceLanguage);

        assertTrue(destinationLabel.getLabel().equals(sourceLabel.getLabel()));

    }
View Full Code Here


     * @see TestCase#setUp()
     */
    protected void setUp() throws Exception {
        super.setUp();
    this.siteTree = new DefaultSiteTree("testTree.xml");
    Label label = new Label("Foo", "en");
    Label[] fooLabels = { label };
    this.siteTree.addNode("/foo", fooLabels, null, null, false);
    label = new Label("Home", "en");
    Label[] homeLabels = { label };
    this.siteTree.addNode("/index", homeLabels, null, null, false);
    label = new Label("Bar", "en");
    Label label_de = new Label("Stab", "de");
    Label[] barLabels = { label, label_de };
    this.siteTree.addNode("/foo/bar", barLabels, "http://exact.biz", "suffix", true);
    label = new Label("Lala", "en");
    Label[] lalaLabels = { label };
    this.siteTree.addNode("/foo/lala", lalaLabels, null, null, false);
  }
View Full Code Here

     * Test for void addNode(String, String, Label[])
     *
     * @throws SiteException if an error occurs
     */
    final public void testAddNodeStringStringLabelArray() throws SiteException {
    Label label = new Label("Tutorial", null);
    Label[] labels = { label };

    this.siteTree.addNode("/foo", "tutorial", labels);
    SiteTreeNode node =  this.siteTree.getNode("/foo/tutorial");
    assertNotNull(node);
View Full Code Here

     * Test for void addNode(String, Label[], String, String, boolean)
     *
     * @throws SiteException if an error occurs
     */
    final public void testAddNodeStringLabelArrayStringStringboolean() throws SiteException {
    Label label1 = new Label("Doh", "en");
    Label label2 = new Label("Ding", "en");
    Label[] labels = { label1, label2};

    this.siteTree.addNode("/foo/ding", labels, null, null, false);
   
    assertNotNull(this.siteTree.getNode("/foo/ding"));
View Full Code Here

    /**
     * Test for void addNode(String, String, Label[], String, String, boolean)
     * @throws SiteException if an error occurs
     */
    final public void testAddNodeStringStringLabelArrayStringStringboolean() throws SiteException {
    Label label1 = new Label("Doh", "en");
    Label label2 = new Label("Ding", "en");
    Label[] labels = { label1, label2};

    this.siteTree.addNode("/foo", "baz", labels, null, null, false);
   
    assertNotNull(this.siteTree.getNode("/foo/baz"));
View Full Code Here

  /**
   * Test addLabel
   */
    final public void testAddLabel() {
    Label label = new Label("Tutorial", null);
    Label[] labels = null;

    this.siteTree.addLabel("/foo/bar", label);
    labels = this.siteTree.getNode("/foo/bar").getLabels();
    assertEquals(labels.length, 3);
    label = this.siteTree.getNode("/foo/bar").getLabel("");
    assertNotNull(label);
    assertEquals(label.getLabel(), "Tutorial");
    }
View Full Code Here

   * Test removeLabel
   */
    final public void testRemoveLabel() {
    assertEquals(this.siteTree.getNode("/foo/bar").getLabels().length, 2);
   
    Label label = new Label("Stab", "de");
    this.siteTree.removeLabel("/foo/bar", label);
    assertEquals(this.siteTree.getNode("/foo/bar").getLabels().length, 1);
   
    assertEquals(this.siteTree.getNode("/foo/bar").getLabels()[0], new Label("Bar", "en"));
   
    this.siteTree.addLabel("/foo/bar", label);
    assertEquals(this.siteTree.getNode("/foo/bar").getLabels().length, 2);
    }
View Full Code Here

   * Test removeNode
   *
   * @throws SiteException if an error occurs
   */
    final public void testRemoveNode() throws SiteException {
      Label label1 = new Label("Hi", "en");
      Label label2 = new Label("Ho", "en");
      Label[] labels1 = { label1, label2};
     
      this.siteTree.addNode("/hi", labels1, null, null, false);

    Label[] labels2 = { label1, label2};
View Full Code Here

     * Test the import of a subtree
     * @throws SiteException if an error occurs.
     */
  final public void testImportSubtree() throws SiteException {
    DefaultSiteTree newSiteTree = new DefaultSiteTree("importedTree.xml");
    Label label = new Label("root", "en");
    Label[] rootLabels = { label };
    newSiteTree.addNode("/root", rootLabels, null, null, false);
    label = new Label("foo", "en");
    Label[] fooLabels = { label };
    newSiteTree.addNode("/root/foo", fooLabels, null, null, false);
    label = new Label("subtree", "en");
    Label[] subtreeLabels = { label };
    newSiteTree.addNode("/root/subtree", subtreeLabels, "http://exact.biz", "suffix", true);
    label = new Label("child", "en");
    Label[] childLabels = { label };
    newSiteTree.addNode("/root/subtree/child", childLabels, null, null, false);
    SiteTreeNode node=newSiteTree.getNode("/root/subtree");
    assertNotNull(node);
    SiteTreeNode parentNode=this.siteTree.getNode("/foo/lala");
View Full Code Here

     * @see TestCase#setUp()
     */
    protected void setUp() throws Exception {
        super.setUp();
        DefaultSiteTree siteTree = new DefaultSiteTree("testTree");
        Label label = new Label("Foo", "en");
        Label[] fooLabels = { label };
        siteTree.addNode("/foo", fooLabels, null, null, false);
        label = new Label("Bar", "en");
        Label label_de = new Label("Stab", "de");
        Label[] barLabels = { label, label_de };
        siteTree.addNode(
            "/foo/bar",
            barLabels,
            "http://exact.biz",
View Full Code Here

TOP

Related Classes of org.apache.lenya.cms.site.Label

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.