Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Vivek
erp5
Commits
c60f541d
Commit
c60f541d
authored
Jul 30, 2015
by
Vivek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renderjs_interfaces: syntax update.
parent
01d900a2
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
515 additions
and
148 deletions
+515
-148
bt5/erp5_web_interface_demo/PathTemplateItem/web_page_module/interface_demo_interface1_html.xml
...teItem/web_page_module/interface_demo_interface1_html.xml
+4
-4
bt5/erp5_web_interface_demo/PathTemplateItem/web_page_module/interface_demo_interface2_html.xml
...teItem/web_page_module/interface_demo_interface2_html.xml
+4
-4
bt5/erp5_web_interface_demo/PathTemplateItem/web_page_module/interface_demo_interface_invalid1_html.xml
...eb_page_module/interface_demo_interface_invalid1_html.xml
+4
-4
bt5/erp5_web_interface_demo/PathTemplateItem/web_page_module/interface_demo_interface_invalid2_html.xml
...eb_page_module/interface_demo_interface_invalid2_html.xml
+3
-3
bt5/erp5_web_interface_demo/PathTemplateItem/web_page_module/interface_demo_interface_invalid3_html.xml
...eb_page_module/interface_demo_interface_invalid3_html.xml
+4
-4
bt5/erp5_web_interface_demo/PathTemplateItem/web_page_module/interface_gadget_interfacedemo_html.xml
...m/web_page_module/interface_gadget_interfacedemo_html.xml
+2
-5
bt5/erp5_web_interface_demo/PathTemplateItem/web_page_module/interface_gadget_interfacedemo_js.xml
...tem/web_page_module/interface_gadget_interfacedemo_js.xml
+3
-3
bt5/erp5_web_interface_demo/PathTemplateItem/web_page_module/interface_gadget_interfaces_js.xml
...teItem/web_page_module/interface_gadget_interfaces_js.xml
+49
-39
bt5/erp5_web_interface_test/PathTemplateItem/web_page_module/interface_demo_interface1_html.xml
...teItem/web_page_module/interface_demo_interface1_html.xml
+4
-4
bt5/erp5_web_interface_test/PathTemplateItem/web_page_module/interface_demo_interface2_html.xml
...teItem/web_page_module/interface_demo_interface2_html.xml
+4
-4
bt5/erp5_web_interface_test/PathTemplateItem/web_page_module/interface_demo_interface_invalid1_html.xml
...eb_page_module/interface_demo_interface_invalid1_html.xml
+4
-4
bt5/erp5_web_interface_test/PathTemplateItem/web_page_module/interface_demo_interface_invalid2_html.xml
...eb_page_module/interface_demo_interface_invalid2_html.xml
+3
-3
bt5/erp5_web_interface_test/PathTemplateItem/web_page_module/interface_demo_interface_invalid3_html.xml
...eb_page_module/interface_demo_interface_invalid3_html.xml
+4
-4
bt5/erp5_web_interface_test/PathTemplateItem/web_page_module/interface_gadget_interfaces_js.xml
...teItem/web_page_module/interface_gadget_interfaces_js.xml
+49
-39
bt5/erp5_web_interface_test/PathTemplateItem/web_page_module/interface_test_gadget.xml
...athTemplateItem/web_page_module/interface_test_gadget.xml
+358
-0
bt5/erp5_web_interface_test/PathTemplateItem/web_page_module/interface_test_gadget_js.xml
...TemplateItem/web_page_module/interface_test_gadget_js.xml
+10
-18
bt5/erp5_web_interface_test/PathTemplateItem/web_page_module/interface_test_mismatched_argument_gadget_js.xml
...e_module/interface_test_mismatched_argument_gadget_js.xml
+3
-3
bt5/erp5_web_interface_test/PathTemplateItem/web_site_module/interface_test.xml
..._test/PathTemplateItem/web_site_module/interface_test.xml
+3
-3
No files found.
bt5/erp5_web_interface_demo/PathTemplateItem/web_page_module/interface_demo_interface1_html.xml
View file @
c60f541d
...
...
@@ -130,8 +130,8 @@
</dd>
\n
<dt>
method3
</dt>
\n
<dd>
description of method3
</dd>
\n
<dl></dl>
\n
</dl>
\n
<dl></dl>
\n
</dl>
\n
</body>
\n
</html>
...
...
@@ -270,7 +270,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.
23279.6717.16810
</string>
</value>
<value>
<string>
944.
38727.13625.36864
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>
143
7729072.46
</float>
<float>
143
8006894.41
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_interface_demo/PathTemplateItem/web_page_module/interface_demo_interface2_html.xml
View file @
c60f541d
...
...
@@ -115,7 +115,7 @@
<dl>
\n
<dt>
testmethod1
</dt>
\n
<dd>
description of testmethod1
</dd>
\n
<dl></dl>
\n
<dl></dl>
\n
<dt>
testmethod2
</dt>
\n
<dd>
description of testmethod2
</dd>
\n
<dl>
\n
...
...
@@ -131,7 +131,7 @@
<dt
data-parameter-required=
"optional"
>
param2
</dt>
\n
<dd>
description of param2
</dd>
\n
</dl>
\n
</dl>
\n
</dl>
\n
</body>
\n
</html>
...
...
@@ -270,7 +270,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.
22909.64597.48196
</string>
</value>
<value>
<string>
944.
38727.37060.50432
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>
143
7729093.91
</float>
<float>
143
8006945.77
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_interface_demo/PathTemplateItem/web_page_module/interface_demo_interface_invalid1_html.xml
View file @
c60f541d
...
...
@@ -132,8 +132,8 @@
</dd>
\n
<dt>
method3
</dt>
\n
<dd>
description of method3
</dd>
\n
<dl></dl>
\n
</dl>
\n
<dl></dl>
\n
</dl>
\n
</body>
\n
</html>
...
...
@@ -272,7 +272,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.387
47.4525.18602
</string>
</value>
<value>
<string>
944.387
63.51422.46455
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -290,7 +290,7 @@
</tuple>
<state>
<tuple>
<float>
143
7730636.54
</float>
<float>
143
8007018.31
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_interface_demo/PathTemplateItem/web_page_module/interface_demo_interface_invalid2_html.xml
View file @
c60f541d
...
...
@@ -133,7 +133,7 @@
\n
<!--Missing <dl></dl> tag for arguments-->
\n
\n
</dl>
\n
</dl>
\n
</body>
\n
</html>
...
...
@@ -272,7 +272,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.387
51.9712.8123
</string>
</value>
<value>
<string>
944.387
63.45191.41369
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -290,7 +290,7 @@
</tuple>
<state>
<tuple>
<float>
143
7730590.39
</float>
<float>
143
8007084.42
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_interface_demo/PathTemplateItem/web_page_module/interface_demo_interface_invalid3_html.xml
View file @
c60f541d
...
...
@@ -132,8 +132,8 @@
</dd>
\n
<dt>
method3
</dt>
\n
<dd>
description of method3
</dd>
\n
<dl></dl>
\n
</dl>
\n
<dl></dl>
\n
</dl>
\n
</body>
\n
</html>
...
...
@@ -272,7 +272,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.387
54.38729.2158
9
</string>
</value>
<value>
<string>
944.387
63.48521.4363
9
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -290,7 +290,7 @@
</tuple>
<state>
<tuple>
<float>
143
7730820.31
</float>
<float>
143
8007104.6
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_interface_demo/PathTemplateItem/web_page_module/interface_gadget_interfacedemo_html.xml
View file @
c60f541d
...
...
@@ -112,9 +112,6 @@
<title>
I-Demo
</title>
\n
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
/>
\n
<link
rel=
"stylesheet"
href=
"jquerymobile.css"
>
\n
\n
<link
rel=
"http://www.renderjs.org/rel/interface"
href=
"demo_interface1.html"
>
\n
<link
rel=
"http://www.renderjs.org/rel/interface"
href=
"demo_interface2.html"
>
\n
\n
<!-- renderjs -->
\n
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
\n
...
...
@@ -323,7 +320,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.43
289.51727.28569
</string>
</value>
<value>
<string>
944.43
346.53030.10871
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -341,7 +338,7 @@
</tuple>
<state>
<tuple>
<float>
14380
06248.54
</float>
<float>
14380
73929.05
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_interface_demo/PathTemplateItem/web_page_module/interface_gadget_interfacedemo_js.xml
View file @
c60f541d
...
...
@@ -106,7 +106,7 @@
\n
var INTERFACE_GADGET_URL = "./gadget_interfaces.html",\n
INTERFACE_GADGET_SCOPE = "interface";\n
\n
\n
rJS(window)\n
.ready(function (g) {\n
g.props = {};\n
...
...
@@ -326,7 +326,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.4306
1.11797.41233
</string>
</value>
<value>
<string>
944.4306
2.44277.6144
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -344,7 +344,7 @@
</tuple>
<state>
<tuple>
<float>
143
7989200.5
3
</float>
<float>
143
8007247.0
3
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_interface_demo/PathTemplateItem/web_page_module/interface_gadget_interfaces_js.xml
View file @
c60f541d
...
...
@@ -179,12 +179,13 @@
dl_list = doc.getElementsByTagName(\'dl\'),\n
next_element = dl_list[0].firstElementChild,\n
method_len = dl_list.length - 1,\n
defer = RSVP.defer();\n
defer = RSVP.defer(),\n
i;\n
if (dl_list[0].childElementCount !== 3*method_len) {\n
throw new Error("Interface Definition Incorrect.");\n
}
\n
}\n
try {\n
for (
var i=0; i<method_len; i+=
1) {\n
for (
i = 0; i < method_len; i +=
1) {\n
if ((!next_element || next_element.localName.toLowerCase() !== \'dt\') ||\n
(!(next_element = next_element.nextElementSibling) || next_element.localName.toLowerCase() !== \'dd\') ||\n
(!(next_element = next_element.nextElementSibling) || next_element.localName.toLowerCase() !== \'dl\')) {\n
...
...
@@ -194,8 +195,9 @@
throw new Error("Interface Definition Incorrect.");\n
}\n
var argument_len = next_element.getElementsByTagName(\'dt\').length,\n
next_child_element = next_element.firstElementChild;\n
for (var j=0; j<argument_len; j+=1) {\n
next_child_element = next_element.firstElementChild,\n
j;\n
for (j = 0; j < argument_len; j += 1) {\n
if ((!next_child_element || next_child_element.localName.toLowerCase() !== \'dt\') ||\n
(!(next_child_element = next_child_element.nextElementSibling) || next_child_element.localName.toLowerCase() !== \'dd\')) {\n
throw new Error("Interface Definition Incorrect.");\n
...
...
@@ -207,7 +209,7 @@
defer.resolve("Success");\n
} catch(error) {\n
defer.reject(error);\n
}
\n
}\n
return defer.promise;\n
});\n
}\n
...
...
@@ -250,12 +252,13 @@
//to verify if all the interface methods are declared by the gadget.\n
var defer = RSVP.defer(),\n
gadget_method_name_list = gadget_method_list,\n
interface_method_name_list = [];\n
for (var i=0; i
<interface_method_list.length
;
i+=1)
{\n
interface_method_name_list = [],\n
i, j;\n
for (i = 0; i
< interface_method_list.length
;
i
+=
1)
{\n
interface_method_name_list.push(interface_method_list[i].name);\n
}\n
try
{\n
for
(
var
j=
0;
j<interface_method_name_list.length;
j+=
1)
{\n
for
(
j =
0;
j
<
interface_method_name_list.length;
j
+=
1)
{\n
if(gadget_method_name_list.indexOf(interface_method_name_list[j])
<
0)
{\n
throw
new
Error("All
methods
are
not
declared.");\n
}\n
...
...
@@ -272,15 +275,17 @@
var
defer =
RSVP.defer(),\n
interface_method_dict =
{},\n
gadget_method_name_list =
[],\n
index;\n
for(var
i=
0;
i<interface_method_list.length;
i+=1)
{\n
index,\n
item,\n
i,
j;\n
for(
i =
0;
i
<
interface_method_list.length;
i
+=
1)
{\n
interface_method_dict[interface_method_list[i].name]
=
interface_method_list[i];\n
}\n
for(
var
j=
0;
j<gadget_method_list.length;
j+=
1)
{\n
for(
j =
0;
j
<
gadget_method_list.length;
j
+=
1)
{\n
gadget_method_name_list.push(gadget_method_list[j].name);\n
}\n
try
{\n
for(
var
item
in
interface_method_dict)
{\n
for(item
in
interface_method_dict)
{\n
index =
gadget_method_name_list.lastIndexOf(item);\n
if(!verifyMethodSignature(interface_method_dict[item],
gadget_method_list[index]))
{\n
throw
new
Error("All
methods
signature
do
not
match.");\n
...
...
@@ -296,10 +301,11 @@
function
verifyMethodSignature(interface_method,
gadget_method)
{\n
//to
verify
if
two
methods
have
the
same
signature\n
var
max_arg_len =
interface_method.argument_list.length,\n
min_arg_len =
0;\n
min_arg_len =
0,\n
i;\n
if
(max_arg_len)
{\n
var
argument_list =
interface_method.argument_list;\n
for
(
var
i=
0;
i<argument_list.length;
i+=
1)
{\n
for
(
i =
0;
i
<
argument_list.length;
i
+=
1)
{\n
if
(argument_list[i].required)
{\n
min_arg_len
+=
1;\n
}\n
...
...
@@ -350,20 +356,22 @@
dt_list = doc.getElementsByTagName(\'dt\'),\n
dd_list = doc.getElementsByTagName(\'dd\'),\n
method_len = dl_list.length - 1,\n
dt_count = 0, \n
dl_count = 1;\n
dt_count = 0,\n
dl_count = 1,\n
i;\n
interface_data.name = doc.getElementsByTagName(\'h1\')[0].innerText;\n
interface_data.description = doc.getElementsByTagName(\'h3\')[0].innerText;\n
for (
var i=0; i
<method_len
;
i+=
1)
{\n
for (
i = 0; i
< method_len
;
i
+=
1)
{\n
var
method =
{\n
name:
dt_list[dt_count].innerText,\n
description:
dd_list[dt_count].innerText,\n
argument_list:
[]\n
},\n
argument_len =
dl_list[dl_count].getElementsByTagName(\'dt\').length;\n
argument_len =
dl_list[dl_count].getElementsByTagName(\'dt\').length,\n
j;\n
dt_count
+=
1;\n
dl_count
+=
1;\n
for
(
var
j=
0;
j<argument_len;
j+=
1)
{\n
for
(
j =
0;
j
<
argument_len;
j
+=
1)
{\n
var
argument_item =
{\n
name:
dt_list[dt_count].innerText,\n
description:
dd_list[dt_count].innerText,\n
...
...
@@ -438,15 +446,17 @@
})\n
.push(function
(declared_interface_list)
{\n
var
interface_url,\n
result_list =
[];\n
for
(var
item
in
declared_interface_list)
{\n
result_list =
[],\n
item;\n
for
(item
in
declared_interface_list)
{\n
interface_url =
declared_interface_list[item];\n
result_list.push(interface_gadget.verifyGadgetInterfaceImplementation(gadget_url,
interface_url));\n
}\n
return
RSVP.all(result_list);\n
})\n
.push(function(result_list)
{\n
for(var
item
in
result_list)
{\n
var
item;\n
for(item
in
result_list)
{\n
if
(!result_list[item])
{\n
throw
new
Error("Interface
Implementation
Failure.");\n
}\n
...
...
@@ -596,7 +606,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.4
3313.24628.20019
</string>
</value>
<value>
<string>
944.4
6238.52656.22988
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -614,7 +624,7 @@
</tuple>
<state>
<tuple>
<float>
1438
006033.5
</float>
<float>
1438
180072.6
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_interface_test/PathTemplateItem/web_page_module/interface_demo_interface1_html.xml
View file @
c60f541d
...
...
@@ -130,8 +130,8 @@
</dd>
\n
<dt>
method3
</dt>
\n
<dd>
description of method3
</dd>
\n
<dl></dl>
\n
</dl>
\n
<dl></dl>
\n
</dl>
\n
</body>
\n
</html>
...
...
@@ -270,7 +270,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.
23279.6717.16810
</string>
</value>
<value>
<string>
944.
38727.13625.36864
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>
143
7729072.46
</float>
<float>
143
8006894.41
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_interface_test/PathTemplateItem/web_page_module/interface_demo_interface2_html.xml
View file @
c60f541d
...
...
@@ -115,7 +115,7 @@
<dl>
\n
<dt>
testmethod1
</dt>
\n
<dd>
description of testmethod1
</dd>
\n
<dl></dl>
\n
<dl></dl>
\n
<dt>
testmethod2
</dt>
\n
<dd>
description of testmethod2
</dd>
\n
<dl>
\n
...
...
@@ -131,7 +131,7 @@
<dt
data-parameter-required=
"optional"
>
param2
</dt>
\n
<dd>
description of param2
</dd>
\n
</dl>
\n
</dl>
\n
</dl>
\n
</body>
\n
</html>
...
...
@@ -270,7 +270,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.
22909.64597.48196
</string>
</value>
<value>
<string>
944.
38727.37060.50432
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>
143
7729093.91
</float>
<float>
143
8006945.77
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_interface_test/PathTemplateItem/web_page_module/interface_demo_interface_invalid1_html.xml
View file @
c60f541d
...
...
@@ -132,8 +132,8 @@
</dd>
\n
<dt>
method3
</dt>
\n
<dd>
description of method3
</dd>
\n
<dl></dl>
\n
</dl>
\n
<dl></dl>
\n
</dl>
\n
</body>
\n
</html>
...
...
@@ -272,7 +272,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.387
47.4525.18602
</string>
</value>
<value>
<string>
944.387
63.51422.46455
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -290,7 +290,7 @@
</tuple>
<state>
<tuple>
<float>
143
7730636.54
</float>
<float>
143
8007018.31
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_interface_test/PathTemplateItem/web_page_module/interface_demo_interface_invalid2_html.xml
View file @
c60f541d
...
...
@@ -133,7 +133,7 @@
\n
<!--Missing <dl></dl> tag for arguments-->
\n
\n
</dl>
\n
</dl>
\n
</body>
\n
</html>
...
...
@@ -272,7 +272,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.387
51.9712.8123
</string>
</value>
<value>
<string>
944.387
63.45191.41369
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -290,7 +290,7 @@
</tuple>
<state>
<tuple>
<float>
143
7730590.39
</float>
<float>
143
8007084.42
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_interface_test/PathTemplateItem/web_page_module/interface_demo_interface_invalid3_html.xml
View file @
c60f541d
...
...
@@ -132,8 +132,8 @@
</dd>
\n
<dt>
method3
</dt>
\n
<dd>
description of method3
</dd>
\n
<dl></dl>
\n
</dl>
\n
<dl></dl>
\n
</dl>
\n
</body>
\n
</html>
...
...
@@ -272,7 +272,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.387
54.38729.2158
9
</string>
</value>
<value>
<string>
944.387
63.48521.4363
9
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -290,7 +290,7 @@
</tuple>
<state>
<tuple>
<float>
143
7730820.31
</float>
<float>
143
8007104.6
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_interface_test/PathTemplateItem/web_page_module/interface_gadget_interfaces_js.xml
View file @
c60f541d
...
...
@@ -179,12 +179,13 @@
dl_list = doc.getElementsByTagName(\'dl\'),\n
next_element = dl_list[0].firstElementChild,\n
method_len = dl_list.length - 1,\n
defer = RSVP.defer();\n
defer = RSVP.defer(),\n
i;\n
if (dl_list[0].childElementCount !== 3*method_len) {\n
throw new Error("Interface Definition Incorrect.");\n
}
\n
}\n
try {\n
for (
var i=0; i<method_len; i+=
1) {\n
for (
i = 0; i < method_len; i +=
1) {\n
if ((!next_element || next_element.localName.toLowerCase() !== \'dt\') ||\n
(!(next_element = next_element.nextElementSibling) || next_element.localName.toLowerCase() !== \'dd\') ||\n
(!(next_element = next_element.nextElementSibling) || next_element.localName.toLowerCase() !== \'dl\')) {\n
...
...
@@ -194,8 +195,9 @@
throw new Error("Interface Definition Incorrect.");\n
}\n
var argument_len = next_element.getElementsByTagName(\'dt\').length,\n
next_child_element = next_element.firstElementChild;\n
for (var j=0; j<argument_len; j+=1) {\n
next_child_element = next_element.firstElementChild,\n
j;\n
for (j = 0; j < argument_len; j += 1) {\n
if ((!next_child_element || next_child_element.localName.toLowerCase() !== \'dt\') ||\n
(!(next_child_element = next_child_element.nextElementSibling) || next_child_element.localName.toLowerCase() !== \'dd\')) {\n
throw new Error("Interface Definition Incorrect.");\n
...
...
@@ -207,7 +209,7 @@
defer.resolve("Success");\n
} catch(error) {\n
defer.reject(error);\n
}
\n
}\n
return defer.promise;\n
});\n
}\n
...
...
@@ -250,12 +252,13 @@
//to verify if all the interface methods are declared by the gadget.\n
var defer = RSVP.defer(),\n
gadget_method_name_list = gadget_method_list,\n
interface_method_name_list = [];\n
for (var i=0; i
<interface_method_list.length
;
i+=1)
{\n
interface_method_name_list = [],\n
i, j;\n
for (i = 0; i
< interface_method_list.length
;
i
+=
1)
{\n
interface_method_name_list.push(interface_method_list[i].name);\n
}\n
try
{\n
for
(
var
j=
0;
j<interface_method_name_list.length;
j+=
1)
{\n
for
(
j =
0;
j
<
interface_method_name_list.length;
j
+=
1)
{\n
if(gadget_method_name_list.indexOf(interface_method_name_list[j])
<
0)
{\n
throw
new
Error("All
methods
are
not
declared.");\n
}\n
...
...
@@ -272,15 +275,17 @@
var
defer =
RSVP.defer(),\n
interface_method_dict =
{},\n
gadget_method_name_list =
[],\n
index;\n
for(var
i=
0;
i<interface_method_list.length;
i+=1)
{\n
index,\n
item,\n
i,
j;\n
for(
i =
0;
i
<
interface_method_list.length;
i
+=
1)
{\n
interface_method_dict[interface_method_list[i].name]
=
interface_method_list[i];\n
}\n
for(
var
j=
0;
j<gadget_method_list.length;
j+=
1)
{\n
for(
j =
0;
j
<
gadget_method_list.length;
j
+=
1)
{\n
gadget_method_name_list.push(gadget_method_list[j].name);\n
}\n
try
{\n
for(
var
item
in
interface_method_dict)
{\n
for(item
in
interface_method_dict)
{\n
index =
gadget_method_name_list.lastIndexOf(item);\n
if(!verifyMethodSignature(interface_method_dict[item],
gadget_method_list[index]))
{\n
throw
new
Error("All
methods
signature
do
not
match.");\n
...
...
@@ -296,10 +301,11 @@
function
verifyMethodSignature(interface_method,
gadget_method)
{\n
//to
verify
if
two
methods
have
the
same
signature\n
var
max_arg_len =
interface_method.argument_list.length,\n
min_arg_len =
0;\n
min_arg_len =
0,\n
i;\n
if
(max_arg_len)
{\n
var
argument_list =
interface_method.argument_list;\n
for
(
var
i=
0;
i<argument_list.length;
i+=
1)
{\n
for
(
i =
0;
i
<
argument_list.length;
i
+=
1)
{\n
if
(argument_list[i].required)
{\n
min_arg_len
+=
1;\n
}\n
...
...
@@ -350,20 +356,22 @@
dt_list = doc.getElementsByTagName(\'dt\'),\n
dd_list = doc.getElementsByTagName(\'dd\'),\n
method_len = dl_list.length - 1,\n
dt_count = 0, \n
dl_count = 1;\n
dt_count = 0,\n
dl_count = 1,\n
i;\n
interface_data.name = doc.getElementsByTagName(\'h1\')[0].innerText;\n
interface_data.description = doc.getElementsByTagName(\'h3\')[0].innerText;\n
for (
var i=0; i
<method_len
;
i+=
1)
{\n
for (
i = 0; i
< method_len
;
i
+=
1)
{\n
var
method =
{\n
name:
dt_list[dt_count].innerText,\n
description:
dd_list[dt_count].innerText,\n
argument_list:
[]\n
},\n
argument_len =
dl_list[dl_count].getElementsByTagName(\'dt\').length;\n
argument_len =
dl_list[dl_count].getElementsByTagName(\'dt\').length,\n
j;\n
dt_count
+=
1;\n
dl_count
+=
1;\n
for
(
var
j=
0;
j<argument_len;
j+=
1)
{\n
for
(
j =
0;
j
<
argument_len;
j
+=
1)
{\n
var
argument_item =
{\n
name:
dt_list[dt_count].innerText,\n
description:
dd_list[dt_count].innerText,\n
...
...
@@ -438,15 +446,17 @@
})\n
.push(function
(declared_interface_list)
{\n
var
interface_url,\n
result_list =
[];\n
for
(var
item
in
declared_interface_list)
{\n
result_list =
[],\n
item;\n
for
(item
in
declared_interface_list)
{\n
interface_url =
declared_interface_list[item];\n
result_list.push(interface_gadget.verifyGadgetInterfaceImplementation(gadget_url,
interface_url));\n
}\n
return
RSVP.all(result_list);\n
})\n
.push(function(result_list)
{\n
for(var
item
in
result_list)
{\n
var
item;\n
for(item
in
result_list)
{\n
if
(!result_list[item])
{\n
throw
new
Error("Interface
Implementation
Failure.");\n
}\n
...
...
@@ -596,7 +606,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.4
3313.24628.20019
</string>
</value>
<value>
<string>
944.4
6238.52656.22988
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -614,7 +624,7 @@
</tuple>
<state>
<tuple>
<float>
1438
006033.5
</float>
<float>
1438
180072.6
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_interface_test/PathTemplateItem/web_page_module/interface_test_gadget.xml
0 → 100644
View file @
c60f541d
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Web Page"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Change_local_roles_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
content_md5
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
renderjs_interface_test.html
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
interface_test_gadget
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<string>
en
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Web Page
</string>
</value>
</item>
<item>
<key>
<string>
short_title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
<!DOCTYPE html>
\n
<html>
\n
<head>
\n
<title>
Test renderJS
</title>
\n
<meta
name=
"viewport"
content=
"width=device-width, height=device-height"
/>
\n
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
/>
\n
<link
rel=
"stylesheet"
href=
"qunit.css"
type=
"text/css"
media=
"screen"
/>
\n
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
\n
<script
src=
"qunit.js"
type=
"text/javascript"
></script>
\n
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
\n
<script
src=
"sinon.js"
type=
"text/javascript"
></script>
\n
<script
src=
"URI.js"
></script>
\n
<script
src=
"jquery.js"
type=
"text/javascript"
></script>
\n
<script
src=
"gadget_interfaces.js"
type=
"text/javascript"
></script>
\n
<script
src=
"renderjs_interface_test.js"
type=
"text/javascript"
></script>
\n
</head>
\n
<body>
\n
<h1
id=
"qunit-header"
>
QUnit renderJS test suite
</h1>
\n
<h2
id=
"qunit-banner"
></h2>
\n
<div
id=
"qunit-testrunner-toolbar"
></div>
\n
<h2
id=
"qunit-userAgent"
></h2>
\n
<ol
id=
"qunit-tests"
></ol>
\n
<div
id=
"qunit-fixture"
>
test markup, will be hidden
</div>
\n
</body>
\n
</html>
]]>
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
RenderJS Interface Test
</string>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
001
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
document_publication_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
edit_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
processing_status_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAU=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
publish_alive
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope1
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1437140868.06
</float>
<string>
GMT
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
published_alive
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.43373.5814.17749
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1438007842.34
</float>
<string>
GMT
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"5"
aka=
"AAAAAAAAAAU="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
external_processing_state
</string>
</key>
<value>
<string>
empty
</string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
0.0.0.0
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1437137904.81
</float>
<string>
GMT
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_interface_test/PathTemplateItem/web_page_module/interface_test_gadget_js.xml
View file @
c60f541d
...
...
@@ -138,11 +138,10 @@
.push(function(result) {\n
equal(result, true, "verify correctly implemented gadget test - expected true - success");\n
});\n
\n
});\n
\n
module("RJSMissingInterfaceDeclarationTest");\n
\n
\n
test("verify missing interface declaration gadget test", function() {\n
var gadget_url = "./interface_test_missing_interface_declaration_gadget.html",\n
interface_url = "https://softinst60317.host.vifib.net/erp5/web_site_module/interface_test/demo_interface1.html";\n
...
...
@@ -156,11 +155,10 @@
.push(function(result) {\n
equal(result, false, "verify missing interface declaration gadget test - expected false - success");\n
});\n
\n
});\n
\n
module("RJSMissingMethodDeclarationTest");\n
\n
\n
test("verify missing method declaration gadget test", function() {\n
var gadget_url = "./interface_test_missing_method_declaration_gadget.html",\n
interface_url = "https://softinst60317.host.vifib.net/erp5/web_site_module/interface_test/demo_interface1.html";\n
...
...
@@ -174,11 +172,10 @@
.push(function(result) {\n
equal(result, false, "verify missing method declaration gadget test - expected false - success");\n
});\n
\n
});\n
\n
module("RJSMismatchedMethodArgumentTest");\n
\n
\n
test("verify mismatched method argument gadget test", function() {\n
var gadget_url = "./interface_test_mismatched_argument_gadget.html",\n
interface_url = "https://softinst60317.host.vifib.net/erp5/web_site_module/interface_test/demo_interface1.html";\n
...
...
@@ -192,11 +189,10 @@
.push(function(result) {\n
equal(result, false, "verify mismatched method argument gadget test - expected false - success");\n
});\n
\n
});\n
\n
module("RJSMultipleInterfaceCorrectImplementationTest");\n
\n
\n
test("verify multiple interface correct gadget test", function() {\n
var gadget_url = "./interface_test_multiple_interface_correct_gadget.html";\n
return new RSVP.Queue()\n
...
...
@@ -209,11 +205,10 @@
.push(function(result) {\n
equal(result, true, "verify multiple interface correct gadget test - expected true - success");\n
});\n
\n
});\n
\n
module("RJSMultipleInterfaceMissingMethodDeclarationTest");\n
\n
\n
test("verify multiple interface missing method declaration gadget test", function() {\n
var gadget_url = "./interface_test_multiple_interface_missing_method_declaration_gadget.html";\n
return new RSVP.Queue()\n
...
...
@@ -226,11 +221,10 @@
.push(function(result) {\n
equal(result, false, "verify multiple interface missing method declaration gadget test - expected false - success");\n
});\n
\n
});\n
\n
module("RJSMultipleInterfaceMismatchedArgumentTest");\n
\n
\n
test("verify multiple interface mismatched argument gadget test", function() {\n
var gadget_url = "./interface_test_multiple_interface_mismached_argument_gadget.html";\n
return new RSVP.Queue()\n
...
...
@@ -243,11 +237,10 @@
.push(function(result) {\n
equal(result, false, "verify multiple interface mismatched argument gadget test - expected false - success");\n
});\n
\n
});\n
\n
module("RJSInvalidInterfaceDefinitionTest");\n
\n
\n
test("verify invalid interface definition gadget test", function() {\n
var gadget_url = "./interface_test_missing_interface_declaration_gadget.html",\n
interface_url1 = "https://softinst60317.host.vifib.net/erp5/web_site_module/interface_test/demo_interface_invalid1.html",\n
...
...
@@ -269,9 +262,8 @@
equal(result[1], false, "verify invalid interface definition - missing param list tag - gadget test - expected false - success");\n
equal(result[2], false, "verify invalid interface definition - missing param description tag - gadget test - expected false - success");\n
});\n
\n
});\n
\n
\n
}(document, renderJS, QUnit, sinon, URI));\n
</string>
</value>
</item>
...
...
@@ -408,7 +400,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.
38901.1195.26897
</string>
</value>
<value>
<string>
944.
43375.6436.61201
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -426,7 +418,7 @@
</tuple>
<state>
<tuple>
<float>
143
7747711.99
</float>
<float>
143
8008031.04
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_interface_test/PathTemplateItem/web_page_module/interface_test_mismatched_argument_gadget_js.xml
View file @
c60f541d
...
...
@@ -112,7 +112,7 @@
.declareMethod("method1", function (param1, param2) {\n
return;\n
})\n
// method2 - argument mismatched - expects param1.
\n
// method2 - argument mismatched - expects param1.\n
.declareMethod("method2", function () {\n
return;\n
})\n
...
...
@@ -258,7 +258,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.375
39.18747.48452
</string>
</value>
<value>
<string>
944.375
43.12889.41096
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -276,7 +276,7 @@
</tuple>
<state>
<tuple>
<float>
143
7657935.47
</float>
<float>
143
8008051.98
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_interface_test/PathTemplateItem/web_site_module/interface_test.xml
View file @
c60f541d
...
...
@@ -167,7 +167,7 @@
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
aggregate/web_page_module/
gadget_rjs_itest_index_html
</string>
<string>
aggregate/web_page_module/
interface_test_gadget
</string>
</tuple>
</value>
</item>
...
...
@@ -388,7 +388,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.3898
7.49759.34713
</string>
</value>
<value>
<string>
944.3898
8.2596.37649
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -406,7 +406,7 @@
</tuple>
<state>
<tuple>
<float>
143
7744722.3
7
</float>
<float>
143
8007850.4
7
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment