You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Pier Fumagalli (JIRA)" <ji...@apache.org> on 2005/11/23 22:30:36 UTC
[jira] Created: (COCOON-1697) Allow request parameters to be used in "for (var k in h)" kind of Javascript Loops
Allow request parameters to be used in "for (var k in h)" kind of Javascript Loops
----------------------------------------------------------------------------------
Key: COCOON-1697
URL: http://issues.apache.org/jira/browse/COCOON-1697
Project: Cocoon
Type: Improvement
Components: - Flowscript, * Cocoon Core
Versions: 2.1.8
Reporter: Pier Fumagalli
Priority: Minor
Attachments: patch.txt
As far as I can see, in the "cocoon" object passed to the flow environment, I always have to access the request parameter names and all values as Java Enumeration(s), therefore, I can't use the "for (var name in array)" kind of loop.
All I want to do is something extremely simple, like this:
for (var name in cocoon.request.parameters) {
print("PARAMETER -> " + name);
print(" VALUE -> " + cocoon.request.parameters[name]);
print(" LENGTH -> " + cocoon.request.parameters[name].length);
for (var position in cocoon.request.parameters[name]) {
var value = cocoon.request.parameters[name][position];
print (" @[" + position + "] => " + value);
}
}
Apparently, but I might have overlooked something, there's currently no way of doing this.
I've created a simple patch, that allows the above mentioned flowscript to work.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Updated: (COCOON-1697) Allow request parameters to be used
in "for (var k in h)" kind of Javascript Loops
Posted by "David Crossley (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/COCOON-1697?page=all ]
David Crossley updated COCOON-1697:
-----------------------------------
Other Info: [Patch available]
> Allow request parameters to be used in "for (var k in h)" kind of Javascript Loops
> ----------------------------------------------------------------------------------
>
> Key: COCOON-1697
> URL: http://issues.apache.org/jira/browse/COCOON-1697
> Project: Cocoon
> Type: Improvement
> Components: * Cocoon Core, - Flowscript
> Versions: 2.1.8
> Reporter: Pier Fumagalli
> Priority: Minor
> Attachments: patch.txt
>
> As far as I can see, in the "cocoon" object passed to the flow environment, I always have to access the request parameter names and all values as Java Enumeration(s), therefore, I can't use the "for (var name in array)" kind of loop.
> All I want to do is something extremely simple, like this:
> for (var name in cocoon.request.parameters) {
> print("PARAMETER -> " + name);
> print(" VALUE -> " + cocoon.request.parameters[name]);
> print(" LENGTH -> " + cocoon.request.parameters[name].length);
> for (var position in cocoon.request.parameters[name]) {
> var value = cocoon.request.parameters[name][position];
> print (" @[" + position + "] => " + value);
> }
> }
> Apparently, but I might have overlooked something, there's currently no way of doing this.
> I've created a simple patch, that allows the above mentioned flowscript to work.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Updated: (COCOON-1697) Allow request parameters to be used
in "for (var k in h)" kind of Javascript Loops
Posted by "Ross McDonald (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/COCOON-1697?page=all ]
Ross McDonald updated COCOON-1697:
----------------------------------
Attachment: FOM_Cocoon-2.1.9.patch.txt
first part of patch for this issue, implemented and test with Cocoon 2.1.9
> Allow request parameters to be used in "for (var k in h)" kind of Javascript Loops
> ----------------------------------------------------------------------------------
>
> Key: COCOON-1697
> URL: http://issues.apache.org/jira/browse/COCOON-1697
> Project: Cocoon
> Type: Improvement
> Components: * Cocoon Core, - Flowscript
> Versions: 2.1.8
> Reporter: Pier Fumagalli
> Priority: Minor
> Attachments: FOM_Cocoon-2.1.9.patch.txt, patch.txt
>
> As far as I can see, in the "cocoon" object passed to the flow environment, I always have to access the request parameter names and all values as Java Enumeration(s), therefore, I can't use the "for (var name in array)" kind of loop.
> All I want to do is something extremely simple, like this:
> for (var name in cocoon.request.parameters) {
> print("PARAMETER -> " + name);
> print(" VALUE -> " + cocoon.request.parameters[name]);
> print(" LENGTH -> " + cocoon.request.parameters[name].length);
> for (var position in cocoon.request.parameters[name]) {
> var value = cocoon.request.parameters[name][position];
> print (" @[" + position + "] => " + value);
> }
> }
> Apparently, but I might have overlooked something, there's currently no way of doing this.
> I've created a simple patch, that allows the above mentioned flowscript to work.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Updated: (COCOON-1697) Allow request parameters to be used
in "for (var k in h)" kind of Javascript Loops
Posted by "Ross McDonald (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/COCOON-1697?page=all ]
Ross McDonald updated COCOON-1697:
----------------------------------
Attachment: FOM_RequestParameters-2.1.9.patch.txt
second part of the patch for this issue, implemented and tested with cocoon 2.1.9
> Allow request parameters to be used in "for (var k in h)" kind of Javascript Loops
> ----------------------------------------------------------------------------------
>
> Key: COCOON-1697
> URL: http://issues.apache.org/jira/browse/COCOON-1697
> Project: Cocoon
> Type: Improvement
> Components: * Cocoon Core, - Flowscript
> Versions: 2.1.8
> Reporter: Pier Fumagalli
> Priority: Minor
> Attachments: FOM_Cocoon-2.1.9.patch.txt, FOM_RequestParameters-2.1.9.patch.txt, patch.txt
>
> As far as I can see, in the "cocoon" object passed to the flow environment, I always have to access the request parameter names and all values as Java Enumeration(s), therefore, I can't use the "for (var name in array)" kind of loop.
> All I want to do is something extremely simple, like this:
> for (var name in cocoon.request.parameters) {
> print("PARAMETER -> " + name);
> print(" VALUE -> " + cocoon.request.parameters[name]);
> print(" LENGTH -> " + cocoon.request.parameters[name].length);
> for (var position in cocoon.request.parameters[name]) {
> var value = cocoon.request.parameters[name][position];
> print (" @[" + position + "] => " + value);
> }
> }
> Apparently, but I might have overlooked something, there's currently no way of doing this.
> I've created a simple patch, that allows the above mentioned flowscript to work.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira