Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush Tiwari
erp5
Commits
da4dc611
Commit
da4dc611
authored
Jul 15, 2015
by
Vivek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
17f60efd
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
771 additions
and
28 deletions
+771
-28
bt5/erp5_web_rjs_interfacedemo/PathTemplateItem/web_page_module/gadget_interfacedemo_js.xml
...hTemplateItem/web_page_module/gadget_interfacedemo_js.xml
+20
-14
bt5/erp5_web_rjs_interfacedemo/PathTemplateItem/web_page_module/gadget_testgadget1_html.xml
...hTemplateItem/web_page_module/gadget_testgadget1_html.xml
+356
-0
bt5/erp5_web_rjs_interfacedemo/PathTemplateItem/web_page_module/gadget_testgadget1_js.xml
...athTemplateItem/web_page_module/gadget_testgadget1_js.xml
+358
-0
bt5/erp5_web_rjs_interfacedemo/PathTemplateItem/web_page_module/rjs_gadget_interfaces_js.xml
...TemplateItem/web_page_module/rjs_gadget_interfaces_js.xml
+34
-14
bt5/erp5_web_rjs_interfacedemo/bt/template_keep_last_workflow_history_only_path_list
...emo/bt/template_keep_last_workflow_history_only_path_list
+1
-0
bt5/erp5_web_rjs_interfacedemo/bt/template_keep_workflow_path_list
...web_rjs_interfacedemo/bt/template_keep_workflow_path_list
+1
-0
bt5/erp5_web_rjs_interfacedemo/bt/template_path_list
bt5/erp5_web_rjs_interfacedemo/bt/template_path_list
+1
-0
No files found.
bt5/erp5_web_rjs_interfacedemo/PathTemplateItem/web_page_module/gadget_interfacedemo_js.xml
View file @
da4dc611
...
...
@@ -144,27 +144,29 @@
return;\n
})\n
\n
.declareMethod("interfaceGadgetTest", function (gadget, interface_gadget, interface_list) {\n
.declareMethod("interfaceGadgetTest", function (gadget_url, interface_url) {\n
var gadget = this;\n
//temperoray hardcoded :\n
gadget_url = "https://softinst60317.host.vifib.net/erp5/web_site_module/interface_demo/gadget_testgadget1.html";\n
interface_url = "https://softinst60317.host.vifib.net/erp5/web_site_module/interface_demo/demo_interface1.html";\n
return new RSVP.Queue()\n
.push(function () {\n
return gadget.getDeclaredGadget(INTERFACE_GADGET_SCOPE);\n
})\n
.push(function (interface_gadget) {\n
var status_list = [],\n
key;\n
for (key in interface_list) {\n
status_list.push(interface_gadget.verifyInterfaceImplementation(gadget, interface_list[key]));\n
}\n
status_list.push(interface_gadget.verifyInterfaceImplementation(gadget_url, interface_url));\n
return RSVP.all(status_list);\n
})\n
.push(function (result_list) {\n
var parameter = {interface_item: []},\n
key,\n
i = 0;\n
for (key in interface_list) {\n
parameter.interface_item.push({\n
interface_name: interface_list[key], \n
status: (result_list[i] ? "Verified Success":"Verified Failure")\n
});\n
i += 1;\n
}\n
parameter.interface_item.push({\n
interface_name: interface_url, \n
status: (result_list[0] ? "Verified Success":"Verified Failure")\n
});\n
gadget.props.header_element.innerHTML = gadget.props.header_template({\n
title: "Interface List"\n
});\n
...
...
@@ -182,7 +184,7 @@
scope: INTERFACE_GADGET_SCOPE,\n
element: gadget.__element\n
});\n
})\n
/*
})\n
.push(function () {\n
return RSVP.all([\n
gadget.getDeclaredGadget(INTERFACE_GADGET_SCOPE),\n
...
...
@@ -193,6 +195,10 @@
var interface_gadget = interface_gadget_list[0],\n
interface_list = interface_gadget_list[1];\n
return gadget.interfaceGadgetTest(gadget, interface_gadget, interface_list);\n
*/\n
})\n
.push(function () {\n
return gadget.interfaceGadgetTest("dummyarg1", "dummyarg2");\n
});\n
});\n
\n
...
...
@@ -331,7 +337,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.2
3155.255.46643
</string>
</value>
<value>
<string>
944.2
6193.28667.62890
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -349,7 +355,7 @@
</tuple>
<state>
<tuple>
<float>
1436
795666.0
2
</float>
<float>
1436
977064.7
2
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_rjs_interfacedemo/PathTemplateItem/web_page_module/gadget_testgadget1_html.xml
0 → 100644
View file @
da4dc611
This diff is collapsed.
Click to expand it.
bt5/erp5_web_rjs_interfacedemo/PathTemplateItem/web_page_module/gadget_testgadget1_js.xml
0 → 100644
View file @
da4dc611
This diff is collapsed.
Click to expand it.
bt5/erp5_web_rjs_interfacedemo/PathTemplateItem/web_page_module/rjs_gadget_interfaces_js.xml
View file @
da4dc611
...
...
@@ -111,7 +111,6 @@
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n
*/\n
/*! @source https://gist.github.com/1129031 */\n
\n
(function (DOMParser) {\n
"use strict";\n
var DOMParser_proto = DOMParser.prototype,\n
...
...
@@ -152,6 +151,21 @@
/*jslint nomen: true, indent: 2, maxerr: 3 */\n
(function (window, rJS, Handlebars, $, RSVP, loopEventListener, DOMParser) {\n
"use strict";\n
\n
var VERIFY_GADGET_SCOPE = "verify_gadget";\n
\n
function getVerifyGadget(gadget_url, interface_gadget) {\n
return new RSVP.Queue()\n
.push(function () {\n
return interface_gadget.declareGadget(gadget_url, {\n
scope: VERIFY_GADGET_SCOPE,\n
element: interface_gadget.__element\n
});\n
})\n
.push(function () {\n
return interface_gadget.getDeclaredGadget(VERIFY_GADGET_SCOPE);\n
});\n
}\n
\n
function verifyInterfaceDefinition(interface_name) {\n
//to verify if interface definition follows the correct template.\n
...
...
@@ -170,9 +184,9 @@
} \n
try {\n
for (var i=0; i<method_len; i+=1) {\n
if ((!next_element || next_element.localName !==
"dt"
) ||\n
(!(next_element = next_element.nextElementSibling) || next_element.localName !==
"dd"
) ||\n
(!(next_element = next_element.nextElementSibling) || next_element.localName !==
"dl"
)) {\n
if ((!next_element || next_element.localName !==
\'dt\'
) ||\n
(!(next_element = next_element.nextElementSibling) || next_element.localName !==
\'dd\'
) ||\n
(!(next_element = next_element.nextElementSibling) || next_element.localName !==
\'dl\'
)) {\n
throw new Error("Interface Definition Incorrect.");\n
}\n
if(next_element.getElementsByTagName(\'dt\').length !== next_element.getElementsByTagName(\'dd\').length) {\n
...
...
@@ -181,8 +195,8 @@
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
if ((!next_child_element || next_child_element.localName !==
"dt"
) ||\n
(!(next_child_element = next_child_element.nextElementSibling) || next_child_element.localName !==
"dd"
)) {\n
if ((!next_child_element || next_child_element.localName !==
\'dt\'
) ||\n
(!(next_child_element = next_child_element.nextElementSibling) || next_child_element.localName !==
\'dd\'
)) {\n
throw new Error("Interface Definition Incorrect.");\n
}\n
next_child_element = next_child_element.nextElementSibling;\n
...
...
@@ -212,11 +226,11 @@
return defer.promise;\n
}\n
\n
function verifyAllMethod
s
(interface_method_list, gadget_method_list) {\n
function verifyAllMethod(interface_method_list, gadget_method_list) {\n
var defer = RSVP.defer();\n
return RSVP.Queue()\n
.push(function() {\n
return verifyAllMethod
s
Declared(interface_method_list, gadget_method_list);\n
return verifyAllMethodDeclared(interface_method_list, gadget_method_list);\n
})\n
.push(function() {\n
return verifyAllMethodsSignature(interface_method_list, gadget_method_list);\n
...
...
@@ -230,7 +244,7 @@
});\n
}\n
\n
function verifyAllMethod
s
Declared(interface_method_list, gadget_method_list) {\n
function verifyAllMethodDeclared(interface_method_list, gadget_method_list) {\n
//to verify if all the interface methods are declared by the gadget.\n
var defer = RSVP.defer(),\n
gadget_method_name_list = [],\n
...
...
@@ -253,7 +267,7 @@
}\n
return
defer.promise;\n
}\n
\n
\n
function
verifyAllMethodsSignature(interface_method_list,
gadget_method_list)
{\n
//to
verify
if
all
the
declared
methods
match
the
signature
of
the
interface
methods.\n
var
defer =
RSVP.defer(),\n
...
...
@@ -358,26 +372,32 @@
});\n
})\n
\n
.declareMethod("verifyInterfaceImplementation",
function
(gadget,
interface_name)
{\n
.declareMethod("verifyInterfaceImplementation",
function
(gadget
_url
,
interface_name)
{\n
var
interface_gadget =
this;\n
return
RSVP.Queue()\n
.push(function
()
{\n
return
verifyInterfaceDefinition(interface_name);\n
})\n
.push(function
()
{\n
return
getVerifyGadget(gadget_url,
interface_gadget);\n
})\n
.push(function
(gadget)
{\n
return
interface_gadget.getDeclaredGadgetInterfaces(gadget);\n
})\n
.push(function
(declared_interface_list)
{\n
return
verifyInterfaceDeclaration(interface_name,
declared_interface_list);\n
})\n
.push(function
()
{\n
return
getVerifyGadget(gadget_url,
interface_gadget);\n
})\n
.push(function
(gadget)
{\n
return
RSVP.all([\n
interface_gadget.getDefinedInterfaceMethods(interface_name),\n
interface_gadget.getDeclaredGadgetMethods(gadget)\n
]);\n
})\n
.push(function(method_list)
{\n
return
verifyAllMethod
s
(method_list[0],
method_list[1]);\n
return
verifyAllMethod(method_list[0],
method_list[1]);\n
})\n
.push
(function()
{\n
console.log("Verified
:
Success");\n
...
...
@@ -525,7 +545,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.2
3277.56085.50961
</string>
</value>
<value>
<string>
944.2
6103.31340.29354
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -543,7 +563,7 @@
</tuple>
<state>
<tuple>
<float>
1436
802159.16
</float>
<float>
1436
973571.38
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_rjs_interfacedemo/bt/template_keep_last_workflow_history_only_path_list
View file @
da4dc611
web_page_module/gadget_interface**
web_page_module/demo_interface**
web_page_module/rjs_gadget_interface**
web_page_module/gadget_testgadget**
web_site_module/interface_demo
\ No newline at end of file
bt5/erp5_web_rjs_interfacedemo/bt/template_keep_workflow_path_list
View file @
da4dc611
web_page_module/gadget_interface**
web_page_module/demo_interface**
web_page_module/rjs_gadget_interface**
web_page_module/gadget_testgadget**
web_site_module/interface_demo
\ No newline at end of file
bt5/erp5_web_rjs_interfacedemo/bt/template_path_list
View file @
da4dc611
web_page_module/demo_interface*
web_page_module/gadget_interface*
web_page_module/gadget_testgadget*
web_page_module/rjs_gadget_interface*
web_site_module/interface_demo
web_site_module/interface_demo/**
\ No newline at end of file
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