Can I use different templatebindings for different projects

Posts   
 
    
KS
User
Posts: 55
Joined: 08-Aug-2006
# Posted on: 30-Aug-2006 23:37:13   

Hi We have 2 different LLBGenPro projects in same machine. Prj 1 wants to use different templatebindings from Prj 2. Is it possible ? If yes , How ?

Scenario is like this :: Prj 1 wants to use following templates :: 1.) entityAdapter.template 2.) entityIncludeAdapter.template

Prj 2 wants to use following templates :: 1.) entityAdapterModified.template 2.) entityIncludeAdapterModified.template

Thanks KS

Walaa avatar
Walaa
Support Team
Posts: 14987
Joined: 21-Aug-2005
# Posted on: 31-Aug-2006 08:40:33   

You get to select templates set against which the code is generated in the "Configure the code generation process" window, which appear when you press "Generate" in the designer.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39786
Joined: 17-Aug-2003
# Posted on: 31-Aug-2006 09:45:57   

To elaborate a bit more: create a new templatebindings file for: 1.) entityAdapterModified.template 2.) entityIncludeAdapterModified.template

and make sure that the 2 templates are bound to the same templateids as in the standard template bindings file.

And give it a precedence of 8 for example. So it will end up at the bottom of the list on tab 2. When you're generating project2, you move your bindings to the top of the list. This then makes the templateids in your bindings file overrule the standard one simple_smile . When you generate project 1, you leave the templatebindings file you made at the bottom.

Frans Bouma | Lead developer LLBLGen Pro
KS
User
Posts: 55
Joined: 08-Aug-2006
# Posted on: 31-Aug-2006 15:33:33   

Thanks Otis.

Gotcha. That's really kool.

KS
User
Posts: 55
Joined: 08-Aug-2006
# Posted on: 31-Aug-2006 16:05:38   

Now I want to add a new Interface(in a new file) for all Entities. All Entities will be derived from IMyInterface. I am comfortable modifying existing templates and generating code, however I dont know how to create a new template from scratch and generate it in new file and add that file to generated project (in my case to DBGeneric project).

Thanking you in Anticipation simple_smile

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39786
Joined: 17-Aug-2003
# Posted on: 31-Aug-2006 16:17:29   

(about the stacktrace/issue you posted, that's a known issue. Please fill in a filename simple_smile )

About the interface: you can add that interface inside the designer simple_smile Check Output specific settings tab in Using the designer -> Adding and editing entities.

Frans Bouma | Lead developer LLBLGen Pro
KS
User
Posts: 55
Joined: 08-Aug-2006
# Posted on: 31-Aug-2006 17:22:02   

Scenario :: I have 10 entities(mapped directly to some DB tables). Now I want all this entities to derive from IMyInterface.

Queries :: 1. Where do I need to put the file or actual interface IMyInterface ? 2. To mention that any EntityX want to implement any intrerface we have open [Check Output specific settings tab ] in EntityX's [Edit Properties] which takes InterfaceName and its Namespace. Correct me if I am wrong. Do I need to go to each Entity's [Check Output specific settings tab ] in designer explicitly and mention it or can I do for all from some place at one go.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39786
Joined: 17-Aug-2003
# Posted on: 01-Sep-2006 19:22:10   

KS wrote:

Scenario :: I have 10 entities(mapped directly to some DB tables). Now I want all this entities to derive from IMyInterface.

Queries :: 1. Where do I need to put the file or actual interface IMyInterface ?

In an include template, which allows you to generate the interface code into all entities simple_smile

  1. To mention that any EntityX want to implement any intrerface we have open [Check Output specific settings tab ] in EntityX's [Edit Properties] which takes InterfaceName and its Namespace. Correct me if I am wrong. Do I need to go to each Entity's [Check Output specific settings tab ] in designer explicitly and mention it or can I do for all from some place at one go.

You can set them all in one go, by using the plugin simple_smile right click 'Entities' in the project explorer -> run plugin -> select the plugin to add / remove namespaces interfaces simple_smile

Frans Bouma | Lead developer LLBLGen Pro