[commons-dev] Improvements to adminui javascript/AJAX library
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi All,
With the current discussion going on the development of Mashup server
and looking at the tools available in Yahoo (YUI), Google (GWT) etc, and
more usage of WSO2Commons adminui's Javascript/AJAX library, we have
come across with the following problems and improvements to
Javascript/AJAX library.
WSO2 Commons Adminui project contains the Javascript/AJAX
library.[https://wso2.org/repos/wso2/trunk/commons]
Adminui's base javascript functionalities are written in the "main.js".
All the functions available in this javascript has been written as pure
functions. Thus, one could use the function say, foo(args..) without any
association with objects. Since this is a base library, an implementor
might have his js that would have the same method say foo(args2..), with
different arguments. Thus, at runtime, if user uses foo(), theres no
guarantee, which foo() is gonna select by runtime.
Thus, we propose the following architecture for our adminui
Javascrtip/AJAX library.
As we expect this library to be used widely, We should be writing this
functions relative to a custom object. So, we propose the object name
should be WSO2. Apart from that as these functions are "common",
everything should be associated with "WSO2.common".
So, the implementation is as follows,
=======================================================================
WSO2.common = {
var xmlHttpRequest, //global variables
send: function(operationName, bodyXML, xslFileName, callURL, objDiv,
loginMethod, callBack) {// impl}, // send function
onError: function() {// impl}, // onError function
_split: function(obj) {// impl}, // split function
... // Other functions
}
========================================================================
Thus, user has do the following to execute a function, ex: executing of
send() function,
WSO2.common.send('foo',someXML,xslFile,url,divObj,false,sendCallback);
As such the above will not cause any unnecessary complications.
We will follow the Java coding standard. As there is no way to represent
a "private" function, we should use "_", thus, _foo() is a private
function. Most of the Javascript libraries follow this standard.
In addition to this, above object should be implemented in
js/common/common.js rather at main.js.
With above proposal, we could simply switch between either to use Raw
AJAX or WSReques.js to communicate with server.
Please be kind enough to send your consensus on this.
If all permits, I would like to volunteer to do the refactoring, and
help to update other projects.
Thank you
Saminda
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFF8B/5YmklbLuW6wYRAlEVAJ9N3U3vbT46ow2+b4QWlPjnPSgkLgCeOMAh
lhDO1ogXGsPVxDDPIL2gxdU=
=eHaY
-----END PGP SIGNATURE-----
_______________________________________________
Commons-dev mailing list
Commons-dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/commons-dev
- Login or register to post comments
- Printer friendly version
- 822 reads










[commons-dev] Improvements to adminui javascript/AJAX library
saminda abeyruwan wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi All,
>
> With the current discussion going on the development of Mashup server
> and looking at the tools available in Yahoo (YUI), Google (GWT) etc, and
> more usage of WSO2Commons adminui's Javascript/AJAX library, we have
> come across with the following problems and improvements to
> Javascript/AJAX library.
>
> WSO2 Commons Adminui project contains the Javascript/AJAX
> library.[https://wso2.org/repos/wso2/trunk/commons]
>
> Adminui's base javascript functionalities are written in the "main.js".
> All the functions available in this javascript has been written as pure
> functions. Thus, one could use the function say, foo(args..) without any
> association with objects. Since this is a base library, an implementor
> might have his js that would have the same method say foo(args2..), with
> different arguments. Thus, at runtime, if user uses foo(), theres no
> guarantee, which foo() is gonna select by runtime.
>
> Thus, we propose the following architecture for our adminui
> Javascrtip/AJAX library.
>
> As we expect this library to be used widely, We should be writing this
> functions relative to a custom object. So, we propose the object name
> should be WSO2. Apart from that as these functions are "common",
> everything should be associated with "WSO2.common".
>
> So, the implementation is as follows,
>
> =======================================================================
>
> WSO2.common = {
>
> var xmlHttpRequest, //global variables
>
> send: function(operationName, bodyXML, xslFileName, callURL, objDiv,
> loginMethod, callBack) {// impl}, // send function
>
> onError: function() {// impl}, // onError function
>
> _split: function(obj) {// impl}, // split function
>
> ... // Other functions
>
>
> }
>
> ========================================================================
>
> Thus, user has do the following to execute a function, ex: executing of
> send() function,
>
>
> WSO2.common.send('foo',someXML,xslFile,url,divObj,false,sendCallback);
>
> As such the above will not cause any unnecessary complications.
>
+1 for this. I also was thinking of this complication issue when I was
doing a POC, for example we have a show() method in the esb root.js
which conflicts with a YUI show() method. In this kind of complication
the normal behavior of javascript is that it neither execute none of the
methods nor throw errors to the console, it just stuck, and stop execution.
So I think not even for the adminui, but also for wsas and esb specific
javascript also should be qualified with the WSO2 name. For example our
root.js show method should be qualified as WSO2.esb.show() and so on.
> We will follow the Java coding standard. As there is no way to represent
> a "private" function, we should use "_", thus, _foo() is a private
> function. Most of the Javascript libraries follow this standard.
>
> In addition to this, above object should be implemented in
> js/common/common.js rather at main.js.
>
> With above proposal, we could simply switch between either to use Raw
> AJAX or WSReques.js to communicate with server.
>
> Please be kind enough to send your consensus on this.
>
+1. No concerns. This is good and we need this.
> If all permits, I would like to volunteer to do the refactoring, and
> help to update other projects.
>
> Thank you
>
> Saminda
>
>
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFF8B/5YmklbLuW6wYRAlEVAJ9N3U3vbT46ow2+b4QWlPjnPSgkLgCeOMAh
> lhDO1ogXGsPVxDDPIL2gxdU=
> =eHaY
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Commons-dev mailing list
> Commons-dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/commons-dev
>
>
_______________________________________________
Commons-dev mailing list
Commons-dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/commons-dev
[esb-java-dev] [commons-dev] Improvements to adminui javascript
saminda abeyruwan wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi All,
>
> With the current discussion going on the development of Mashup server
> and looking at the tools available in Yahoo (YUI), Google (GWT) etc, and
> more usage of WSO2Commons adminui's Javascript/AJAX library, we have
> come across with the following problems and improvements to
> Javascript/AJAX library.
>
> WSO2 Commons Adminui project contains the Javascript/AJAX
> library.[https://wso2.org/repos/wso2/trunk/commons]
>
> Adminui's base javascript functionalities are written in the "main.js".
> All the functions available in this javascript has been written as pure
> functions. Thus, one could use the function say, foo(args..) without any
> association with objects. Since this is a base library, an implementor
> might have his js that would have the same method say foo(args2..), with
> different arguments. Thus, at runtime, if user uses foo(), theres no
> guarantee, which foo() is gonna select by runtime.
>
> Thus, we propose the following architecture for our adminui
> Javascrtip/AJAX library.
>
> As we expect this library to be used widely, We should be writing this
> functions relative to a custom object. So, we propose the object name
> should be WSO2. Apart from that as these functions are "common",
> everything should be associated with "WSO2.common".
>
> So, the implementation is as follows,
>
> =======================================================================
>
> WSO2.common = {
>
> var xmlHttpRequest, //global variables
>
> send: function(operationName, bodyXML, xslFileName, callURL, objDiv,
> loginMethod, callBack) {// impl}, // send function
>
> onError: function() {// impl}, // onError function
>
> _split: function(obj) {// impl}, // split function
>
> ... // Other functions
>
>
> }
>
> ========================================================================
>
> Thus, user has do the following to execute a function, ex: executing of
> send() function,
>
>
> WSO2.common.send('foo',someXML,xslFile,url,divObj,false,sendCallback);
>
> As such the above will not cause any unnecessary complications.
>
+1 for this. I also was thinking of this complication issue when I was
doing a POC, for example we have a show() method in the esb root.js
which conflicts with a YUI show() method. In this kind of complication
the normal behavior of javascript is that it neither execute none of the
methods nor throw errors to the console, it just stuck, and stop execution.
So I think not even for the adminui, but also for wsas and esb specific
javascript also should be qualified with the WSO2 name. For example our
root.js show method should be qualified as WSO2.esb.show() and so on.
> We will follow the Java coding standard. As there is no way to represent
> a "private" function, we should use "_", thus, _foo() is a private
> function. Most of the Javascript libraries follow this standard.
>
> In addition to this, above object should be implemented in
> js/common/common.js rather at main.js.
>
> With above proposal, we could simply switch between either to use Raw
> AJAX or WSReques.js to communicate with server.
>
> Please be kind enough to send your consensus on this.
>
+1. No concerns. This is good and we need this.
> If all permits, I would like to volunteer to do the refactoring, and
> help to update other projects.
>
> Thank you
>
> Saminda
>
>
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFF8B/5YmklbLuW6wYRAlEVAJ9N3U3vbT46ow2+b4QWlPjnPSgkLgCeOMAh
> lhDO1ogXGsPVxDDPIL2gxdU=
> =eHaY
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Commons-dev mailing list
> Commons-dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/commons-dev
>
>
_______________________________________________
Esb-java-dev mailing list
Esb-java-dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev
[wsas-java-dev] [commons-dev] Improvements to adminui javascrip
saminda abeyruwan wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi All,
>
> With the current discussion going on the development of Mashup server
> and looking at the tools available in Yahoo (YUI), Google (GWT) etc, and
> more usage of WSO2Commons adminui's Javascript/AJAX library, we have
> come across with the following problems and improvements to
> Javascript/AJAX library.
>
> WSO2 Commons Adminui project contains the Javascript/AJAX
> library.[https://wso2.org/repos/wso2/trunk/commons]
>
> Adminui's base javascript functionalities are written in the "main.js".
> All the functions available in this javascript has been written as pure
> functions. Thus, one could use the function say, foo(args..) without any
> association with objects. Since this is a base library, an implementor
> might have his js that would have the same method say foo(args2..), with
> different arguments. Thus, at runtime, if user uses foo(), theres no
> guarantee, which foo() is gonna select by runtime.
>
> Thus, we propose the following architecture for our adminui
> Javascrtip/AJAX library.
>
> As we expect this library to be used widely, We should be writing this
> functions relative to a custom object. So, we propose the object name
> should be WSO2. Apart from that as these functions are "common",
> everything should be associated with "WSO2.common".
>
> So, the implementation is as follows,
>
> =======================================================================
>
> WSO2.common = {
>
> var xmlHttpRequest, //global variables
>
> send: function(operationName, bodyXML, xslFileName, callURL, objDiv,
> loginMethod, callBack) {// impl}, // send function
>
> onError: function() {// impl}, // onError function
>
> _split: function(obj) {// impl}, // split function
>
> ... // Other functions
>
>
> }
>
> ========================================================================
>
> Thus, user has do the following to execute a function, ex: executing of
> send() function,
>
>
> WSO2.common.send('foo',someXML,xslFile,url,divObj,false,sendCallback);
>
> As such the above will not cause any unnecessary complications.
>
+1 for this. I also was thinking of this complication issue when I was
doing a POC, for example we have a show() method in the esb root.js
which conflicts with a YUI show() method. In this kind of complication
the normal behavior of javascript is that it neither execute none of the
methods nor throw errors to the console, it just stuck, and stop execution.
So I think not even for the adminui, but also for wsas and esb specific
javascript also should be qualified with the WSO2 name. For example our
root.js show method should be qualified as WSO2.esb.show() and so on.
> We will follow the Java coding standard. As there is no way to represent
> a "private" function, we should use "_", thus, _foo() is a private
> function. Most of the Javascript libraries follow this standard.
>
> In addition to this, above object should be implemented in
> js/common/common.js rather at main.js.
>
> With above proposal, we could simply switch between either to use Raw
> AJAX or WSReques.js to communicate with server.
>
> Please be kind enough to send your consensus on this.
>
+1. No concerns. This is good and we need this.
> If all permits, I would like to volunteer to do the refactoring, and
> help to update other projects.
>
> Thank you
>
> Saminda
>
>
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFF8B/5YmklbLuW6wYRAlEVAJ9N3U3vbT46ow2+b4QWlPjnPSgkLgCeOMAh
> lhDO1ogXGsPVxDDPIL2gxdU=
> =eHaY
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Commons-dev mailing list
> Commons-dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/commons-dev
>
>
_______________________________________________
Wsas-java-dev mailing list
Wsas-java-dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/wsas-java-dev
[commons-dev] Improvements to adminui javascript/AJAX library
I'm -1 on this.
I'd like to switch to using the WSClient API that we're advocating as a
good API for Javascript Web services. We didn't use it in WSAS because the
WSAS stuff predates WSClient. However if we're doing a change like this
I'd like to move straight to WSClient.
We should make sure the WSClient uses a proper namespace to avoid the
problems that we're noticing now with WSAS!
Sanjiva.
saminda abeyruwan wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi All,
>
> With the current discussion going on the development of Mashup server
> and looking at the tools available in Yahoo (YUI), Google (GWT) etc, and
> more usage of WSO2Commons adminui's Javascript/AJAX library, we have
> come across with the following problems and improvements to
> Javascript/AJAX library.
>
> WSO2 Commons Adminui project contains the Javascript/AJAX
> library.[https://wso2.org/repos/wso2/trunk/commons]
>
> Adminui's base javascript functionalities are written in the "main.js".
> All the functions available in this javascript has been written as pure
> functions. Thus, one could use the function say, foo(args..) without any
> association with objects. Since this is a base library, an implementor
> might have his js that would have the same method say foo(args2..), with
> different arguments. Thus, at runtime, if user uses foo(), theres no
> guarantee, which foo() is gonna select by runtime.
>
> Thus, we propose the following architecture for our adminui
> Javascrtip/AJAX library.
>
> As we expect this library to be used widely, We should be writing this
> functions relative to a custom object. So, we propose the object name
> should be WSO2. Apart from that as these functions are "common",
> everything should be associated with "WSO2.common".
>
> So, the implementation is as follows,
>
> =======================================================================
>
> WSO2.common = {
>
> var xmlHttpRequest, //global variables
>
> send: function(operationName, bodyXML, xslFileName, callURL, objDiv,
> loginMethod, callBack) {// impl}, // send function
>
> onError: function() {// impl}, // onError function
>
> _split: function(obj) {// impl}, // split function
>
> ... // Other functions
>
>
> }
>
> ========================================================================
>
> Thus, user has do the following to execute a function, ex: executing of
> send() function,
>
>
> WSO2.common.send('foo',someXML,xslFile,url,divObj,false,sendCallback);
>
> As such the above will not cause any unnecessary complications.
>
> We will follow the Java coding standard. As there is no way to represent
> a "private" function, we should use "_", thus, _foo() is a private
> function. Most of the Javascript libraries follow this standard.
>
> In addition to this, above object should be implemented in
> js/common/common.js rather at main.js.
>
> With above proposal, we could simply switch between either to use Raw
> AJAX or WSReques.js to communicate with server.
>
> Please be kind enough to send your consensus on this.
>
> If all permits, I would like to volunteer to do the refactoring, and
> help to update other projects.
>
> Thank you
>
> Saminda
>
>
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFF8B/5YmklbLuW6wYRAlEVAJ9N3U3vbT46ow2+b4QWlPjnPSgkLgCeOMAh
> lhDO1ogXGsPVxDDPIL2gxdU=
> =eHaY
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Commons-dev mailing list
> Commons-dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/commons-dev
>
--
Sanjiva Weerawarana, Ph.D.
Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
email: sanjiva@wso2.com; cell: +94 77 787 6880; fax: +1 509 691 2000
"Oxygenating the Web Service Platform."
_______________________________________________
Commons-dev mailing list
Commons-dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/commons-dev
[commons-dev] Improvements to adminui javascript/AJAX library
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Sir,
I believe you are referring prior to WSRequest.js. The simplest solution
would be to start with native/WSRequest.js.
We propose that main.js contains functions related to a namespace
"WSO2.common", (ex: WSO2.common.send(args...)) will solve the namespace
issue.
As an example, WSO2.common.send(args...) is the wrapper function that
uses WSRequest functionality to communicate with server. This is our
original plan and we were waiting for a release of WSRequest to achieve
this.
There could be another send() in the namespace of "WSO2.wsas". Thus, we
could simply create an object of WSO2.wsas and call send() function.
(i.e WSO2.wsas.send(args..)).
In addition to this we could give another util function in main.js,
WSO2.namespace(obj); that will create the object with proper namespace.
Ex:
WSO2.namespace('org.wso2.foo'); will create an Object =>
WSO2.org.wso2.foo. Thus, user can simply implement his functions,
without any namespace collisions.
In this mode, WSRequest itself dosen't have to aware of its namespace.
Thank you
Saminda
Sanjiva Weerawarana wrote:
> I'm -1 on this.
>
> I'd like to switch to using the WSClient API that we're advocating as a
> good API for Javascript Web services. We didn't use it in WSAS because
> the WSAS stuff predates WSClient. However if we're doing a change like
> this I'd like to move straight to WSClient.
>
> We should make sure the WSClient uses a proper namespace to avoid the
> problems that we're noticing now with WSAS!
>
> Sanjiva.
>
> saminda abeyruwan wrote:
> Hi All,
>
> With the current discussion going on the development of Mashup server
> and looking at the tools available in Yahoo (YUI), Google (GWT) etc, and
> more usage of WSO2Commons adminui's Javascript/AJAX library, we have
> come across with the following problems and improvements to
> Javascript/AJAX library.
>
> WSO2 Commons Adminui project contains the Javascript/AJAX
> library.[https://wso2.org/repos/wso2/trunk/commons]
>
> Adminui's base javascript functionalities are written in the "main.js".
> All the functions available in this javascript has been written as pure
> functions. Thus, one could use the function say, foo(args..) without any
> association with objects. Since this is a base library, an implementor
> might have his js that would have the same method say foo(args2..), with
> different arguments. Thus, at runtime, if user uses foo(), theres no
> guarantee, which foo() is gonna select by runtime.
>
> Thus, we propose the following architecture for our adminui
> Javascrtip/AJAX library.
>
> As we expect this library to be used widely, We should be writing this
> functions relative to a custom object. So, we propose the object name
> should be WSO2. Apart from that as these functions are "common",
> everything should be associated with "WSO2.common".
>
> So, the implementation is as follows,
>
> =======================================================================
>
> WSO2.common = {
>
> var xmlHttpRequest, //global variables
>
> send: function(operationName, bodyXML, xslFileName, callURL, objDiv,
> loginMethod, callBack) {// impl}, // send function
>
> onError: function() {// impl}, // onError function
>
> _split: function(obj) {// impl}, // split function
>
> ... // Other functions
>
>
> }
>
> ========================================================================
>
> Thus, user has do the following to execute a function, ex: executing of
> send() function,
>
>
> WSO2.common.send('foo',someXML,xslFile,url,divObj,false,sendCallback);
>
> As such the above will not cause any unnecessary complications.
>
> We will follow the Java coding standard. As there is no way to represent
> a "private" function, we should use "_", thus, _foo() is a private
> function. Most of the Javascript libraries follow this standard.
>
> In addition to this, above object should be implemented in
> js/common/common.js rather at main.js.
>
> With above proposal, we could simply switch between either to use Raw
> AJAX or WSReques.js to communicate with server.
>
> Please be kind enough to send your consensus on this.
>
> If all permits, I would like to volunteer to do the refactoring, and
> help to update other projects.
>
> Thank you
>
> Saminda
>
>
>
>
>
>>
_______________________________________________
Commons-dev mailing list
Commons-dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/commons-dev
>>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFF8Q7NYmklbLuW6wYRAjWBAJ9juBTVPhByJXYbNvh8GM4JHYswFQCeNuhA
wXg0sqMbd4IgOg52VBFczDE=
=QB0g
-----END PGP SIGNATURE-----
_______________________________________________
Commons-dev mailing list
Commons-dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/commons-dev
[commons-dev] Improvements to adminui javascript/AJAX library
I'm confused.
> I believe you are referring prior to WSRequest.js. The simplest solution
> would be to start with native/WSRequest.js.
I'm referring to the stuff at
http://wso2.org/repos/wso2/trunk/wsf/javascript/native/. I think you meant
the same right?
> We propose that main.js contains functions related to a namespace
> "WSO2.common", (ex: WSO2.common.send(args...)) will solve the namespace
> issue.
+1 but IMO it should be wso2.wsf.
> As an example, WSO2.common.send(args...) is the wrapper function that
> uses WSRequest functionality to communicate with server. This is our
> original plan and we were waiting for a release of WSRequest to achieve
> this.
No I disagree- if there's a need to wrap WSRequest then we haven't got
WSRequest right. What is preventing you from doing
foo=new wso2.wsf.WSRequest()
and then using the methods of foo? Let's fix those problems so you can use
it directly.
THILINA/JONATHAN: are you guys using that in the mashup server??
If folks aren't using it then the code is no good and we must fix it.
> There could be another send() in the namespace of "WSO2.wsas". Thus, we
> could simply create an object of WSO2.wsas and call send() function.
> (i.e WSO2.wsas.send(args..)).
>
> In addition to this we could give another util function in main.js,
>
> WSO2.namespace(obj); that will create the object with proper namespace.
>
> Ex:
>
> WSO2.namespace('org.wso2.foo'); will create an Object =>
> WSO2.org.wso2.foo. Thus, user can simply implement his functions,
> without any namespace collisions.
>
> In this mode, WSRequest itself dosen't have to aware of its namespace.
I don't quite grok- that all seems weird and overly complex to me .. all
that's needed is to put WSRequest in a namespace to avoid collisions. Why
do we need to go beyond that?
Thanks,
Sanjiva.
--
Sanjiva Weerawarana, Ph.D.
Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
email: sanjiva@wso2.com; cell: +94 77 787 6880; fax: +1 509 691 2000
"Oxygenating the Web Service Platform."
_______________________________________________
Commons-dev mailing list
Commons-dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/commons-dev
[commons-dev] Improvements to adminui javascript/AJAX library
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Sir,
Yes Sir, it's the same code in
http://wso2.org/repos/wso2/trunk/wsf/javascript/native/ we are referring
to.
>
>> I believe you are referring prior to WSRequest.js. The simplest solution
>> would be to start with native/WSRequest.js.
>
> I'm referring to the stuff at
> http://wso2.org/repos/wso2/trunk/wsf/javascript/native/. I think you
> meant the same right?
>
>> We propose that main.js contains functions related to a namespace
>> "WSO2.common", (ex: WSO2.common.send(args...)) will solve the namespace
>> issue.
>
> +1 but IMO it should be wso2.wsf.
main.js reside under commons/adminui project.
[https://wso2.org/repos/wso2/trunk/commons/adminui]. Should we use
"wso2.wsf" namespace for this too.
>
>> As an example, WSO2.common.send(args...) is the wrapper function that
>> uses WSRequest functionality to communicate with server. This is our
>> original plan and we were waiting for a release of WSRequest to achieve
>> this.
>
> No I disagree- if there's a need to wrap WSRequest then we haven't got
> WSRequest right. What is preventing you from doing
> foo=new wso2.wsf.WSRequest()
+1.
Should we do this to XPI and ActiveX Object too, namespace qualifying
WSRequest object.
Thank you
Saminda
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFF9PPAYmklbLuW6wYRAg77AKC60u7ghQ5rn/zN9jN2SFiipeySDACdE+K0
nTocYpyluVkbkZJafrQGr58=
=H+zg
-----END PGP SIGNATURE-----
_______________________________________________
Commons-dev mailing list
Commons-dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/commons-dev
[wsas-java-dev] [commons-dev] Improvements to adminui javascrip
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Rajika,
Patch for making WSRequest, with the wso2.wsf namespace.
Saminda
saminda abeyruwan wrote:
> Hi Sir,
>
> Yes Sir, it's the same code in
> http://wso2.org/repos/wso2/trunk/wsf/javascript/native/ we are referring
> to.
>
>>>> I believe you are referring prior to WSRequest.js. The simplest solution
>>>> would be to start with native/WSRequest.js.
>>> I'm referring to the stuff at
>>> http://wso2.org/repos/wso2/trunk/wsf/javascript/native/. I think you
>>> meant the same right?
>>>
>>>> We propose that main.js contains functions related to a namespace
>>>> "WSO2.common", (ex: WSO2.common.send(args...)) will solve the namespace
>>>> issue.
>>> +1 but IMO it should be wso2.wsf.
>
> main.js reside under commons/adminui project.
> [https://wso2.org/repos/wso2/trunk/commons/adminui]. Should we use
> "wso2.wsf" namespace for this too.
>>>> As an example, WSO2.common.send(args...) is the wrapper function that
>>>> uses WSRequest functionality to communicate with server. This is our
>>>> original plan and we were waiting for a release of WSRequest to achieve
>>>> this.
>>> No I disagree- if there's a need to wrap WSRequest then we haven't got
>>> WSRequest right. What is preventing you from doing
>>> foo=new wso2.wsf.WSRequest()
>
> +1.
>
> Should we do this to XPI and ActiveX Object too, namespace qualifying
> WSRequest object.
>
>
> Thank you
>
> Saminda
>
>
_______________________________________________
Wsas-java-dev mailing list
Wsas-java-dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/wsas-java-dev
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFF9S9AYmklbLuW6wYRAsq8AJ4l326Z3ohAOsZCx3Ei9/lvslY3CwCgpUTz
TCA2db6g9wxd1mBwVkLBvT8=
=E2Pn
-----END PGP SIGNATURE-----
[wsas-java-dev] [commons-dev] Improvements to adminui javascrip
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all,
Sorry for jumping in this late..Better late than never :)..
Saminda, What are the reasons for namespace qualifying this.. If we are
doing this we need to do so across the whole board for all the WSRequest
impls...
I would not agree with this unless there is a concrete reason...
Thanks,
Thilina
saminda abeyruwan wrote:
> Hi Rajika,
>
> Patch for making WSRequest, with the wso2.wsf namespace.
>
> Saminda
>
> saminda abeyruwan wrote:
>> Hi Sir,
>
>> Yes Sir, it's the same code in
>> http://wso2.org/repos/wso2/trunk/wsf/javascript/native/ we are referring
>> to.
>
>>>>> I believe you are referring prior to WSRequest.js. The simplest solution
>>>>> would be to start with native/WSRequest.js.
>>>> I'm referring to the stuff at
>>>> http://wso2.org/repos/wso2/trunk/wsf/javascript/native/. I think you
>>>> meant the same right?
>>>>
>>>>> We propose that main.js contains functions related to a namespace
>>>>> "WSO2.common", (ex: WSO2.common.send(args...)) will solve the namespace
>>>>> issue.
>>>> +1 but IMO it should be wso2.wsf.
>> main.js reside under commons/adminui project.
>> [https://wso2.org/repos/wso2/trunk/commons/adminui]. Should we use
>> "wso2.wsf" namespace for this too.
>>>>> As an example, WSO2.common.send(args...) is the wrapper function that
>>>>> uses WSRequest functionality to communicate with server. This is our
>>>>> original plan and we were waiting for a release of WSRequest to achieve
>>>>> this.
>>>> No I disagree- if there's a need to wrap WSRequest then we haven't got
>>>> WSRequest right. What is preventing you from doing
>>>> foo=new wso2.wsf.WSRequest()
>> +1.
>
>> Should we do this to XPI and ActiveX Object too, namespace qualifying
>> WSRequest object.
>
>
>> Thank you
>
>> Saminda
>
>
>
> _______________________________________________
> Wsas-java-dev mailing list
> Wsas-java-dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/wsas-java-dev
>
>
- ------------------------------------------------------------------------
Index: samples/firefox/google.html
===================================================================
- --- samples/firefox/google.html (revision 1205)
+++ samples/firefox/google.html (working copy)
@@ -2,11 +2,11 @@
WSO2 WSRequest object
WSO2 WSRequest Object Demo-Google spell check
- -
+
- - var wshttp = new WSRequest();
+ var wshttp = new wso2.wsf.WSRequest();
function checkSpell()
{
@@ -97,7 +97,7 @@
- -
+
your request xml
>
Index: samples/firefox/zipcode.html
===================================================================
- --- samples/firefox/zipcode.html (revision 1205)
+++ samples/firefox/zipcode.html (working copy)
@@ -2,12 +2,12 @@
WSO2 WSRequest object
WSO2 WSRequest Object Demo-Distance between two zip codes
- -
+
- - var wshttp = new WSRequest();
+ var wshttp = new wso2.wsf.WSRequest();
function test(){
var option = new Array();
wshttp.onreadystatechange = test1;
Index: samples/firefox/greet.html
===================================================================
- --- samples/firefox/greet.html (revision 1205)
+++ samples/firefox/greet.html (working copy)
@@ -2,12 +2,12 @@
WSO2 WSRequest object
WSO2 WSRequest Object Demo-Greet of the day
- -
+
- - var wshttp = new WSRequest();
+ var wshttp = new wso2.wsf.WSRequest();
function greet(){
wshttp.onreadystatechange = state;
Index: samples/firefox/googlesnyc.html
===================================================================
- --- samples/firefox/googlesnyc.html (revision 1205)
+++ samples/firefox/googlesnyc.html (working copy)
@@ -2,11 +2,11 @@
WSO2 WSRequest object
WSO2 WSRequest Object Demo-Google spell check
- -
+
- - var wshttp = new WSRequest();
+ var wshttp = new wso2.wsf.WSRequest();
function checkSpell()
{
Index: samples/ie/greet_ie.html
===================================================================
- --- samples/ie/greet_ie.html (revision 1205)
+++ samples/ie/greet_ie.html (working copy)
@@ -2,12 +2,12 @@
WSO2 WSRequest object
WSO2 WSRequest Object Demo-Greet of the day
- -
+
- - var wshttp = new WSRequest();
+ var wshttp = new wso2.wsf.WSRequest();
function greet(){
var option = new Array();
option['useSOAP'] = 1.1;
Index: samples/ie/googlesnyc_ie.html
===================================================================
- --- samples/ie/googlesnyc_ie.html (revision 1205)
+++ samples/ie/googlesnyc_ie.html (working copy)
@@ -2,7 +2,7 @@
WSO2 WSRequest demo
WSO2 WSRequest Object Demo-Google spell check
- -
+
@@ -10,7 +10,7 @@
var key;
var phrase;
var wshttp = null;
- - wshttp = new WSRequest();
+ wshttp = new wso2.wsf.WSRequest();
function search(){
wshttp.onreadystatechange = callbackResult;
Index: samples/ie/google_ie.html
===================================================================
- --- samples/ie/google_ie.html (revision 1205)
+++ samples/ie/google_ie.html (working copy)
@@ -2,7 +2,7 @@
WSO2 WSRequest demo
WSO2 WSRequest Object Demo-Google spell check
- -
+
@@ -10,7 +10,7 @@
var key;
var phrase;
var wshttp = null;
- - wshttp = new WSRequest();
+ wshttp = new wso2.wsf.WSRequest();
function search(){
wshttp.onreadystatechange = callbackResult;
Index: samples/ie/zipcode_ie.html
===================================================================
- --- samples/ie/zipcode_ie.html (revision 1205)
+++ samples/ie/zipcode_ie.html (working copy)
@@ -2,11 +2,11 @@
WSO2 WSRequest object
WSO2 WSRequest Object Demo-Distance between two zip codes
- -
+
- - var wshttp = new WSRequest(true);
+ var wshttp = new wso2.wsf.WSRequest(true);
function test(){
// user need soap-not xml
Index: WSRequest.js
===================================================================
- --- WSRequest.js (revision 1205)
+++ WSRequest.js (working copy)
@@ -14,8 +14,46 @@
* limitations under the License.
*/
- -function WSRequest()
- -{
+/**
+ * WSRequest object uses SOAP/HTTP|HTTPS. This object provides a wrpper
for XMLHttpRequest object.
+ * This object belongs to the namespace wso2.wsf, thus, user can init
it as follows,
+ * var foo = new wso2.wsf.WSRequest();
+ */
+
+/*
+creating the wso2 global object
+*/
+if (typeof wso2 == 'undefined') {
+ //define the WSO2 global object
+
+ wso2 = {};
+}
+
+/*this will create the namespace required.*/
+wso2.namespace = function() {
+ var a = arguments,o = null,i,j,d;
+ for (i = 0; i < a.length; i++) {
+ d = a[i].split(".");
+ o = wso2;
+
+ for (j = (d[0] == "wso2")?1:0; j < d.length; j++) {
+ o[d[j]] = o[d[j]] || {};
+ o = o[d[j]];
+ }
+ }
+
+ return o;
+}
+
+wso2.init = function() {
+ this.namespace("wsf");
+}
+
+wso2.init();
+
+
+wso2.wsf.WSRequest = function() {
+
// data members
// readyState
this.readyState = 0;
- ------------------------------------------------------------------------
_______________________________________________
Commons-dev mailing list
Commons-dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/commons-dev
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
iD8DBQFGCLCTTt0cKycFPQgRArP5AJkB+Be2WLMKGigogY5hy9uMrur5KwCfZx6j
xF1WPTJbkfiaiB0OBQlkuSQ=
=FZBI
-----END PGP SIGNATURE-----
_______________________________________________
Commons-dev mailing list
Commons-dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/commons-dev
[wsas-java-dev] [commons-dev] Improvements to adminui javascrip
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Thilina,
WSRequest IMHO is not standardized as XMLHttpRequest object. Thus, there
should have been a situation one could initialize his own WSRequest
class. Thus, this will cause collisions. In this kind of a situation you
couldn't exactly say which class the Javascript engine might use to
initialize the object. Thus, we need some mechanism to avoid this
collision. That's why we use namespaces.
Is there an alternative to avoid this kind of collisions ?
Thank you
Saminda
Thilina Gunarathne wrote:
> Hi all,
> Sorry for jumping in this late..Better late than never :)..
>
> Saminda, What are the reasons for namespace qualifying this.. If we are
> doing this we need to do so across the whole board for all the WSRequest
> impls...
>
> I would not agree with this unless there is a concrete reason...
>
> Thanks,
> Thilina
>
> saminda abeyruwan wrote:
>>> Hi Rajika,
>>>
>>> Patch for making WSRequest, with the wso2.wsf namespace.
>>>
>>> Saminda
>>>
>>> saminda abeyruwan wrote:
>>>> Hi Sir,
>>>> Yes Sir, it's the same code in
>>>> http://wso2.org/repos/wso2/trunk/wsf/javascript/native/ we are referring
>>>> to.
>>>>>>> I believe you are referring prior to WSRequest.js. The simplest solution
>>>>>>> would be to start with native/WSRequest.js.
>>>>>> I'm referring to the stuff at
>>>>>> http://wso2.org/repos/wso2/trunk/wsf/javascript/native/. I think you
>>>>>> meant the same right?
>>>>>>
>>>>>>> We propose that main.js contains functions related to a namespace
>>>>>>> "WSO2.common", (ex: WSO2.common.send(args...)) will solve the namespace
>>>>>>> issue.
>>>>>> +1 but IMO it should be wso2.wsf.
>>>> main.js reside under commons/adminui project.
>>>> [https://wso2.org/repos/wso2/trunk/commons/adminui]. Should we use
>>>> "wso2.wsf" namespace for this too.
>>>>>>> As an example, WSO2.common.send(args...) is the wrapper function that
>>>>>>> uses WSRequest functionality to communicate with server. This is our
>>>>>>> original plan and we were waiting for a release of WSRequest to achieve
>>>>>>> this.
>>>>>> No I disagree- if there's a need to wrap WSRequest then we haven't got
>>>>>> WSRequest right. What is preventing you from doing
>>>>>> foo=new wso2.wsf.WSRequest()
>>>> +1.
>>>> Should we do this to XPI and ActiveX Object too, namespace qualifying
>>>> WSRequest object.
>>>
>>>> Thank you
>>>> Saminda
>>>
>>>
>>> _______________________________________________
>>> Wsas-java-dev mailing list
>>> Wsas-java-dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/wsas-java-dev
>>>
>>>
>
> ------------------------------------------------------------------------
>
> Index: samples/firefox/google.html
> ===================================================================
> --- samples/firefox/google.html (revision 1205)
> +++ samples/firefox/google.html (working copy)
> @@ -2,11 +2,11 @@
>
> WSO2 WSRequest object
>
WSO2 WSRequest Object Demo-Google spell check
> -
> +
>
>
>
> - var wshttp = new WSRequest();
> + var wshttp = new wso2.wsf.WSRequest();
>
> function checkSpell()
> {
> @@ -97,7 +97,7 @@
>
>
>
> -
> + >
>
> your request xml
>
> Index: samples/firefox/zipcode.html
> ===================================================================
> --- samples/firefox/zipcode.html (revision 1205)
> +++ samples/firefox/zipcode.html (working copy)
> @@ -2,12 +2,12 @@
>
> WSO2 WSRequest object
>
WSO2 WSRequest Object Demo-Distance between two zip codes
> -
> +
>
>
>
>
> - var wshttp = new WSRequest();
> + var wshttp = new wso2.wsf.WSRequest();
> function test(){
> var option = new Array();
> wshttp.onreadystatechange = test1;
> Index: samples/firefox/greet.html
> ===================================================================
> --- samples/firefox/greet.html (revision 1205)
> +++ samples/firefox/greet.html (working copy)
> @@ -2,12 +2,12 @@
>
> WSO2 WSRequest object
>
WSO2 WSRequest Object Demo-Greet of the day
> -
> +
>
>
>
>
> - var wshttp = new WSRequest();
> + var wshttp = new wso2.wsf.WSRequest();
> function greet(){
>
> wshttp.onreadystatechange = state;
> Index: samples/firefox/googlesnyc.html
> ===================================================================
> --- samples/firefox/googlesnyc.html (revision 1205)
> +++ samples/firefox/googlesnyc.html (working copy)
> @@ -2,11 +2,11 @@
>
> WSO2 WSRequest object
>
WSO2 WSRequest Object Demo-Google spell check
> -
> +
>
>
>
> - var wshttp = new WSRequest();
> + var wshttp = new wso2.wsf.WSRequest();
>
> function checkSpell()
> {
> Index: samples/ie/greet_ie.html
> ===================================================================
> --- samples/ie/greet_ie.html (revision 1205)
> +++ samples/ie/greet_ie.html (working copy)
> @@ -2,12 +2,12 @@
>
> WSO2 WSRequest object
>
WSO2 WSRequest Object Demo-Greet of the day
> -
> +
>
>
>
>
> - var wshttp = new WSRequest();
> + var wshttp = new wso2.wsf.WSRequest();
> function greet(){
> var option = new Array();
> option['useSOAP'] = 1.1;
> Index: samples/ie/googlesnyc_ie.html
> ===================================================================
> --- samples/ie/googlesnyc_ie.html (revision 1205)
> +++ samples/ie/googlesnyc_ie.html (working copy)
> @@ -2,7 +2,7 @@
>
> WSO2 WSRequest demo
>
WSO2 WSRequest Object Demo-Google spell check
> -
> +
>
>
>
> @@ -10,7 +10,7 @@
> var key;
> var phrase;
> var wshttp = null;
> - wshttp = new WSRequest();
> + wshttp = new wso2.wsf.WSRequest();
> function search(){
>
> wshttp.onreadystatechange = callbackResult;
> Index: samples/ie/google_ie.html
> ===================================================================
> --- samples/ie/google_ie.html (revision 1205)
> +++ samples/ie/google_ie.html (working copy)
> @@ -2,7 +2,7 @@
>
> WSO2 WSRequest demo
>
WSO2 WSRequest Object Demo-Google spell check
> -
> +
>
>
>
> @@ -10,7 +10,7 @@
> var key;
> var phrase;
> var wshttp = null;
> - wshttp = new WSRequest();
> + wshttp = new wso2.wsf.WSRequest();
> function search(){
>
> wshttp.onreadystatechange = callbackResult;
> Index: samples/ie/zipcode_ie.html
> ===================================================================
> --- samples/ie/zipcode_ie.html (revision 1205)
> +++ samples/ie/zipcode_ie.html (working copy)
> @@ -2,11 +2,11 @@
>
> WSO2 WSRequest object
>
WSO2 WSRequest Object Demo-Distance between two zip codes
> -
> +
>
>
>
> - var wshttp = new WSRequest(true);
> + var wshttp = new wso2.wsf.WSRequest(true);
> function test(){
>
> // user need soap-not xml
> Index: WSRequest.js
> ===================================================================
> --- WSRequest.js (revision 1205)
> +++ WSRequest.js (working copy)
> @@ -14,8 +14,46 @@
> * limitations under the License.
> */
>
> -function WSRequest()
> -{
> +/**
> + * WSRequest object uses SOAP/HTTP|HTTPS. This object provides a wrpper
> for XMLHttpRequest object.
> + * This object belongs to the namespace wso2.wsf, thus, user can init
> it as follows,
> + * var foo = new wso2.wsf.WSRequest();
> + */
> +
> +/*
> +creating the wso2 global object
> +*/
> +if (typeof wso2 == 'undefined') {
> + //define the WSO2 global object
> +
> + wso2 = {};
> +}
> +
> +/*this will create the namespace required.*/
> +wso2.namespace = function() {
> + var a = arguments,o = null,i,j,d;
> + for (i = 0; i < a.length; i++) {
> + d = a[i].split(".");
> + o = wso2;
> +
> + for (j = (d[0] == "wso2")?1:0; j < d.length; j++) {
> + o[d[j]] = o[d[j]] || {};
> + o = o[d[j]];
> + }
> + }
> +
> + return o;
> +}
> +
> +wso2.init = function() {
> + this.namespace("wsf");
> +}
> +
> +wso2.init();
> +
> +
> +wso2.wsf.WSRequest = function() {
> +
> // data members
> // readyState
> this.readyState = 0;
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Commons-dev mailing list
> Commons-dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/commons-dev
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGCR9+YmklbLuW6wYRApo5AJ4m7RB9hnk+yn8xUPPiWNjNn7No/ACfeykL
FAJVXPXPyW4ve4lCkLioyRE=
=Hf3X
-----END PGP SIGNATURE-----
_______________________________________________
Wsas-java-dev mailing list
Wsas-java-dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/wsas-java-dev
[wsas-java-dev] [commons-dev] Improvements to adminui javascrip
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
> WSRequest IMHO is not standardized as XMLHttpRequest object.
I thought we are going to provide the web services equivalent to the
XMLHttpRequest.. May be we will be able to standardize it someday..
IMHO it's should not be just another javascript library. It should be
*THE* thing..
>Thus, there should have been a situation one could initialize his own WSRequest
> class. Thus, this will cause collisions.
Good point... But AFAIKS this is a very very rare situation..
>In this kind of a situation you
> couldn't exactly say which class the Javascript engine might use to
> initialize the object. Thus, we need some mechanism to avoid this
> collision. That's why we use namespaces.
IIRC yahoo namespace is the first thing which worried you when you saw
the Yahoo UI toolkit and I had to put lot of efforts to convince you :)..
IMHO using a wso2 namespace might prevent some users from using it, or
at least it'll give them a bit backward impression, not because of it's
WSO2 but due to the fact that it's something external (the same feeling
you had towards yahoo)...
> Is there an alternative to avoid this kind of collisions ?
I don't see an alternative... But I don't see it as a rock solid reason
to make it namespaced...May be my very little knowledge on javascript
makes me oversee this..
Thanks,
Thilina
>
> Thank you
>
>
> Saminda
>
> Thilina Gunarathne wrote:
>> Hi all,
>> Sorry for jumping in this late..Better late than never :)..
>
>> Saminda, What are the reasons for namespace qualifying this.. If we are
>> doing this we need to do so across the whole board for all the WSRequest
>> impls...
>
>> I would not agree with this unless there is a concrete reason...
>
>> Thanks,
>> Thilina
>
>> saminda abeyruwan wrote:
>>>> Hi Rajika,
>>>>
>>>> Patch for making WSRequest, with the wso2.wsf namespace.
>>>>
>>>> Saminda
>>>>
>>>> saminda abeyruwan wrote:
>>>>> Hi Sir,
>>>>> Yes Sir, it's the same code in
>>>>> http://wso2.org/repos/wso2/trunk/wsf/javascript/native/ we are referring
>>>>> to.
>>>>>>>> I believe you are referring prior to WSRequest.js. The simplest solution
>>>>>>>> would be to start with native/WSRequest.js.
>>>>>>> I'm referring to the stuff at
>>>>>>> http://wso2.org/repos/wso2/trunk/wsf/javascript/native/. I think you
>>>>>>> meant the same right?
>>>>>>>
>>>>>>>> We propose that main.js contains functions related to a namespace
>>>>>>>> "WSO2.common", (ex: WSO2.common.send(args...)) will solve the namespace
>>>>>>>> issue.
>>>>>>> +1 but IMO it should be wso2.wsf.
>>>>> main.js reside under commons/adminui project.
>>>>> [https://wso2.org/repos/wso2/trunk/commons/adminui]. Should we use
>>>>> "wso2.wsf" namespace for this too.
>>>>>>>> As an example, WSO2.common.send(args...) is the wrapper function that
>>>>>>>> uses WSRequest functionality to communicate with server. This is our
>>>>>>>> original plan and we were waiting for a release of WSRequest to achieve
>>>>>>>> this.
>>>>>>> No I disagree- if there's a need to wrap WSRequest then we haven't got
>>>>>>> WSRequest right. What is preventing you from doing
>>>>>>> foo=new wso2.wsf.WSRequest()
>>>>> +1.
>>>>> Should we do this to XPI and ActiveX Object too, namespace qualifying
>>>>> WSRequest object.
>>>>> Thank you
>>>>> Saminda
>>>>
>>>> _______________________________________________
>>>> Wsas-java-dev mailing list
>>>> Wsas-java-dev@wso2.org
>>>> http://wso2.org/cgi-bin/mailman/listinfo/wsas-java-dev
>>>>
>>>>
>> ------------------------------------------------------------------------
>
>> Index: samples/firefox/google.html
>> ===================================================================
>> --- samples/firefox/google.html (revision 1205)
>> +++ samples/firefox/google.html (working copy)
>> @@ -2,11 +2,11 @@
>>
>> WSO2 WSRequest object
>>
WSO2 WSRequest Object Demo-Google spell check
>> -
>> +
>>
>>
>>
>> - var wshttp = new WSRequest();
>> + var wshttp = new wso2.wsf.WSRequest();
>
>> function checkSpell()
>> {
>> @@ -97,7 +97,7 @@
>>
>>
>>
>> -
>> + checkSpell();return false;">
>>
>>
>> your request xml
>>
>> Index: samples/firefox/zipcode.html
>> ===================================================================
>> --- samples/firefox/zipcode.html (revision 1205)
>> +++ samples/firefox/zipcode.html (working copy)
>> @@ -2,12 +2,12 @@
>>
>> WSO2 WSRequest object
>>
WSO2 WSRequest Object Demo-Distance between two zip codes
>> -
>> +
>>
>>
>>
>
>> - var wshttp = new WSRequest();
>> + var wshttp = new wso2.wsf.WSRequest();
>> function test(){
>> var option = new Array();
>> wshttp.onreadystatechange = test1;
>> Index: samples/firefox/greet.html
>> ===================================================================
>> --- samples/firefox/greet.html (revision 1205)
>> +++ samples/firefox/greet.html (working copy)
>> @@ -2,12 +2,12 @@
>>
>> WSO2 WSRequest object
>>
WSO2 WSRequest Object Demo-Greet of the day
>> -
>> +
>>
>>
>>
>
>> - var wshttp = new WSRequest();
>> + var wshttp = new wso2.wsf.WSRequest();
>> function greet(){
>
>> wshttp.onreadystatechange = state;
>> Index: samples/firefox/googlesnyc.html
>> ===================================================================
>> --- samples/firefox/googlesnyc.html (revision 1205)
>> +++ samples/firefox/googlesnyc.html (working copy)
>> @@ -2,11 +2,11 @@
>>
>> WSO2 WSRequest object
>>
WSO2 WSRequest Object Demo-Google spell check
>> -
>> +
>>
>>
>>
>> - var wshttp = new WSRequest();
>> + var wshttp = new wso2.wsf.WSRequest();
>
>> function checkSpell()
>> {
>> Index: samples/ie/greet_ie.html
>> ===================================================================
>> --- samples/ie/greet_ie.html (revision 1205)
>> +++ samples/ie/greet_ie.html (working copy)
>> @@ -2,12 +2,12 @@
>>
>> WSO2 WSRequest object
>>
WSO2 WSRequest Object Demo-Greet of the day
>> -
>> +
>>
>>
>>
>
>> - var wshttp = new WSRequest();
>> + var wshttp = new wso2.wsf.WSRequest();
>> function greet(){
>> var option = new Array();
>> option['useSOAP'] = 1.1;
>> Index: samples/ie/googlesnyc_ie.html
>> ===================================================================
>> --- samples/ie/googlesnyc_ie.html (revision 1205)
>> +++ samples/ie/googlesnyc_ie.html (working copy)
>> @@ -2,7 +2,7 @@
>>
>> WSO2 WSRequest demo
>>
WSO2 WSRequest Object Demo-Google spell check
>> -
>> +
>>
>>
>>
>> @@ -10,7 +10,7 @@
>> var key;
>> var phrase;
>> var wshttp = null;
>> - wshttp = new WSRequest();
>> + wshttp = new wso2.wsf.WSRequest();
>> function search(){
>
>> wshttp.onreadystatechange = callbackResult;
>> Index: samples/ie/google_ie.html
>> ===================================================================
>> --- samples/ie/google_ie.html (revision 1205)
>> +++ samples/ie/google_ie.html (working copy)
>> @@ -2,7 +2,7 @@
>>
>> WSO2 WSRequest demo
>>
WSO2 WSRequest Object Demo-Google spell check
>> -
>> +
>>
>>
>>
>> @@ -10,7 +10,7 @@
>> var key;
>> var phrase;
>> var wshttp = null;
>> - wshttp = new WSRequest();
>> + wshttp = new wso2.wsf.WSRequest();
>> function search(){
>
>> wshttp.onreadystatechange = callbackResult;
>> Index: samples/ie/zipcode_ie.html
>> ===================================================================
>> --- samples/ie/zipcode_ie.html (revision 1205)
>> +++ samples/ie/zipcode_ie.html (working copy)
>> @@ -2,11 +2,11 @@
>>
>> WSO2 WSRequest object
>>
WSO2 WSRequest Object Demo-Distance between two zip codes
>> -
>> +
>>
>>
>>
>> - var wshttp = new WSRequest(true);
>> + var wshttp = new wso2.wsf.WSRequest(true);
>> function test(){
>
>> // user need soap-not xml
>> Index: WSRequest.js
>> ===================================================================
>> --- WSRequest.js (revision 1205)
>> +++ WSRequest.js (working copy)
>> @@ -14,8 +14,46 @@
>> * limitations under the License.
>> */
>
>> -function WSRequest()
>> -{
>> +/**
>> + * WSRequest object uses SOAP/HTTP|HTTPS. This object provides a wrpper
>> for XMLHttpRequest object.
>> + * This object belongs to the namespace wso2.wsf, thus, user can init
>> it as follows,
>> + * var foo = new wso2.wsf.WSRequest();
>> + */
>> +
>> +/*
>> +creating the wso2 global object
>> +*/
>> +if (typeof wso2 == 'undefined') {
>> + //define the WSO2 global object
>> +
>> + wso2 = {};
>> +}
>> +
>> +/*this will create the namespace required.*/
>> +wso2.namespace = function() {
>> + var a = arguments,o = null,i,j,d;
>> + for (i = 0; i < a.length; i++) {
>> + d = a[i].split(".");
>> + o = wso2;
>> +
>> + for (j = (d[0] == "wso2")?1:0; j < d.length; j++) {
>> + o[d[j]] = o[d[j]] || {};
>> + o = o[d[j]];
>> + }
>> + }
>> +
>> + return o;
>> +}
>> +
>> +wso2.init = function() {
>> + this.namespace("wsf");
>> +}
>> +
>> +wso2.init();
>> +
>> +
>> +wso2.wsf.WSRequest = function() {
>> +
>> // data members
>> // readyState
>> this.readyState = 0;
>
>
>> ------------------------------------------------------------------------
>
>> _______________________________________________
>> Commons-dev mailing list
>> Commons-dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/commons-dev
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
iD8DBQFGCT6/Tt0cKycFPQgRAswXAJoCmP+2bKjB9HarFI7pL9Lbf1pNLACfS76s
um3Vgq5DzcBWL7WTq2pEPp8=
=hgz0
-----END PGP SIGNATURE-----
_______________________________________________
Wsas-java-dev mailing list
Wsas-java-dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/wsas-java-dev
[wsas-java-dev] [commons-dev] Improvements to adminui javascrip
Hmmm so is the only risk that someone may have a class called WSRequest??
If so I'm now -1 on putting it into the wso2.wsf namespace for the reasons
Thilina cites below.
Sorry for waffling on it but I (stupidly) thought that functions like
send() were exposed but they're not as they're methods of the WSRequest
object.
Sanjiva.
Thilina Gunarathne wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>> WSRequest IMHO is not standardized as XMLHttpRequest object.
> I thought we are going to provide the web services equivalent to the
> XMLHttpRequest.. May be we will be able to standardize it someday..
> IMHO it's should not be just another javascript library. It should be
> *THE* thing..
>
>> Thus, there should have been a situation one could initialize his own WSRequest
>> class. Thus, this will cause collisions.
> Good point... But AFAIKS this is a very very rare situation..
>> In this kind of a situation you
>> couldn't exactly say which class the Javascript engine might use to
>> initialize the object. Thus, we need some mechanism to avoid this
>> collision. That's why we use namespaces.
> IIRC yahoo namespace is the first thing which worried you when you saw
> the Yahoo UI toolkit and I had to put lot of efforts to convince you :)..
>
> IMHO using a wso2 namespace might prevent some users from using it, or
> at least it'll give them a bit backward impression, not because of it's
> WSO2 but due to the fact that it's something external (the same feeling
> you had towards yahoo)...
>
>> Is there an alternative to avoid this kind of collisions ?
> I don't see an alternative... But I don't see it as a rock solid reason
> to make it namespaced...May be my very little knowledge on javascript
> makes me oversee this..
>
> Thanks,
> Thilina
>> Thank you
>>
>>
>> Saminda
>>
>> Thilina Gunarathne wrote:
>>> Hi all,
>>> Sorry for jumping in this late..Better late than never :)..
>>> Saminda, What are the reasons for namespace qualifying this.. If we are
>>> doing this we need to do so across the whole board for all the WSRequest
>>> impls...
>>> I would not agree with this unless there is a concrete reason...
>>> Thanks,
>>> Thilina
>>> saminda abeyruwan wrote:
>>>>> Hi Rajika,
>>>>>
>>>>> Patch for making WSRequest, with the wso2.wsf namespace.
>>>>>
>>>>> Saminda
>>>>>
>>>>> saminda abeyruwan wrote:
>>>>>> Hi Sir,
>>>>>> Yes Sir, it's the same code in
>>>>>> http://wso2.org/repos/wso2/trunk/wsf/javascript/native/ we are referring
>>>>>> to.
>>>>>>>>> I believe you are referring prior to WSRequest.js. The simplest solution
>>>>>>>>> would be to start with native/WSRequest.js.
>>>>>>>> I'm referring to the stuff at
>>>>>>>> http://wso2.org/repos/wso2/trunk/wsf/javascript/native/. I think you
>>>>>>>> meant the same right?
>>>>>>>>
>>>>>>>>> We propose that main.js contains functions related to a namespace
>>>>>>>>> "WSO2.common", (ex: WSO2.common.send(args...)) will solve the namespace
>>>>>>>>> issue.
>>>>>>>> +1 but IMO it should be wso2.wsf.
>>>>>> main.js reside under commons/adminui project.
>>>>>> [https://wso2.org/repos/wso2/trunk/commons/adminui]. Should we use
>>>>>> "wso2.wsf" namespace for this too.
>>>>>>>>> As an example, WSO2.common.send(args...) is the wrapper function that
>>>>>>>>> uses WSRequest functionality to communicate with server. This is our
>>>>>>>>> original plan and we were waiting for a release of WSRequest to achieve
>>>>>>>>> this.
>>>>>>>> No I disagree- if there's a need to wrap WSRequest then we haven't got
>>>>>>>> WSRequest right. What is preventing you from doing
>>>>>>>> foo=new wso2.wsf.WSRequest()
>>>>>> +1.
>>>>>> Should we do this to XPI and ActiveX Object too, namespace qualifying
>>>>>> WSRequest object.
>>>>>> Thank you
>>>>>> Saminda
>>>>> _______________________________________________
>>>>> Wsas-java-dev mailing list
>>>>> Wsas-java-dev@wso2.org
>>>>> http://wso2.org/cgi-bin/mailman/listinfo/wsas-java-dev
>>>>>
>>>>>
>>> ------------------------------------------------------------------------
>>> Index: samples/firefox/google.html
>>> ===================================================================
>>> --- samples/firefox/google.html (revision 1205)
>>> +++ samples/firefox/google.html (working copy)
>>> @@ -2,11 +2,11 @@
>>>
>>> WSO2 WSRequest object
>>>
WSO2 WSRequest Object Demo-Google spell check
>>> -
>>> +
>>>
>>>
>>>
>>> - var wshttp = new WSRequest();
>>> + var wshttp = new wso2.wsf.WSRequest();
>>> function checkSpell()
>>> {
>>> @@ -97,7 +97,7 @@
>>>
>>>
>>>
>>> -
>>> + > checkSpell();return false;">
>>>
>>>
>>> your request xml
>>>
>>> Index: samples/firefox/zipcode.html
>>> ===================================================================
>>> --- samples/firefox/zipcode.html (revision 1205)
>>> +++ samples/firefox/zipcode.html (working copy)
>>> @@ -2,12 +2,12 @@
>>>
>>> WSO2 WSRequest object
>>>
WSO2 WSRequest Object Demo-Distance between two zip codes
>>> -
>>> +
>>>
>>>
>>>
>>> - var wshttp = new WSRequest();
>>> + var wshttp = new wso2.wsf.WSRequest();
>>> function test(){
>>> var option = new Array();
>>> wshttp.onreadystatechange = test1;
>>> Index: samples/firefox/greet.html
>>> ===================================================================
>>> --- samples/firefox/greet.html (revision 1205)
>>> +++ samples/firefox/greet.html (working copy)
>>> @@ -2,12 +2,12 @@
>>>
>>> WSO2 WSRequest object
>>>
WSO2 WSRequest Object Demo-Greet of the day
>>> -
>>> +
>>>
>>>
>>>
>>> - var wshttp = new WSRequest();
>>> + var wshttp = new wso2.wsf.WSRequest();
>>> function greet(){
>>> wshttp.onreadystatechange = state;
>>> Index: samples/firefox/googlesnyc.html
>>> ===================================================================
>>> --- samples/firefox/googlesnyc.html (revision 1205)
>>> +++ samples/firefox/googlesnyc.html (working copy)
>>> @@ -2,11 +2,11 @@
>>>
>>> WSO2 WSRequest object
>>>
WSO2 WSRequest Object Demo-Google spell check
>>> -
>>> +
>>>
>>>
>>>
>>> - var wshttp = new WSRequest();
>>> + var wshttp = new wso2.wsf.WSRequest();
>>> function checkSpell()
>>> {
>>> Index: samples/ie/greet_ie.html
>>> ===================================================================
>>> --- samples/ie/greet_ie.html (revision 1205)
>>> +++ samples/ie/greet_ie.html (working copy)
>>> @@ -2,12 +2,12 @@
>>>
>>> WSO2 WSRequest object
>>>
WSO2 WSRequest Object Demo-Greet of the day
>>> -
>>> +
>>>
>>>
>>>
>>> - var wshttp = new WSRequest();
>>> + var wshttp = new wso2.wsf.WSRequest();
>>> function greet(){
>>> var option = new Array();
>>> option['useSOAP'] = 1.1;
>>> Index: samples/ie/googlesnyc_ie.html
>>> ===================================================================
>>> --- samples/ie/googlesnyc_ie.html (revision 1205)
>>> +++ samples/ie/googlesnyc_ie.html (working copy)
>>> @@ -2,7 +2,7 @@
>>>
>>> WSO2 WSRequest demo
>>>
WSO2 WSRequest Object Demo-Google spell check
>>> -
>>> +
>>>
>>>
>>>
>>> @@ -10,7 +10,7 @@
>>> var key;
>>> var phrase;
>>> var wshttp = null;
>>> - wshttp = new WSRequest();
>>> + wshttp = new wso2.wsf.WSRequest();
>>> function search(){
>>> wshttp.onreadystatechange = callbackResult;
>>> Index: samples/ie/google_ie.html
>>> ===================================================================
>>> --- samples/ie/google_ie.html (revision 1205)
>>> +++ samples/ie/google_ie.html (working copy)
>>> @@ -2,7 +2,7 @@
>>>
>>> WSO2 WSRequest demo
>>>
WSO2 WSRequest Object Demo-Google spell check
>>> -
>>> +
>>>
>>>
>>>
>>> @@ -10,7 +10,7 @@
>>> var key;
>>> var phrase;
>>> var wshttp = null;
>>> - wshttp = new WSRequest();
>>> + wshttp = new wso2.wsf.WSRequest();
>>> function search(){
>>> wshttp.onreadystatechange = callbackResult;
>>> Index: samples/ie/zipcode_ie.html
>>> ===================================================================
>>> --- samples/ie/zipcode_ie.html (revision 1205)
>>> +++ samples/ie/zipcode_ie.html (working copy)
>>> @@ -2,11 +2,11 @@
>>>
>>> WSO2 WSRequest object
>>>
WSO2 WSRequest Object Demo-Distance between two zip codes
>>> -
>>> +
>>>
>>>
>>>
>>> - var wshttp = new WSRequest(true);
>>> + var wshttp = new wso2.wsf.WSRequest(true);
>>> function test(){
>>> // user need soap-not xml
>>> Index: WSRequest.js
>>> ===================================================================
>>> --- WSRequest.js (revision 1205)
>>> +++ WSRequest.js (working copy)
>>> @@ -14,8 +14,46 @@
>>> * limitations under the License.
>>> */
>>> -function WSRequest()
>>> -{
>>> +/**
>>> + * WSRequest object uses SOAP/HTTP|HTTPS. This object provides a wrpper
>>> for XMLHttpRequest object.
>>> + * This object belongs to the namespace wso2.wsf, thus, user can init
>>> it as follows,
>>> + * var foo = new wso2.wsf.WSRequest();
>>> + */
>>> +
>>> +/*
>>> +creating the wso2 global object
>>> +*/
>>> +if (typeof wso2 == 'undefined') {
>>> + //define the WSO2 global object
>>> +
>>> + wso2 = {};
>>> +}
>>> +
>>> +/*this will create the namespace required.*/
>>> +wso2.namespace = function() {
>>> + var a = arguments,o = null,i,j,d;
>>> + for (i = 0; i < a.length; i++) {
>>> + d = a[i].split(".");
>>> + o = wso2;
>>> +
>>> + for (j = (d[0] == "wso2")?1:0; j < d.length; j++) {
>>> + o[d[j]] = o[d[j]] || {};
>>> + o = o[d[j]];
>>> + }
>>> + }
>>> +
>>> + return o;
>>> +}
>>> +
>>> +wso2.init = function() {
>>> + this.namespace("wsf");
>>> +}
>>> +
>>> +wso2.init();
>>> +
>>> +
>>> +wso2.wsf.WSRequest = function() {
>>> +
>>> // data members
>>> // readyState
>>> this.readyState = 0;
>>
>>> ------------------------------------------------------------------------
>>> _______________________________________________
>>> Commons-dev mailing list
>>> Commons-dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/commons-dev
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.3 (GNU/Linux)
>
> iD8DBQFGCT6/Tt0cKycFPQgRAswXAJoCmP+2bKjB9HarFI7pL9Lbf1pNLACfS76s
> um3Vgq5DzcBWL7WTq2pEPp8=
> =hgz0
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Commons-dev mailing list
> Commons-dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/commons-dev
>
--
Sanjiva Weerawarana, Ph.D.
Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
email: sanjiva@wso2.com; cell: +94 77 787 6880; fax: +1 509 691 2000
"Oxygenating the Web Service Platform."
_______________________________________________
Wsas-java-dev mailing list
Wsas-java-dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/wsas-java-dev
[Wsf-general] [wsas-java-dev] [commons-dev] Improvements to ad
Hmmm so is the only risk that someone may have a class called WSRequest??
If so I'm now -1 on putting it into the wso2.wsf namespace for the reasons
Thilina cites below.
Sorry for waffling on it but I (stupidly) thought that functions like
send() were exposed but they're not as they're methods of the WSRequest
object.
Sanjiva.
Thilina Gunarathne wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>> WSRequest IMHO is not standardized as XMLHttpRequest object.
> I thought we are going to provide the web services equivalent to the
> XMLHttpRequest.. May be we will be able to standardize it someday..
> IMHO it's should not be just another javascript library. It should be
> *THE* thing..
>
>> Thus, there should have been a situation one could initialize his own WSRequest
>> class. Thus, this will cause collisions.
> Good point... But AFAIKS this is a very very rare situation..
>> In this kind of a situation you
>> couldn't exactly say which class the Javascript engine might use to
>> initialize the object. Thus, we need some mechanism to avoid this
>> collision. That's why we use namespaces.
> IIRC yahoo namespace is the first thing which worried you when you saw
> the Yahoo UI toolkit and I had to put lot of efforts to convince you :)..
>
> IMHO using a wso2 namespace might prevent some users from using it, or
> at least it'll give them a bit backward impression, not because of it's
> WSO2 but due to the fact that it's something external (the same feeling
> you had towards yahoo)...
>
>> Is there an alternative to avoid this kind of collisions ?
> I don't see an alternative... But I don't see it as a rock solid reason
> to make it namespaced...May be my very little knowledge on javascript
> makes me oversee this..
>
> Thanks,
> Thilina
>> Thank you
>>
>>
>> Saminda
>>
>> Thilina Gunarathne wrote:
>>> Hi all,
>>> Sorry for jumping in this late..Better late than never :)..
>>> Saminda, What are the reasons for namespace qualifying this.. If we are
>>> doing this we need to do so across the whole board for all the WSRequest
>>> impls...
>>> I would not agree with this unless there is a concrete reason...
>>> Thanks,
>>> Thilina
>>> saminda abeyruwan wrote:
>>>>> Hi Rajika,
>>>>>
>>>>> Patch for making WSRequest, with the wso2.wsf namespace.
>>>>>
>>>>> Saminda
>>>>>
>>>>> saminda abeyruwan wrote:
>>>>>> Hi Sir,
>>>>>> Yes Sir, it's the same code in
>>>>>> http://wso2.org/repos/wso2/trunk/wsf/javascript/native/ we are referring
>>>>>> to.
>>>>>>>>> I believe you are referring prior to WSRequest.js. The simplest solution
>>>>>>>>> would be to start with native/WSRequest.js.
>>>>>>>> I'm referring to the stuff at
>>>>>>>> http://wso2.org/repos/wso2/trunk/wsf/javascript/native/. I think you
>>>>>>>> meant the same right?
>>>>>>>>
>>>>>>>>> We propose that main.js contains functions related to a namespace
>>>>>>>>> "WSO2.common", (ex: WSO2.common.send(args...)) will solve the namespace
>>>>>>>>> issue.
>>>>>>>> +1 but IMO it should be wso2.wsf.
>>>>>> main.js reside under commons/adminui project.
>>>>>> [https://wso2.org/repos/wso2/trunk/commons/adminui]. Should we use
>>>>>> "wso2.wsf" namespace for this too.
>>>>>>>>> As an example, WSO2.common.send(args...) is the wrapper function that
>>>>>>>>> uses WSRequest functionality to communicate with server. This is our
>>>>>>>>> original plan and we were waiting for a release of WSRequest to achieve
>>>>>>>>> this.
>>>>>>>> No I disagree- if there's a need to wrap WSRequest then we haven't got
>>>>>>>> WSRequest right. What is preventing you from doing
>>>>>>>> foo=new wso2.wsf.WSRequest()
>>>>>> +1.
>>>>>> Should we do this to XPI and ActiveX Object too, namespace qualifying
>>>>>> WSRequest object.
>>>>>> Thank you
>>>>>> Saminda
>>>>> _______________________________________________
>>>>> Wsas-java-dev mailing list
>>>>> Wsas-java-dev@wso2.org
>>>>> http://wso2.org/cgi-bin/mailman/listinfo/wsas-java-dev
>>>>>
>>>>>
>>> ------------------------------------------------------------------------
>>> Index: samples/firefox/google.html
>>> ===================================================================
>>> --- samples/firefox/google.html (revision 1205)
>>> +++ samples/firefox/google.html (working copy)
>>> @@ -2,11 +2,11 @@
>>>
>>> WSO2 WSRequest object
>>>
WSO2 WSRequest Object Demo-Google spell check
>>> -
>>> +
>>>
>>>
>>>
>>> - var wshttp = new WSRequest();
>>> + var wshttp = new wso2.wsf.WSRequest();
>>> function checkSpell()
>>> {
>>> @@ -97,7 +97,7 @@
>>>
>>>
>>>
>>> -
>>> + > checkSpell();return false;">
>>>
>>>
>>> your request xml
>>>
>>> Index: samples/firefox/zipcode.html
>>> ===================================================================
>>> --- samples/firefox/zipcode.html (revision 1205)
>>> +++ samples/firefox/zipcode.html (working copy)
>>> @@ -2,12 +2,12 @@
>>>
>>> WSO2 WSRequest object
>>>
WSO2 WSRequest Object Demo-Distance between two zip codes
>>> -
>>> +
>>>
>>>
>>>
>>> - var wshttp = new WSRequest();
>>> + var wshttp = new wso2.wsf.WSRequest();
>>> function test(){
>>> var option = new Array();
>>> wshttp.onreadystatechange = test1;
>>> Index: samples/firefox/greet.html
>>> ===================================================================
>>> --- samples/firefox/greet.html (revision 1205)
>>> +++ samples/firefox/greet.html (working copy)
>>> @@ -2,12 +2,12 @@
>>>
>>> WSO2 WSRequest object
>>>
WSO2 WSRequest Object Demo-Greet of the day
>>> -
>>> +
>>>
>>>
>>>
>>> - var wshttp = new WSRequest();
>>> + var wshttp = new wso2.wsf.WSRequest();
>>> function greet(){
>>> wshttp.onreadystatechange = state;
>>> Index: samples/firefox/googlesnyc.html
>>> ===================================================================
>>> --- samples/firefox/googlesnyc.html (revision 1205)
>>> +++ samples/firefox/googlesnyc.html (working copy)
>>> @@ -2,11 +2,11 @@
>>>
>>> WSO2 WSRequest object
>>>
WSO2 WSRequest Object Demo-Google spell check
>>> -
>>> +
>>>
>>>
>>>
>>> - var wshttp = new WSRequest();
>>> + var wshttp = new wso2.wsf.WSRequest();
>>> function checkSpell()
>>> {
>>> Index: samples/ie/greet_ie.html
>>> ===================================================================
>>> --- samples/ie/greet_ie.html (revision 1205)
>>> +++ samples/ie/greet_ie.html (working copy)
>>> @@ -2,12 +2,12 @@
>>>
>>> WSO2 WSRequest object
>>>
WSO2 WSRequest Object Demo-Greet of the day
>>> -
>>> +
>>>
>>>
>>>
>>> - var wshttp = new WSRequest();
>>> + var wshttp = new wso2.wsf.WSRequest();
>>> function greet(){
>>> var option = new Array();
>>> option['useSOAP'] = 1.1;
>>> Index: samples/ie/googlesnyc_ie.html
>>> ===================================================================
>>> --- samples/ie/googlesnyc_ie.html (revision 1205)
>>> +++ samples/ie/googlesnyc_ie.html (working copy)
>>> @@ -2,7 +2,7 @@
>>>
>>> WSO2 WSRequest demo
>>>
WSO2 WSRequest Object Demo-Google spell check
>>> -
>>> +
>>>
>>>
>>>
>>> @@ -10,7 +10,7 @@
>>> var key;
>>> var phrase;
>>> var wshttp = null;
>>> - wshttp = new WSRequest();
>>> + wshttp = new wso2.wsf.WSRequest();
>>> function search(){
>>> wshttp.onreadystatechange = callbackResult;
>>> Index: samples/ie/google_ie.html
>>> ===================================================================
>>> --- samples/ie/google_ie.html (revision 1205)
>>> +++ samples/ie/google_ie.html (working copy)
>>> @@ -2,7 +2,7 @@
>>>
>>> WSO2 WSRequest demo
>>>
WSO2 WSRequest Object Demo-Google spell check
>>> -
>>> +
>>>
>>>
>>>
>>> @@ -10,7 +10,7 @@
>>> var key;
>>> var phrase;
>>> var wshttp = null;
>>> - wshttp = new WSRequest();
>>> + wshttp = new wso2.wsf.WSRequest();
>>> function search(){
>>> wshttp.onreadystatechange = callbackResult;
>>> Index: samples/ie/zipcode_ie.html
>>> ===================================================================
>>> --- samples/ie/zipcode_ie.html (revision 1205)
>>> +++ samples/ie/zipcode_ie.html (working copy)
>>> @@ -2,11 +2,11 @@
>>>
>>> WSO2 WSRequest object
>>>
WSO2 WSRequest Object Demo-Distance between two zip codes
>>> -
>>> +
>>>
>>>
>>>
>>> - var wshttp = new WSRequest(true);
>>> + var wshttp = new wso2.wsf.WSRequest(true);
>>> function test(){
>>> // user need soap-not xml
>>> Index: WSRequest.js
>>> ===================================================================
>>> --- WSRequest.js (revision 1205)
>>> +++ WSRequest.js (working copy)
>>> @@ -14,8 +14,46 @@
>>> * limitations under the License.
>>> */
>>> -function WSRequest()
>>> -{
>>> +/**
>>> + * WSRequest object uses SOAP/HTTP|HTTPS. This object provides a wrpper
>>> for XMLHttpRequest object.
>>> + * This object belongs to the namespace wso2.wsf, thus, user can init
>>> it as follows,
>>> + * var foo = new wso2.wsf.WSRequest();
>>> + */
>>> +
>>> +/*
>>> +creating the wso2 global object
>>> +*/
>>> +if (typeof wso2 == 'undefined') {
>>> + //define the WSO2 global object
>>> +
>>> + wso2 = {};
>>> +}
>>> +
>>> +/*this will create the namespace required.*/
>>> +wso2.namespace = function() {
>>> + var a = arguments,o = null,i,j,d;
>>> + for (i = 0; i < a.length; i++) {
>>> + d = a[i].split(".");
>>> + o = wso2;
>>> +
>>> + for (j = (d[0] == "wso2")?1:0; j < d.length; j++) {
>>> + o[d[j]] = o[d[j]] || {};
>>> + o = o[d[j]];
>>> + }
>>> + }
>>> +
>>> + return o;
>>> +}
>>> +
>>> +wso2.init = function() {
>>> + this.namespace("wsf");
>>> +}
>>> +
>>> +wso2.init();
>>> +
>>> +
>>> +wso2.wsf.WSRequest = function() {
>>> +
>>> // data members
>>> // readyState
>>> this.readyState = 0;
>>
>>> ------------------------------------------------------------------------
>>> _______________________________________________
>>> Commons-dev mailing list
>>> Commons-dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/commons-dev
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.3 (GNU/Linux)
>
> iD8DBQFGCT6/Tt0cKycFPQgRAswXAJoCmP+2bKjB9HarFI7pL9Lbf1pNLACfS76s
> um3Vgq5DzcBWL7WTq2pEPp8=
> =hgz0
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Commons-dev mailing list
> Commons-dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/commons-dev
>
--
Sanjiva Weerawarana, Ph.D.
Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
email: sanjiva@wso2.com; cell: +94 77 787 6880; fax: +1 509 691 2000
"Oxygenating the Web Service Platform."
_______________________________________________
Wsf-general mailing list
Wsf-general@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/wsf-general
[wsas-java-dev] [commons-dev] Improvements to adminui javascrip
Hmmm so is the only risk that someone may have a class called WSRequest??
If so I'm now -1 on putting it into the wso2.wsf namespace for the reasons
Thilina cites below.
Sorry for waffling on it but I (stupidly) thought that functions like
send() were exposed but they're not as they're methods of the WSRequest
object.
Sanjiva.
Thilina Gunarathne wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>> WSRequest IMHO is not standardized as XMLHttpRequest object.
> I thought we are going to provide the web services equivalent to the
> XMLHttpRequest.. May be we will be able to standardize it someday..
> IMHO it's should not be just another javascript library. It should be
> *THE* thing..
>
>> Thus, there should have been a situation one could initialize his own WSRequest
>> class. Thus, this will cause collisions.
> Good point... But AFAIKS this is a very very rare situation..
>> In this kind of a situation you
>> couldn't exactly say which class the Javascript engine might use to
>> initialize the object. Thus, we need some mechanism to avoid this
>> collision. That's why we use namespaces.
> IIRC yahoo namespace is the first thing which worried you when you saw
> the Yahoo UI toolkit and I had to put lot of efforts to convince you :)..
>
> IMHO using a wso2 namespace might prevent some users from using it, or
> at least it'll give them a bit backward impression, not because of it's
> WSO2 but due to the fact that it's something external (the same feeling
> you had towards yahoo)...
>
>> Is there an alternative to avoid this kind of collisions ?
> I don't see an alternative... But I don't see it as a rock solid reason
> to make it namespaced...May be my very little knowledge on javascript
> makes me oversee this..
>
> Thanks,
> Thilina
>> Thank you
>>
>>
>> Saminda
>>
>> Thilina Gunarathne wrote:
>>> Hi all,
>>> Sorry for jumping in this late..Better late than never :)..
>>> Saminda, What are the reasons for namespace qualifying this.. If we are
>>> doing this we need to do so across the whole board for all the WSRequest
>>> impls...
>>> I would not agree with this unless there is a concrete reason...
>>> Thanks,
>>> Thilina
>>> saminda abeyruwan wrote:
>>>>> Hi Rajika,
>>>>>
>>>>> Patch for making WSRequest, with the wso2.wsf namespace.
>>>>>
>>>>> Saminda
>>>>>
>>>>> saminda abeyruwan wrote:
>>>>>> Hi Sir,
>>>>>> Yes Sir, it's the same code in
>>>>>> http://wso2.org/repos/wso2/trunk/wsf/javascript/native/ we are referring
>>>>>> to.
>>>>>>>>> I believe you are referring prior to WSRequest.js. The simplest solution
>>>>>>>>> would be to start with native/WSRequest.js.
>>>>>>>> I'm referring to the stuff at
>>>>>>>> http://wso2.org/repos/wso2/trunk/wsf/javascript/native/. I think you
>>>>>>>> meant the sa