Book a Demo

Author Topic: Passing parameters to templates  (Read 3636 times)

Vincenzo

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Passing parameters to templates
« on: February 14, 2008, 03:18:30 am »
Hi,
I just want to know if there is a possibility to pass parameters to a template called through the control macro

%list=<TemplateName> @separator=<string> @indent=<string> [<conditions>]%

I know that if you call a template directly like this %Customtemplate($parameter1, $parameter2)%
it is possible

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Passing parameters to templates
« Reply #1 on: February 14, 2008, 01:00:29 pm »
No, it's not possible.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Passing parameters to templates
« Reply #2 on: February 14, 2008, 03:50:08 pm »
Simon,

Didn't this come up before sometime?

[This is not my primary field of interest so I may not have the correct context.]


Is there any workaround, or an alternate approach that might achieve a suitable end result?

David
« Last Edit: February 14, 2008, 04:22:35 pm by Midnight »
No, you can't have it!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Passing parameters to templates
« Reply #3 on: February 14, 2008, 04:19:07 pm »
No, I'm not aware of it coming up before.

I believe that you can recalcalate any variable in any template that has been called.

Alternatively if you're going to call the list multiple times to get different results (for the same items in the list) you'll need to list over a custom template.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Passing parameters to templates
« Reply #4 on: February 14, 2008, 04:24:09 pm »
Sorry about that Simon,

Somehow I got the wrong impression about what was being discussed. Thank goodness it isn't my field of interest...

Vincenzo: What end result are you trying to achieve?

David
No, you can't have it!

Vincenzo

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Passing parameters to templates
« Reply #5 on: February 15, 2008, 01:06:39 am »
Hi,
at first thanks for your quick responses. What I want to do is to create automatically Classes that implement the J2EE DAO Pattern (see on http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html). For this purpose I developed my own small UML profile, that contains the stereotypes <<persistent>>, <<persistenceData>> and <<primaryKey>>.

<<persistenceData>> is meant to be applied only on one peristent class. For all the others I use <<persistent>>.
<<primaryKey>> is used to mark attributes or associationends of classes that are needed to idenify instances of the class.

For each class marked with <<persistent>> or <<persistenceData>> I want to produce a DAO Interface and a DAO Class implementation. Furthermore I want to create an abstract DAO factory and concrete DAO factories for each DBMS to use.

For this purpose <<persistenceData>> additionaly defines some tags like databaseProductName, where I specify the different database product names in a comma separated list. A value for this tag could look like this "MySQL,Derby,HSQLDB".

My problem is now, that if I want to produce attributes and methods for the abstract DAO factory (see figure 9.8 on http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html)
I need first to retrieve all the names of classes to persist and the values of the tags of <<persistenceData>>. Furthermore I want to use the names specified in databaseProductName to produce concrete DAO factories with name like this MySQL_DAOFactory, Derby_DAOFactory and HSQLDB_DAOFactory.

How can I achieve this without changing my uml profile?

Can it be that the transformation language used in EA is to weak to express such transformations?

Thanks in advance for your replies.