Search in sources :

Example 1 with Tbody

use of org.structr.web.entity.html.Tbody in project structr by structr.

the class DeploymentTest method test31RoundtripWithEmptyContentElements.

@Test
public void test31RoundtripWithEmptyContentElements() {
    // setup
    try (final Tx tx = app.tx()) {
        final Page page = Page.createNewPage(securityContext, "test31");
        final Html html = createElement(page, page, "html");
        final Head head = createElement(page, html, "head");
        createElement(page, head, "title", "test31");
        final Body body = createElement(page, html, "body");
        final Div div1 = createElement(page, body, "div");
        final Div div2 = createElement(page, div1, "div", "");
        final Table table1 = createElement(page, div2, "table");
        final Thead thead = createElement(page, table1, "thead");
        final Tbody tbody = createElement(page, table1, "tbody");
        final Tr tr1 = createElement(page, thead, "tr");
        final Tr tr2 = createElement(page, tbody, "tr");
        final Td td11 = createElement(page, tr1, "td");
        final Content c1 = createContent(page, td11, "");
        final Td td12 = createElement(page, tr1, "td", "content12");
        final P p1 = createElement(page, td12, "p", "");
        final Ul ul = createElement(page, p1, "ul");
        final Li li = createElement(page, ul, "li", "");
        final Td td21 = createElement(page, tr2, "td", "content21");
        final Td td22 = createElement(page, tr2, "td", "content22");
        final Select select = createElement(page, td11, "select");
        final Option option1 = createElement(page, select, "option", "");
        final Option option2 = createElement(page, select, "option", "value2");
        final Content c2 = createContent(page, div2, "");
        final Table table2 = createElement(page, div2, "table");
        // include visibility flags
        page.setProperty(AbstractNode.visibleToAuthenticatedUsers, true);
        c1.setProperty(AbstractNode.visibleToAuthenticatedUsers, true);
        c2.setProperty(AbstractNode.visibleToAuthenticatedUsers, true);
        // modify visibility to produce two consecutive deployment instruction comments
        td12.setProperty(AbstractNode.visibleToPublicUsers, true);
        table2.setProperty(AbstractNode.visibleToPublicUsers, true);
        tx.success();
    } catch (FrameworkException fex) {
        fail("Unexpected exception.");
    }
    compare(calculateHash(), true);
}
Also used : Head(org.structr.web.entity.html.Head) Table(org.structr.web.entity.html.Table) Tx(org.structr.core.graph.Tx) Thead(org.structr.web.entity.html.Thead) FrameworkException(org.structr.common.error.FrameworkException) Html(org.structr.web.entity.html.Html) Page(org.structr.web.entity.dom.Page) Div(org.structr.web.entity.html.Div) Td(org.structr.web.entity.html.Td) P(org.structr.web.entity.html.P) Content(org.structr.web.entity.dom.Content) Ul(org.structr.web.entity.html.Ul) Select(org.structr.web.entity.html.Select) Option(org.structr.web.entity.html.Option) Tbody(org.structr.web.entity.html.Tbody) Body(org.structr.web.entity.html.Body) Li(org.structr.web.entity.html.Li) Tr(org.structr.web.entity.html.Tr) Test(org.junit.Test) StructrUiTest(org.structr.web.StructrUiTest)

Example 2 with Tbody

use of org.structr.web.entity.html.Tbody in project structr by structr.

the class DeploymentTest method test11TemplateInTbody.

@Test
public void test11TemplateInTbody() {
    // setup
    try (final Tx tx = app.tx()) {
        // create first page
        final Page page1 = Page.createNewPage(securityContext, "test11");
        final Html html1 = createElement(page1, page1, "html");
        final Head head1 = createElement(page1, html1, "head");
        createElement(page1, head1, "title", "test11_1");
        final Body body1 = createElement(page1, html1, "body");
        final Table table = createElement(page1, body1, "table");
        final Tbody tbody = createElement(page1, table, "tbody");
        final Template template1 = createTemplate(page1, tbody, "<tr><td>${user.name}</td></tr>");
        final PropertyMap template1Properties = new PropertyMap();
        template1Properties.put(StructrApp.key(DOMNode.class, "functionQuery"), "find('User')");
        template1Properties.put(StructrApp.key(DOMNode.class, "dataKey"), "user");
        template1.setProperties(template1.getSecurityContext(), template1Properties);
        tx.success();
    } catch (FrameworkException fex) {
        fail("Unexpected exception.");
    }
    // test
    compare(calculateHash(), true);
}
Also used : Head(org.structr.web.entity.html.Head) Table(org.structr.web.entity.html.Table) PropertyMap(org.structr.core.property.PropertyMap) Tx(org.structr.core.graph.Tx) FrameworkException(org.structr.common.error.FrameworkException) Html(org.structr.web.entity.html.Html) Page(org.structr.web.entity.dom.Page) Tbody(org.structr.web.entity.html.Tbody) DOMNode(org.structr.web.entity.dom.DOMNode) Body(org.structr.web.entity.html.Body) Template(org.structr.web.entity.dom.Template) MailTemplate(org.structr.core.entity.MailTemplate) Test(org.junit.Test) StructrUiTest(org.structr.web.StructrUiTest)

Example 3 with Tbody

use of org.structr.web.entity.html.Tbody in project structr by structr.

the class DeploymentTest method test30IncreasingIndentationCountInRoundtrip.

@Test
public void test30IncreasingIndentationCountInRoundtrip() {
    // setup
    try (final Tx tx = app.tx()) {
        final Page page = Page.createNewPage(securityContext, "test30");
        final Html html = createElement(page, page, "html");
        final Head head = createElement(page, html, "head");
        createElement(page, head, "title", "test30");
        final Body body = createElement(page, html, "body");
        final Div div1 = createElement(page, body, "div");
        final Div div2 = createElement(page, div1, "div", "This is a test.");
        final Table table1 = createElement(page, div2, "table");
        final Thead thead = createElement(page, table1, "thead");
        final Tbody tbody = createElement(page, table1, "tbody");
        final Tr tr1 = createElement(page, thead, "tr");
        final Tr tr2 = createElement(page, tbody, "tr");
        final Td td11 = createElement(page, tr1, "td", "content11", "Content before <select>");
        final Td td12 = createElement(page, tr1, "td", "content12");
        final Td td21 = createElement(page, tr2, "td", "content21");
        final Td td22 = createElement(page, tr2, "td", "content22");
        final Select select = createElement(page, td11, "select");
        final Option option1 = createElement(page, select, "option", "value1");
        final Option option2 = createElement(page, select, "option", "value2");
        tx.success();
    } catch (FrameworkException fex) {
        fail("Unexpected exception.");
    }
    compare(calculateHash(), true);
}
Also used : Head(org.structr.web.entity.html.Head) Table(org.structr.web.entity.html.Table) Tx(org.structr.core.graph.Tx) Thead(org.structr.web.entity.html.Thead) FrameworkException(org.structr.common.error.FrameworkException) Html(org.structr.web.entity.html.Html) Page(org.structr.web.entity.dom.Page) Div(org.structr.web.entity.html.Div) Td(org.structr.web.entity.html.Td) Select(org.structr.web.entity.html.Select) Option(org.structr.web.entity.html.Option) Tbody(org.structr.web.entity.html.Tbody) Body(org.structr.web.entity.html.Body) Tr(org.structr.web.entity.html.Tr) Test(org.junit.Test) StructrUiTest(org.structr.web.StructrUiTest)

Aggregations

Test (org.junit.Test)3 FrameworkException (org.structr.common.error.FrameworkException)3 Tx (org.structr.core.graph.Tx)3 StructrUiTest (org.structr.web.StructrUiTest)3 Page (org.structr.web.entity.dom.Page)3 Body (org.structr.web.entity.html.Body)3 Head (org.structr.web.entity.html.Head)3 Html (org.structr.web.entity.html.Html)3 Table (org.structr.web.entity.html.Table)3 Tbody (org.structr.web.entity.html.Tbody)3 Div (org.structr.web.entity.html.Div)2 Option (org.structr.web.entity.html.Option)2 Select (org.structr.web.entity.html.Select)2 Td (org.structr.web.entity.html.Td)2 Thead (org.structr.web.entity.html.Thead)2 Tr (org.structr.web.entity.html.Tr)2 MailTemplate (org.structr.core.entity.MailTemplate)1 PropertyMap (org.structr.core.property.PropertyMap)1 Content (org.structr.web.entity.dom.Content)1 DOMNode (org.structr.web.entity.dom.DOMNode)1