Tobia Conforto | 1 Aug 2007 01:20
Picon
Favicon

Re: [Flowscript] everything converted to "number" type?

Mark Lundquist wrote:
> I've got some CForms widgets of <datatype base="long"/>, so I expect
> that the widget value should be a java.lang.Long, right?

Widget's getValue() returns an Object, so that would make sense, yes.

> it seems like every reference to the widget value gets converted to a
> JS "number" type

Probably because all Java number types (including their wrapping objects
in java.lang) get converted to a JS Number, which sounds reasonable BTW.
I suppose you could find notes on the type mapping between Java and JS
on Rhino's website.  Rhino is the Javascript interpreter used by Cocoon.

Now, if it also converted java.lang.String to JS strings automatically,
it would have spared me many a headache... unfortunately that's a
conversion that Rhino seems reluctant to do.

> and truncated to an integer value.

I believe that a Java long is an integer type.

Tobia
Joerg Heinicke | 1 Aug 2007 01:49
Picon
Picon

Re: [Flowscript] everything converted to "number" type?

On 7/31/07 4:28 PM, Mark Lundquist wrote:

> (b) truncated to an integer value.

To prove this you need a number out of the integer scope.

> e.g. '3' if I input '3.5' in the form.

3.5 is for sure already truncated by the Java type conversion to Long. 
This has nothing to do with flowscript.

Joerg
Jason Johnston | 1 Aug 2007 02:59

Re: [CForms] q'n about <fd:group>

Mark Lundquist wrote:
> Hi,
> 
> I'm working on a time-reporting application with a form that contains 
> "day of the week" input fields for Sun-Sat (into which the user enters 
> their daily hours).  I'm looking for a way to aggregate those daily 
> hours fields within the form model so that I can easily iterate across 
> them in the flowscript.
> 
> I thought that I might be able to do that using <fd:group>, but I 
> realized I don't know how to traverse the resulting form instance in the 
> flowscript (where do I find the widgets), and (probably related) I don't 
> know how to designate them in the JXT.

Not sure from your description if fd:group is the best tool for your 
goal, but I'll try to answer your questions.

In flowscript, you can traverse the widget tree with the form instance's 
lookupWidget method:

    form.lookupWidget("groupA/groupB/field");

The argument is an xpath-like syntax.  Your fd:groups are container 
widgets so they'll be nodes in the path.

In your JXTemplate, you use the ft:group element.  See the Template 
section on 
http://cocoon.apache.org/2.1/userdocs/widgets/widget_group.html and let 
us know if you have any more questions.

(Continue reading)

gordopolis | 1 Aug 2007 08:02
Picon
Favicon

Log categories for POJOs implementing AbstractLogEnabled


How can I configure logging categories for a POJO that implements
AbstractLogEnabled?

Its methods (containing the logging statements) are called by various
Actions and Generators; before these calls are made, the actions/generators
call pojo.enableLogging(getLogger()) to initialize the POJO's logger.

I have confirmed that the logging works -- I see log entries in the default
log target. But how can I assign a category to them?

I have seen how sitemap components can have their category defined eg.
logger="...". I see that the log entries coming from my pojo are getting the
category of the calling component. I don't want that; I want to create a
special category just for my POJO.
--

-- 
View this message in context: http://www.nabble.com/Log-categories-for-POJOs-implementing-AbstractLogEnabled-tf4198209.html#a11940212
Sent from the Cocoon - Users mailing list archive at Nabble.com.
Niels van Kampenhout | 1 Aug 2007 11:36
Picon

Re: [Flowscript] everything converted to "number" type?

Mark Lundquist wrote:
> I've got some CForms widgets of <datatype base="long"/>, so I expect 
> that the widget value should be a java.lang.Long, right?  I'm trying to 
> do some arithmetic on these widget values in flowscript, and it seems 
> like every reference to the widget value gets (a) converted to a JS 
> "number" type, and (b) truncated to an integer value.  I have all kinds 
> of print() scaffolding crap in my flowscript now to try to get a handle 
> on this... and even, e.g.
> 
>     print (typeof someWidget.value);
> 
> prints "number" where I'd have expected it to print "object".  calling 
> toString() on the value likewise prints a truncated-to-integer value, 
> e.g. '3' if I input '3.5' in the form.  Please enlighten me :-)

Aren't you mixing up 'long' with 'double'? I think you need <datatype 
base="double"/> or <datatype base="decimal"/> for a value like 3.5...

See [1] for more info.

Regards
Niels

[1] http://cocoon.apache.org/2.1/userdocs/widgetconcepts/datatypes.html
xweber | 1 Aug 2007 13:12

Re: [cocoon 2.2.x] how to get request params in called block?


Grzegorz Kossakowski-3 wrote:
> 
> xweber pisze:
>> so, how to get request params in called block?
> 
> If parameters are simple strings you can pass them using such construct:
> servlet:someblock:/somepipeline?request1={request-param:request1}
> 
> Of course, such solution has it's own limitations but may be sufficient in
> many situations.
> 
> As you want to use some pipeline for processing XML stream I think that
> the best way would be to use servletService transformer.
> You need your XML data in the pipeline, so you should use:
> <map:generate type="stream">
>    <map:parameter name="form-name" value="name_of_request_parameter"/>
> <!-- the name 'form-name' is rather misleading -->
> </map:generate>
> 
> And then you should use servletService transformer:
> <map:transform type="servletService">
>    <map:parameter name="service"
> value="servlet:myBlock2:/dosomeprocessing"/>
> </map:transform>
> 

so if i got you right, there is no way to handle form processing in a called
block, because all information of the request is lost?

(Continue reading)

Rice Yeh | 1 Aug 2007 14:07
Picon

Re: [cocoon 2.2.x] how to get request params in called block?

There is a patch for cocoon-2066 in JIRA written by me that can solve this problem.

Rice

On 8/1/07, Grzegorz Kossakowski <gkossakowski <at> apache.org> wrote:
xweber pisze:
> hi,
>
> i want to deal e.g. html POST parameters in the called block. The sitemap in
> myBlock1 has something like:
> <map:generate src="servlet:myBlock2:/dosomeprocessing"/>
>
> but unfortunatly in the called block all parameters are gone.

It's a known problem and limitation of current implementation. See COCOON-2050[1] for some details.
Alex, actually I recommend you taking a look at JIRA page[2] for Servlet Service framework issues overview. This will give an idea what's
already there and what's not.

Also, voting for particular issues can speed up process of implementing them. Of course you should choose issues carefully, voting for all
of them will not help us anyhow. Speaking about myself, I would be very happy to work on all these issues but currently I'm busy with my
Google of Summer tasks that have highest priority.

> so, how to get request params in called block?

If parameters are simple strings you can pass them using such construct:
servlet:someblock:/somepipeline?request1={request-param:request1}

Of course, such solution has it's own limitations but may be sufficient in many situations.

As you want to use some pipeline for processing XML stream I think that the best way would be to use servletService transformer.
You need your XML data in the pipeline, so you should use:
<map:generate type="stream">
   <map:parameter name="form-name" value="name_of_request_parameter"/> <!-- the name 'form-name' is rather misleading -->
</map:generate>

And then you should use servletService transformer:
<map:transform type="servletService">
   <map:parameter name="service" value="servlet:myBlock2:/dosomeprocessing"/>
</map:transform>

> Alex
>
> PS: is there any "pure" cocoon 2.2 project out there, so i could get a sneak
> peak how to put all things together?

Unfortunately, not yet. I'm working on such project, but as I said above, GSoC is more important for me now.


[1] https://issues.apache.org/jira/browse/COCOON-2050
[2] https://issues.apache.org/jira/secure/IssueNavigator.jspa?sorter/field=created&sorter/order=DESC


--
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe <at> cocoon.apache.org
For additional commands, e-mail: users-help <at> cocoon.apache.org


Valentin Jacquemin | 1 Aug 2007 15:10
Picon
Gravatar

cocoon against jdk 6

Has anyone builded cocoon 2.1.10, all blocks included, against jdk 6?

I got many problems....

Valentin Jacquemin
Jeroen Reijn | 1 Aug 2007 15:39
Picon

RE: cocoon against jdk 6

Hi Valentin,

I have not tried it yet, but what kind of problems are you experiencing?

Kind regards,

Jeroen Reijn

-----Original Message-----
From: Valentin Jacquemin [mailto:jacqueminv <at> gmail.com]
Sent: Wednesday, August 01, 2007 3:10 PM
To: users <at> cocoon.apache.org
Subject: cocoon against jdk 6

Has anyone builded cocoon 2.1.10, all blocks included, against jdk 6?

I got many problems....

Valentin Jacquemin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe <at> cocoon.apache.org
For additional commands, e-mail: users-help <at> cocoon.apache.org
Alan Menant | 1 Aug 2007 15:58
Picon

form.getChild() function problem

Hello,

I'm trying to get all widgets from a form with the getChildren function :

var form = new Form(myForm.xml);
var myWidgets = form.getChildren();
form.showForm("myform-display-pipeline");

But I get an error message telling getChildren() is not function (form.getChild('xxx') works fine). I saw the function in Cocoon 2.1.10 API but I'm using Cocoon 2.2 (I got the same error with Cocoon 2.1.9).

May this useful function have been removed ?


Alan


Gmane