cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject [cforms] writing my own data type
Date Wed, 24 Mar 2004 15:05:28 GMT
I'm trying to write my own data type implementation, but I fail on access
restrictions in the AbstractDataType of Woody/Cocoon Forms.

I want to have a data type that's based on long and formatted as currency,
similar to the one already existing, but

1. working:

When having

  <wd:datatype base="long">
    <wd:convertor type="formatting" variant="currency"/>
  </wd:datatype>

in the form definition I get my amount nicely formatted, but can not save it
back. Even a value '123' ends in a ParseException. As I do not want to dive into
XReporter I decided to write my own one without XReporter.

2. and not ignoring cents:

When having the long value 1234567 it gets formatted as "1.234.567,00 €",
meaning that I can never save cents. It should be "12.345,67 €".


Back to the actual problem:

I extended AbstractDataType and AbstractDataTypeBuilder and copied more or less
the LongType and LongTypeBuilder. But I fail at

    type.setArrayType(arrayType);
    type.setBuilder(this);

as these both methods have default access. Is there any specific reason for it?
Even passing arrayType and this to the constructor of my AmountType would only
work if the methods would have protected access. So what about changing the
access of those methods to at least protected, maybe public?

Some comments on the existing long/formatting/currency issue?

Regards,

Joerg


Mime
View raw message