Alternatively Ean, and maybe even better: in an ideal world what would you use
in place of the MiniLang/simple-method code (regardless of whether or not it
exists already)?
As we've done in the past, if there is anything that represents a sufficient
efficiency gain for development and maintenance it may very well be worth the
transition to it.
-David
Al Byers wrote:
Ean,
Hey, if Andrew can see the light and convert then there may even be hope
for
you :0)
-Al
On 6/6/07, Ean Schuessler <[EMAIL PROTECTED]> wrote:
I realize that this isn't productive in any way... but... Minilang is the
work
of the Devil and I will do anything I can not to write code in it.
Just thought I'd chime in. ;-)
On Monday 04 June 2007 03:57:10 pm Al Byers wrote:
> I was aware of the "call" methods, but here is the code that I wrote in
> order to get the first x characters of the text body to use as a
> description:
>
> <call-object-method method-name="length" obj-field-name="
> parameters.textData" ret-field-name="textDataLen"/>
> <log level="info" message="textDataLen:${textDataLen}"/>
> <property-to-field resource="forum" property="descriptLen"
> field-name="descriptLen" />
> <log level="info" message="descriptLen:${descriptLen}"/>
> <set field="dblTextDataLen" from-field="textDataLen"
> type="Double"/> <set field="dblDescriptLen" from-field="descriptLen"
> type="Double"/> <call-class-method method-name="min"
> class-name="java.lang.Math" ret-field-name="subStringLen">
> <field field-name="dblTextDataLen" type="double"/>
> <field field-name="dblDescriptLen" type="double"/>
> </call-class-method>
> <set field="intSubStringLen" from-field="subStringLen"
> type="Integer"/>
> <log level="info" message="subStringLen:${subStringLen}"/>
> <set field="zeroValue" value="0" type="Integer"/>
> <call-object-method method-name="substring" obj-field-name="
> parameters.textData" ret-field-name="subDescript">
> <field field-name="zeroValue" type="int"/>
> <field field-name="intSubStringLen" type="int"/>
> </call-object-method>
> <log level="info" message="subDescript:${subDescript}"/>
>
> As you can see there is a lot of code just to get the variables into
the
> right type for calling the class and object methods. Does anyone see a
> better way to do this?
>
> I agree that it would make sense to put any added functionality in the
map
> processor, but then you have to create a file ( don't you? ) just to do
one
> little thing.
--
Ean Schuessler, CTO
[EMAIL PROTECTED]
214-720-0700 x 315
Brainfood, Inc.
http://www.brainfood.com