summaryrefslogtreecommitdiffstats
path: root/dom/xul/templates/tests/chrome/test_tmpl_storage_tree.xul
blob: 9ca0427132953330a0bfd3f3059c7e2396dd4f02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>

<!--
    storage tree
-->

<window title="XUL Template Tests" width="500" height="600"
        onload="test_template();"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  <script type="application/javascript"
          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>

  <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>

  <data id="output">
      <treecols orient="horizontal">
          <treecol id="species" primary="true" label="Species" flex="2" ordinal="1"/>
          <treecol id="name" label="Common name" flex="2" ordinal="3"/>
          <treecol id="specimen" label="Specimen" flex="3" ordinal="5"/>
          <treecol id="id" label="id" flex="1" ordinal="7"/>
      </treecols>
    <treechildren>
        <treeitem anyid="true"> <treerow>
                <treecell label="arachnids" /> <treecell label="Tarantula"/>  <treecell label="Avicularia avicularia" /> <treecell label="1"/>
        </treerow> </treeitem>
        <treeitem anyid="true"> <treerow>
            <treecell label="birds" /> <treecell label="Barn Owl"/> <treecell label="Tyto alba" /> <treecell label="3"/>
        </treerow> </treeitem>
        <treeitem anyid="true"> <treerow>
            <treecell label="birds" /> <treecell label="Emu"/> <treecell label="Dromaius novaehollandiae" /> <treecell label="2"/>
        </treerow> </treeitem>
        <treeitem anyid="true"> <treerow>
            <treecell label="birds" /> <treecell label="Raven"/>  <treecell label="Corvus corax" /> <treecell label="4"/>
        </treerow> </treeitem>
        <treeitem anyid="true"> <treerow>
            <treecell label="fish" /> <treecell label="Cod"/> <treecell label="Gadus morhua" /> <treecell label="5"/>
        </treerow> </treeitem>
        <treeitem anyid="true"> <treerow>
                <treecell label="fish" /> <treecell label="Swordfish"/>   <treecell label="Xiphias gladius" /> <treecell label="6"/>
        </treerow> </treeitem>
        <treeitem anyid="true"> <treerow>
            <treecell label="mammals" /> <treecell label="African Elephant"/> <treecell label="Loxodonta africana" /> <treecell label="9"/>
        </treerow> </treeitem>
       <treeitem anyid="true"> <treerow>
            <treecell label="mammals" /> <treecell label="Gorilla"/>  <treecell label="Gorilla gorilla" /> <treecell label="14"/>
        </treerow> </treeitem>
       <treeitem anyid="true"> <treerow>
            <treecell label="mammals" /> <treecell label="HIPPOPOTAMUS"/> <treecell label="Hippopotamus amphibius" /> <treecell label="8"/>
       </treerow> </treeitem>
       <treeitem anyid="true"> <treerow>
            <treecell label="mammals" /> <treecell label="LAMA"/>  <treecell label="Lama glama" /> <treecell label="10"/>
        </treerow> </treeitem>
        <treeitem anyid="true"> <treerow>
                <treecell label="mammals" /> <treecell label="Lion"/>  <treecell label="Panthera leo" /> <treecell label="7"/>
        </treerow> </treeitem>
        <treeitem anyid="true"> <treerow>
            <treecell label="mammals" /> <treecell label="Nine-banded Armadillo"/>  <treecell label="Dasypus novemcinctus" /> <treecell label="13"/>
        </treerow> </treeitem>
        <treeitem anyid="true"> <treerow>
            <treecell label="mammals" /> <treecell label="Polar Bear"/>  <treecell label="Thalarctos maritimus" /> <treecell label="11"/>
        </treerow> </treeitem>
       <treeitem anyid="true"> <treerow>
            <treecell label="mammals" /> <treecell label="aardvark"/> <treecell label="Orycteropus afer" /> <treecell label="12"/>
        </treerow> </treeitem>
        <treeitem anyid="true"> <treerow>
                <treecell label="reptiles" /> <treecell label="Anaconda"/> <treecell label="Eunectes murinus" /> <treecell label="15"/>
        </treerow> </treeitem>
       <treeitem anyid="true"> <treerow>
            <treecell label="reptiles" /> <treecell label="Chameleon"/> <treecell label="Chamaeleo chamaelon" /> <treecell label="16"/>
        </treerow> </treeitem>
    </treechildren>
  </data>

<script src="templates_shared.js"/>

<script>
<![CDATA[
SimpleTest.waitForExplicitFinish();

copyToProfile('animals.sqlite');

var testid ="storage tree";
var queryType = "storage";
var isTreeBuilder = true;
var needsOpen = false;
var notWorkingYet = false;
var notWorkingYetDynamic = false;
var expectedOutput = document.getElementById("output");

var changes = [];
]]>
</script>

<tree   xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root" 
        flex="1" datasources="profile:animals.sqlite" ref="*" querytype="storage" flags="dont-build-content">
    <treecols>
        <treecol id="species" primary="true" label="Species" flex="2"/>
        <treecol id="name" label="Common name" flex="2"/>
        <treecol id="specimen" label="Specimen" flex="3"/>
        <treecol id="id" label="id" flex="1"/>
    </treecols>
    <template>
        <query>
            SELECT a.id, a.name, a.specimen, s.name as species  FROM animals a, species s 
            WHERE a.species_id = s.id ORDER BY species, a.name</query>
        <action>
            <treechildren>
                <treeitem uri="?">
                    <treerow>
                        <treecell label="?species"/>
                        <treecell label="?name"/>
                        <treecell label="?specimen"/>
                        <treecell label="?id"/>
                    </treerow>
                </treeitem>
            </treechildren>
        </action>
    </template>
	</tree>
</window>