Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » JET2 User Regions(Having problems with the <c:userRegion> tag)
JET2 User Regions [message #989384] Wed, 05 December 2012 23:46 Go to next message
Phillip Drew is currently offline Phillip Drew
Messages: 75
Registered: October 2012
Member
Basically I'm using a JET2 template to generate a JET1 template and in order to let users customise the JET1 template I am trying to insert user regions into the JET2 template.

Note: I've changed the JET1 tags to '<$' and '$>'

I've tried using the following line in my JET2 template:

<c:userRegion><$//Custom Code Start$><c:initialCode></c:initialCode><$//Custom Code End$></c:userRegion>

so that in the JET1 template it will look like:

<$//Custom Code Start$><$//Custom Code End$>

which will obviously not show up in the JET1 String result. The same line is used in multiple places.

In my understanding I should be able to edit the generated JET1 template and put whatever I want between those <$//Custom Code$> tags and not have it overwritten when I run the JET2 transform.

However when I try editing the generated JET1 template by putting anything inside the userRegion, re-running the JET2 transform puts the first userRegion contents inside every single userRegion in the entire generated document.

eg. in the JET1 template I add something to the userRegion

<$//Custom Code Start$> Something in here <$//Custom Code End$>

and then after running the JET2 transform every single set of custom code tags contains the contents

(eg. <$//Custom Code Start$> Something in here <$//Custom Code End$>)

Am I misunderstanding something about the user regions?
Could the problem be related to using recursive <c:include> tags?

Thanks
Re: JET2 User Regions [message #989563 is a reply to message #989384] Thu, 06 December 2012 18:00 Go to previous message
Paul Elder is currently offline Paul Elder
Messages: 849
Registered: July 2009
Senior Member
Phillip:

Each custom code region needs a unique identifier in the lead in to each region. So your template could have something like:

<c:userRegion><$//Custom Code Start 01$><c:initialCode></c:initialCode><$//Custom Code End$></c:userRegion>

...

<c:userRegion><$//Custom Code Start 02$><c:initialCode></c:initialCode><$//Custom Code End$></c:userRegion>

...
Previous Topic:JET2 Traversing Trees
Next Topic:[Xpand] Running Xpand Workflow via Equinox Launcher
Goto Forum:
  


Current Time: Fri Oct 24 12:09:01 GMT 2014

Powered by FUDForum. Page generated in 0.01921 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software