iab-Oil 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/DataModelInterpreter.rb +12 -0
- data/lib/LayoutInterpreter.rb +25 -28
- metadata +1 -1
data/lib/DataModelInterpreter.rb
CHANGED
@@ -49,6 +49,18 @@ class DataModelInterpreter < DslContext
|
|
49
49
|
return e
|
50
50
|
end
|
51
51
|
|
52
|
+
def lov(*args)
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
def endlov(*args)
|
57
|
+
|
58
|
+
end
|
59
|
+
|
60
|
+
def collection(*args)
|
61
|
+
|
62
|
+
end
|
63
|
+
|
52
64
|
def element(*args)
|
53
65
|
createNewElement(args[0],nil,false,@elementTree.last,nil)
|
54
66
|
end
|
data/lib/LayoutInterpreter.rb
CHANGED
@@ -4,16 +4,16 @@ require File.join(File.dirname(__FILE__),'CoverageInterpreter')
|
|
4
4
|
class LayoutInterpreter < DslContext
|
5
5
|
|
6
6
|
bubble :than, :is, :list, :the, :to, :at, :it, :endheader, :endlayout, :endfooter
|
7
|
-
|
7
|
+
|
8
8
|
def getResult
|
9
9
|
widgets = ""
|
10
10
|
@widgets.each do |k,v|
|
11
11
|
widgets << ",'#{k}'"
|
12
12
|
end
|
13
|
-
@erb = "<%= widgets(#{widgets[1..-1]}) %>\n" +
|
13
|
+
@erb = "<head>\n <%= widgets(#{widgets[1..-1]}) %>\n" + @erb unless widgets.length == 0
|
14
14
|
@erb
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
def product(*args)
|
18
18
|
@product = args[0]
|
19
19
|
end
|
@@ -21,25 +21,22 @@ class LayoutInterpreter < DslContext
|
|
21
21
|
def navigation(steps)
|
22
22
|
@navigationSteps = steps
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
def layout(*args)
|
26
26
|
@widgets = Hash.new
|
27
|
-
@erb = "
|
28
|
-
@erb << "<%= getCSS('#{args[0]}.css') %>\n"
|
27
|
+
@erb = "<%= getCSS('#{args[0]}.css') %>\n"
|
29
28
|
@erb << "</head>\n"
|
30
29
|
@erb << "<body>\n"
|
31
|
-
@erb << "\t<div class=\"container\">\n"
|
32
30
|
end
|
33
31
|
|
34
32
|
def endlayout(*args)
|
35
|
-
|
36
|
-
@erb << "</body>"
|
33
|
+
@erb << "</body>"
|
37
34
|
end
|
38
|
-
|
35
|
+
|
39
36
|
def header(*args)
|
40
37
|
@erb << "\t\t<div class=\"header\">\n"
|
41
38
|
end
|
42
|
-
|
39
|
+
|
43
40
|
def endheader(*args)
|
44
41
|
@erb << "\t\t</div>\n"
|
45
42
|
end
|
@@ -47,7 +44,7 @@ class LayoutInterpreter < DslContext
|
|
47
44
|
def miniheader(*args)
|
48
45
|
@erb << "\t\t<div class=\"mini-header\">#{args[0]}\n"
|
49
46
|
end
|
50
|
-
|
47
|
+
|
51
48
|
def endminiheader(*args)
|
52
49
|
@erb << "\t\t</div>\n"
|
53
50
|
end
|
@@ -55,11 +52,11 @@ class LayoutInterpreter < DslContext
|
|
55
52
|
def column(*args)
|
56
53
|
@erb << "\t\t<td style=\"vertical-align: top;\">\n"
|
57
54
|
end
|
58
|
-
|
55
|
+
|
59
56
|
def endcolumn
|
60
57
|
@erb << "\t\t</td>\n"
|
61
58
|
end
|
62
|
-
|
59
|
+
|
63
60
|
def columns
|
64
61
|
@erb << "\t\t<table class=\"columnWrapper\"><tr>\n"
|
65
62
|
end
|
@@ -67,11 +64,11 @@ class LayoutInterpreter < DslContext
|
|
67
64
|
def endcolumns
|
68
65
|
@erb << "\t\t</tr></table>\n"
|
69
66
|
end
|
70
|
-
|
67
|
+
|
71
68
|
def footer(*args)
|
72
69
|
@erb << "\t\t<div class=\"footer\">\n"
|
73
70
|
end
|
74
|
-
|
71
|
+
|
75
72
|
def endfooter(*args)
|
76
73
|
@erb << "\t\t</div>\n"
|
77
74
|
end
|
@@ -87,7 +84,7 @@ class LayoutInterpreter < DslContext
|
|
87
84
|
def endpanel
|
88
85
|
@erb << "\t\t\t</div>\n"
|
89
86
|
end
|
90
|
-
|
87
|
+
|
91
88
|
def product_menu(*args)
|
92
89
|
#TODO:slidingMenu needs implementing as a single item menu construct
|
93
90
|
#that is repeated for each of theargs
|
@@ -97,18 +94,18 @@ class LayoutInterpreter < DslContext
|
|
97
94
|
@erb << ') } %>'
|
98
95
|
@erb << "\n"
|
99
96
|
end
|
100
|
-
|
97
|
+
|
101
98
|
def teaser(*args)
|
102
99
|
@erb << "\t\t\t<%= render :partial => \"#\{teaserROOT}/#{args[0]}\" %>\n"
|
103
100
|
end
|
104
|
-
|
101
|
+
|
105
102
|
def widget(*args)
|
106
103
|
@widgets["#{args[0]}"] = 1
|
107
104
|
|
108
105
|
@erb << "\t\t\t<% #{args[0]} \"#\{widgetROOT}/#{args[0]}\""
|
109
|
-
|
106
|
+
|
110
107
|
widget_args_hash = args[1]
|
111
|
-
|
108
|
+
|
112
109
|
if (@navigationSteps.length > 0)
|
113
110
|
if (args[0].to_sym == :submit_panel)
|
114
111
|
widget_args_hash = {:nextLayout => @navigationSteps[0].to_sym}
|
@@ -122,8 +119,8 @@ class LayoutInterpreter < DslContext
|
|
122
119
|
widget_args_hash = eval(str)
|
123
120
|
end
|
124
121
|
end
|
125
|
-
|
126
|
-
|
122
|
+
|
123
|
+
|
127
124
|
if (widget_args_hash and widget_args_hash.class.name == "Hash")
|
128
125
|
sHash = "{"
|
129
126
|
comma = ""
|
@@ -131,26 +128,26 @@ class LayoutInterpreter < DslContext
|
|
131
128
|
sHash << "#{comma}:#{n} => '#{v}'"
|
132
129
|
comma = ","
|
133
130
|
end
|
134
|
-
sHash << "}"
|
131
|
+
sHash << "}"
|
135
132
|
|
136
133
|
@erb << ",\"#{sHash}\" do %>\n"
|
137
134
|
else
|
138
135
|
@erb << " do %>\n"
|
139
136
|
end
|
140
137
|
end
|
141
|
-
|
138
|
+
|
142
139
|
def endwidget
|
143
140
|
@erb << "\t\t\t <% end %>\n"
|
144
141
|
end
|
145
|
-
|
142
|
+
|
146
143
|
def entity(*args)
|
147
144
|
interpret(ENTITY_DSL_ROOT, *args)
|
148
145
|
end
|
149
|
-
|
146
|
+
|
150
147
|
def coverage(*args)
|
151
148
|
interpret(COVERAGE_DSL_ROOT, *args)
|
152
149
|
end
|
153
|
-
|
150
|
+
|
154
151
|
private
|
155
152
|
def interpret(dslroot, *args)
|
156
153
|
path = dslroot.gsub(/%product/,@product)
|