You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by "Pugh, Eric" <EP...@MuseumCompany.com> on 2001/10/09 18:31:06 UTC

BaseObject getByName question...

Hi,

I am trying to create a .vm file where based on a Vector of columnMaps, and
my original OM Object, I display a table cell with a form element, and pull
out of my OM object the corresponding data...

I am basing my work on just tweaking the newapp application, and the
velocimacro I am using is fromCell TableDescription TableName Data.

My actual code looks like this:

#foreach($column in $columns)
	<TR>
		#formCell($column.columnName $column.columnName
$entry.getByName("$column.columnName"))
	<TR>
#end

And all of this works great once I wrote my own getByName() method for my OM
object.  How come this method is declared by BaseObject, but is not
implemented by the default Torque OM building system?  It seems that if the
BaseObject declares it (and throws an exception if you call it), then the
default Torque OM building system should provide the method?  

Or is there another way of doing what I want?  I tried doing this:
$entry.({$column.columnName}) but that doesn't seem to be proper velocity
syntax.

Before I go and tweak my Torque code to create the method getByName in all
the BaseOm objects, I wanted to make sure this was something that isn't
already in there.  How do I contribute back this code if anyone wants it?

Eric

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: BaseObject getByName question...

Posted by John McNally <jm...@collab.net>.
The method is already in Object.vm (which creates the Base* classes). 
You need the property
addGetByNameMethod=true
set in your build.properties.  I am pretty sure this will be on by
default, so I do not know why you would be missing the methods in your
Base* classes.

john mcnally

"Pugh, Eric" wrote:
> 
> Hi,
> 
> I am trying to create a .vm file where based on a Vector of columnMaps, and
> my original OM Object, I display a table cell with a form element, and pull
> out of my OM object the corresponding data...
> 
> I am basing my work on just tweaking the newapp application, and the
> velocimacro I am using is fromCell TableDescription TableName Data.
> 
> My actual code looks like this:
> 
> #foreach($column in $columns)
>         <TR>
>                 #formCell($column.columnName $column.columnName
> $entry.getByName("$column.columnName"))
>         <TR>
> #end
> 
> And all of this works great once I wrote my own getByName() method for my OM
> object.  How come this method is declared by BaseObject, but is not
> implemented by the default Torque OM building system?  It seems that if the
> BaseObject declares it (and throws an exception if you call it), then the
> default Torque OM building system should provide the method?
> 
> Or is there another way of doing what I want?  I tried doing this:
> $entry.({$column.columnName}) but that doesn't seem to be proper velocity
> syntax.
> 
> Before I go and tweak my Torque code to create the method getByName in all
> the BaseOm objects, I wanted to make sure this was something that isn't
> already in there.  How do I contribute back this code if anyone wants it?
> 
> Eric
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: BaseObject getByName question...

Posted by Huy Do <hu...@tramada.com>.
Hi,

Can someone tell me the easiest way i can get the
name of a peer object which corresponds to a given table name.

Many Thanks

Huy

> -----Original Message-----
> From: Pugh, Eric [mailto:EPugh@MuseumCompany.com]
> Sent: Wednesday, 10 October 2001 2:31 AM
> To: 'turbine-user@jakarta.apache.org'
> Subject: BaseObject getByName question...
>
>
> Hi,
>
> I am trying to create a .vm file where based on a Vector of
> columnMaps, and
> my original OM Object, I display a table cell with a form
> element, and pull
> out of my OM object the corresponding data...
>
> I am basing my work on just tweaking the newapp application, and the
> velocimacro I am using is fromCell TableDescription TableName Data.
>
> My actual code looks like this:
>
> #foreach($column in $columns)
> 	<TR>
> 		#formCell($column.columnName $column.columnName
> $entry.getByName("$column.columnName"))
> 	<TR>
> #end
>
> And all of this works great once I wrote my own getByName()
> method for my OM
> object.  How come this method is declared by BaseObject, but is not
> implemented by the default Torque OM building system?  It seems
> that if the
> BaseObject declares it (and throws an exception if you call it), then the
> default Torque OM building system should provide the method?
>
> Or is there another way of doing what I want?  I tried doing this:
> $entry.({$column.columnName}) but that doesn't seem to be proper velocity
> syntax.
>
> Before I go and tweak my Torque code to create the method getByName in all
> the BaseOm objects, I wanted to make sure this was something that isn't
> already in there.  How do I contribute back this code if anyone wants it?
>
> Eric
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org