Tag to reference lgp project name in custom templates

Posts   
 
    
ccsdev
User
Posts: 7
Joined: 13-Dec-2006
# Posted on: 05-Feb-2007 23:07:08   

Q:Is there a tag to get the .lgp project file name?

I would like to refer to the name of the .lgp project file in our custom templates.

E.g.,

using System; using CompanyName.ProjectSpecificName.Orm.DatabaseSpecific; using CompanyName.ProjectSpecificName.Orm.EntityClasses; using CompanyName.ProjectSpecificName.Orm.FactoryClasses; using CompanyName.ProjectSpecificName.Orm.HelperClasses;

using SD.LLBLGen.Pro.ORMSupportClasses;

namespace CompanyName.ProjectSpecificName.Factory

...

I would like the "ProjectSpecificName" to be the name of the .lgp project file.

How do I get that? Is there a better way?

Thanks in advance!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39786
Joined: 17-Aug-2003
# Posted on: 06-Feb-2007 10:55:03   

The executingGenerator object, passed in to the .lpt template, contains the project object. Please check the reference manual of the SDK for all properties of the project object. You'll see that it has a property called ProjectLocationPathFilename, and also a ProjectName property.

Frans Bouma | Lead developer LLBLGen Pro
ccsdev
User
Posts: 7
Joined: 13-Dec-2006
# Posted on: 06-Feb-2007 17:19:31   

Thank you very much for the feedback. I downloaded the SDK and referred the documentation. I do see "ProjectName" and would like to get that property when I use the the TemplateStudio.exe.

I tried <[ProjectName]> tag but that does not work. Can you point me to some sample code to make this property visible inside the template studio? Also, inside the TemplateStudio, when I type <[ and hit CTRL-ENTER, I would like to see ProjectName listed in the IntelliSense.

I'm new to using the TemplateStudio and trying to figure out putting custom tags in.

Thanks in advance for your help.

jbb avatar
jbb
User
Posts: 267
Joined: 29-Nov-2005
# Posted on: 06-Feb-2007 17:31:39   

Hello,

if you have a project object like says Frans, you can access directly to the property Project.ProjectName that contains the project name. It could be find with the lpt template.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39786
Joined: 17-Aug-2003
# Posted on: 06-Feb-2007 17:43:50   

In .lpt, you use something like: <%=_executingGenerator.ProjectDefinition.ProjectName%>

which then results in teh project name. You're using TDL statements (the <[ ]>), which are for .template files. TDL is our own simpler template language, which is limited but also easier to use. If you want to access the whole project object model, .lpt templates are necessary as these are more flexible (you can do everything simple_smile ).

Frans Bouma | Lead developer LLBLGen Pro
ccsdev
User
Posts: 7
Joined: 13-Dec-2006
# Posted on: 07-Feb-2007 17:40:31   

I'm going need some help here. I thought TemplateStudio is all you have to develop templates (and the other choice is Notepad.exe simple_smile ).

I'm not sure I understand .lpt templates but interested in learning the tool. What is .lpt template? Where can I find more info on that? How do I use it to develop template files? Can you point me to any help file or sample code, please?

Appreciate your help!

Walaa avatar
Walaa
Support Team
Posts: 14987
Joined: 21-Aug-2005
# Posted on: 07-Feb-2007 18:09:44   

Please refer to the LLBLGen Pro SDK manual, & Template Studio documentation for more info. These are downloadable from the customers download section.