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
c677314d
Commit
c677314d
authored
Nov 20, 2015
by
Vivek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gadget_interface_validator: implemented panel and router interface.
parent
5ddeeee4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
92 additions
and
65 deletions
+92
-65
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_validator_page_report_js.xml
...page_module/gadget_interface_validator_page_report_js.xml
+79
-56
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_validator_panel_html.xml
...web_page_module/gadget_interface_validator_panel_html.xml
+5
-3
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_validator_router_html.xml
...eb_page_module/gadget_interface_validator_router_html.xml
+5
-3
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_validator_router_js.xml
.../web_page_module/gadget_interface_validator_router_js.xml
+3
-3
No files found.
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_validator_page_report_js.xml
View file @
c677314d
...
@@ -107,41 +107,6 @@
...
@@ -107,41 +107,6 @@
"use strict";\n
"use strict";\n
\n
\n
var INTERFACE_GADGET_SCOPE = "interface_gadget";\n
var INTERFACE_GADGET_SCOPE = "interface_gadget";\n
\n
function renderInitialReport(gadget, gadget_list) {\n
var gadget_info_list = [],\n
row_list = [],\n
column_list = [\'Gadget Name\', \'Declared Interfaces\', \'Validation Status\'],\n
cell_list,\n
default_status = "In Progress",\n
content = \'\',\n
item;\n
for(item in gadget_list) {\n
cell_list = [];\n
cell_list.push({\n
default_class: "gadget_name",\n
value: gadget_list[item]\n
});\n
cell_list.push({\n
default_class: "interface_list",\n
value: default_status\n
});\n
cell_list.push({\n
default_class: "validation_status",\n
value: default_status\n
});\n
row_list.push({\n
"cell_list": cell_list,\n
"default_id": gadget_list[item].substr(0, gadget_list[item].indexOf(\'.\'))\n
});\n
}\n
content += report_widget_table({\n
column_list: column_list,\n
row_list: row_list\n
});\n
gadget.props.content_element.innerHTML = content;\n
$(gadget.props.element).trigger("create");\n
}\n
\n
\n
function validateAppGadgetList(gadget, gadget_list){\n
function validateAppGadgetList(gadget, gadget_list){\n
var item;\n
var item;\n
...
@@ -171,7 +136,7 @@
...
@@ -171,7 +136,7 @@
function verifyGadgetImplementation(gadget, verify_gadget_url) {\n
function verifyGadgetImplementation(gadget, verify_gadget_url) {\n
var interface_gadget,\n
var interface_gadget,\n
interface_list = [],\n
interface_list = [],\n
default_validation_status = {result:"N/A"};\n
default_validation_status = {result:"N/A"
, result_message: "N/A"
};\n
return new RSVP.Queue()\n
return new RSVP.Queue()\n
.push(function() {\n
.push(function() {\n
return gadget.getDeclaredGadget(INTERFACE_GADGET_SCOPE);\n
return gadget.getDeclaredGadget(INTERFACE_GADGET_SCOPE);\n
...
@@ -218,11 +183,14 @@
...
@@ -218,11 +183,14 @@
if(report_data.validation_status === true) {\n
if(report_data.validation_status === true) {\n
validation_status = "Success";\n
validation_status = "Success";\n
update_element.setAttribute(\'style\', \'color: green\');\n
update_element.setAttribute(\'style\', \'color: green\');\n
}\n
}
else {
\n
if(report_data.validation_status === false) {\n
//
if(report_data.validation_status === false) {\n
validation_status = (validation_message !== undefined? validation_message : "Failure");\n
validation_status = (validation_message !== undefined? validation_message : "Failure");\n
update_element.setAttribute(\'style\', \'cursor: pointer; color: red\');\n
update_element.setAttribute(\'style\', \'color: red\');\n
update_element.className += "error expand";\n
if(report_data.validation_status === false) {\n
update_element.className += "error expand";\n
update_element.setAttribute(\'style\', \'cursor: pointer; color: red\');\n
}\n
}\n
}\n
gadget.props.error_data[report_data.id] = report_data.error_detail;\n
gadget.props.error_data[report_data.id] = report_data.error_detail;\n
update_element.querySelector(".validation_status").innerHTML = validation_status;\n
update_element.querySelector(".validation_status").innerHTML = validation_status;\n
...
@@ -282,21 +250,17 @@
...
@@ -282,21 +250,17 @@
\n
\n
.declareMethod("render", function (options) {\n
.declareMethod("render", function (options) {\n
var gadget = this,\n
var gadget = this,\n
appcache_url = options.appcache_url,\n
report_data;\n
gadget_list;\n
return new RSVP.Queue()\n
return new RSVP.Queue()\n
.push(function() {\n
.push(function() {\n
return gadget.getDeclaredGadget(INTERFACE_GADGET_SCOPE);\n
return gadget.generateInitialReportData(options);\n
})\n
.push(function(interface_gadget) {\n
return interface_gadget.getGadgetListFromAppcache(appcache_url);\n
})\n
})\n
.push(function(
filtered_
gadget_list) {\n
.push(function(gadget_list) {\n
gadget_list = filtered_gadget_list
;\n
report_data = {\'gadget_list\': gadget_list}
;\n
return
renderInitialReport(gadget, gadget_list
);\n
return
gadget.renderInitialReport(report_data
);\n
})\n
})\n
.push(function() {\n
.push(function() {\n
return
validateAppGadgetList(gadget, gadget_list
);\n
return
gadget.renderFinalReport(report_data
);\n
}, function(error) {\n
}, function(error) {\n
return gadget.redirect({\n
return gadget.redirect({\n
found: false\n
found: false\n
...
@@ -304,10 +268,69 @@
...
@@ -304,10 +268,69 @@
});\n
});\n
})\n
})\n
\n
\n
.declareMethod("reportPageDummyMethod1", function(param1) {\n
.declareMethod("generateInitialReportData", function(options) {\n
// A dummy method to fulfil the interface implementation requirement.\n
var gadget = this,\n
return;\n
appcache_url = options.appcache_url;\n
return new RSVP.Queue()\n
.push(function() {\n
return gadget.getDeclaredGadget(INTERFACE_GADGET_SCOPE);\n
})\n
.push(function(interface_gadget) {\n
return interface_gadget.getGadgetListFromAppcache(appcache_url);\n
})\n
.push(function(filtered_gadget_list) {\n
gadget.props.gadget_list = filtered_gadget_list;\n
return filtered_gadget_list;\n
});\n
})\n
\n
.declareMethod("renderInitialReport", function(options) {\n
var gadget = this,\n
gadget_list = options.gadget_list, \n
gadget_info_list = [],\n
row_list = [],\n
column_list = [\'Gadget Name\', \'Declared Interfaces\', \'Validation Status\'],\n
cell_list,\n
default_status = "In Progress",\n
content = \'\',\n
item;\n
for(item in gadget_list) {\n
cell_list = [];\n
cell_list.push({\n
default_class: "gadget_name",\n
value: gadget_list[item]\n
});\n
cell_list.push({\n
default_class: "interface_list",\n
value: default_status\n
});\n
cell_list.push({\n
default_class: "validation_status",\n
value: default_status\n
});\n
row_list.push({\n
"cell_list": cell_list,\n
"default_id": gadget_list[item].substr(0, gadget_list[item].indexOf(\'.\'))\n
});\n
}\n
content += report_widget_table({\n
column_list: column_list,\n
row_list: row_list\n
});\n
gadget.props.content_element.innerHTML = content;\n
$(gadget.props.element).trigger("create");\n
})\n
})\n
\n
.declareMethod("renderFinalReport", function(options) {\n
var gadget = this,\n
gadget_list = options.gadget_list;\n
return new RSVP.Queue()\n
.push(function() {\n
return validateAppGadgetList(gadget, gadget_list);\n
});\n
\n
})\n
\n
/////////////////////////////////////////////////////////////////\n
/////////////////////////////////////////////////////////////////\n
// Acquired methods\n
// Acquired methods\n
/////////////////////////////////////////////////////////////////\n
/////////////////////////////////////////////////////////////////\n
...
@@ -472,7 +495,7 @@
...
@@ -472,7 +495,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
6.54878.32293.23654
</string>
</value>
<value>
<string>
94
7.13944.52291.15803
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -490,8 +513,8 @@
...
@@ -490,8 +513,8 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
144
6717974.43
</float>
<float>
144
7953184.15
</float>
<string>
UTC
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
</object>
</object>
...
...
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_validator_panel_html.xml
View file @
c677314d
...
@@ -109,6 +109,8 @@
...
@@ -109,6 +109,8 @@
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
/>
\n
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
/>
\n
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no"
/>
\n
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no"
/>
\n
<title>
Gadget Interface Validator Panel
</title>
\n
<title>
Gadget Interface Validator Panel
</title>
\n
\n
<link
rel=
"http://www.renderjs.org/rel/interface"
href=
"gadget_interface_validator_interface_panel.html"
/>
\n
\n
\n
<!-- renderjs -->
\n
<!-- renderjs -->
\n
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
\n
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
\n
...
@@ -289,7 +291,7 @@
...
@@ -289,7 +291,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
6.54879.52570.13994
</string>
</value>
<value>
<string>
94
7.9498.60930.44168
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -307,8 +309,8 @@
...
@@ -307,8 +309,8 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
144
6805712.99
</float>
<float>
144
7996310.51
</float>
<string>
UTC
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
</object>
</object>
...
...
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_validator_router_html.xml
View file @
c677314d
...
@@ -111,6 +111,8 @@
...
@@ -111,6 +111,8 @@
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
/>
\n
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
/>
\n
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no"
/>
\n
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no"
/>
\n
<title>
Gadget Interface Validator Router
</title>
\n
<title>
Gadget Interface Validator Router
</title>
\n
\n
<link
rel=
"http://www.renderjs.org/rel/interface"
href=
"gadget_interface_validator_interface_router.html"
/>
\n
\n
\n
<!-- renderjs -->
\n
<!-- renderjs -->
\n
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
\n
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
\n
...
@@ -260,7 +262,7 @@
...
@@ -260,7 +262,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
6.44766.54929.30600
</string>
</value>
<value>
<string>
94
7.9498.60930.44168
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -278,8 +280,8 @@
...
@@ -278,8 +280,8 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
144
6476270.36
</float>
<float>
144
7996304.28
</float>
<string>
UTC
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
</object>
</object>
...
...
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_validator_router_js.xml
View file @
c677314d
...
@@ -345,7 +345,7 @@
...
@@ -345,7 +345,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
6.58912.52724.48776
</string>
</value>
<value>
<string>
94
7.14517.45318.16230
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -363,8 +363,8 @@
...
@@ -363,8 +363,8 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
144
6805302.57
</float>
<float>
144
7986581.85
</float>
<string>
UTC
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
</object>
</object>
...
...
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