• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Velocity Template Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Velocity Template Question


  • Subject: Re: Velocity Template Question
  • From: Mike Schrag <email@hidden>
  • Date: Fri, 20 Nov 2009 21:45:09 -0500

containsObject is an NSArray method, but these objects are actually Entity Modeler's non-WO versions of the EO classes, which are java.util.List/java.util.Set, so if it has any chance of working you will need to use contains instead containsObject. I've never really tried to do this, though, and I don't know what the actual limits of the evaluation engine in velocity are. You're also not showing where the "code" variable came from ... was that a getEntityNamed("something") assignment earlier?

On Nov 20, 2009, at 3:46 PM, Andrew Lindesay wrote:

> Hi Mike;
>
> You are right; I'm trying to add a method to the entitys' superclasses for fetching based on "code" if the "code" attribute is present.  I'm trying to achieve what I had before using velocity.  I am doing something like this, but the #if is not firing;
>
>> #if ($entity.sortedClassAttributes.containsObject(code))
>> 	@SuppressWarnings("unchecked")
>> 	public static nz.co.orcon.osm.eo.main.OcnDuration fetchByCode(EOEditingContext ec, String code) {
>> 		....
>>  	}
>>
>> 	...
>>
>> #end
>
> cheers.
>
> ___
> Andrew Lindesay
> www.lindesay.co.nz
>


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Velocity Template Question (From: Andrew Lindesay <email@hidden>)
 >Re: Velocity Template Question (From: Chuck Hill <email@hidden>)
 >Re: Velocity Template Question (From: Mike Schrag <email@hidden>)
 >Re: Velocity Template Question (From: Andrew Lindesay <email@hidden>)
 >Re: Velocity Template Question (From: Mike Schrag <email@hidden>)
 >Re: Velocity Template Question (From: Andrew Lindesay <email@hidden>)

  • Prev by Date: Re: back to deploy problems , with success
  • Next by Date: [OT] Weird Boolean/ Wrapper class bug
  • Previous by thread: Re: Velocity Template Question
  • Next by thread: Re: Velocity Template Question
  • Index(es):
    • Date
    • Thread