Generate Enums from tables in version 2.0

Posts   
 
    
pg
User
Posts: 13
Joined: 19-Oct-2005
# Posted on: 21-Dec-2006 11:38:55   

In version 1.0 of LLBL gen there was a very useful task performer and a DLL (Gen_Enums.dll), used to generate enumerators from certain tables, automatically.

The tables were described in a task performer XML configuration file.

Is there a way to do that in LLBL version 2.00?

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 21-Dec-2006 15:09:03   

If you mean Enums to represent values of certain fields, then I guess you need an Enum Type Converter.

Please check the following thread: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=7355

pg
User
Posts: 13
Joined: 19-Oct-2005
# Posted on: 21-Dec-2006 15:40:28   

No, not exactly. In the previous version (1.0) there was a task performer XML config file and a DLL that we used to generate a file (we called it lookupEnums.cs) that had several Db tables converted to enums. For example, say we had the following table:

Table1 (int, varchar) with values:

1, value1 2, value2 3, value3

This would be converted to an enum:

Enum table1:int { value1 = 1, value2 = 2, value3 = 3, }

This was very useful because we could create enums for certain tables that rarely changed.

We saved this task performer in TaskPerformer Folder in LLBLGEN folder and was listed in the taskPerformer dropdown in llbl 'generate' dialog. So you could select this task and then by clicking generate you could have the enums automatically populated from the DB.

We had downloaded this from downloads section of llbl site for version 1.00.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 22-Dec-2006 10:06:22   

The taskperformer hasn't been ported to v2.0, but it should be fairly easy to do. The taskperformer framework hasnt been changed much in v2.0. The tasks and templates system has been redesigned to make it easier to add tasks to the list of tasks to run at generation time, which is documented in the SDK for v2.0, and it doesn't take a lot of effort to port v1.0 generator configs to v2.0 tasks, if you have to (you can also use existing tasks and simply change the parameters and save them in your preset)

Frans Bouma | Lead developer LLBLGen Pro
pg
User
Posts: 13
Joined: 19-Oct-2005
# Posted on: 22-Dec-2006 13:47:54   

I did managed to convert the task performer to a preset but that doesn't seem to work. I guess this happens because the task performer used a DLL file that executed the tasks.

If I use the same DLL file with the new preset I guess it won't work since the XML schema of the preset is different than the XML schema of the task performer:

For example the task performer had the following form:

generatorConfiguration> <name>Generate Code Enumerators</name> <description>Creates a Enum from code table</description> <tasks> <taskGroup Name="Generate Enums"> <task name="Generate Enums" assemblyFilename="Gen_Enums.dll" taskPerformerClass="Gen_Enums.Performer"> <parameter name="ConnectionString" value=""/> <parameter name="No_Of_Tables" value="21"/> <parameter name="OutputfileName" value="LookupEnums.cs"/>

<parameter name="EnumName_1" value="ContactType"/> <parameter name="EnumType_1" value="int"/> <parameter name="SelectSQL_1" value="Select * from Table1 Order by Table1ID"/> <parameter name="IDField_1" value="Table1ID"/> <parameter name="DescField_1" value="Name"/>

.....etc

Even if I convert this to a preset (which I did), it won't work with the previous library "Gen_Enums.dll" looking for this specific XML schema. right?

pg
User
Posts: 13
Joined: 19-Oct-2005
# Posted on: 22-Dec-2006 14:07:51   

I want something similar to that:

http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=1125&HighLight=1

for version 2.00

Chester
Support Team
Posts: 223
Joined: 15-Jul-2005
# Posted on: 23-Dec-2006 23:20:31   

That was a 3rd party supplied asset, so you'd have to re-create this in version 2.0 if it is something you really wanted.

pg
User
Posts: 13
Joined: 19-Oct-2005
# Posted on: 24-Dec-2006 13:01:55   

Done! I realised there was a source code along with this DLL. I have it ready for version 2.00.

Do you want it? It is really useful. You can create a, similar to version 1.00, third party downloads section under version 2.00 and put it there for other people to use it.

Chester
Support Team
Posts: 223
Joined: 15-Jul-2005
# Posted on: 24-Dec-2006 22:23:19   

You can attach your code to this thread and we'll take a look at it. Thanks for sharing. simple_smile

pg
User
Posts: 13
Joined: 19-Oct-2005
# Posted on: 27-Dec-2006 11:02:09   

Chester wrote:

You can attach your code to this thread and we'll take a look at it. Thanks for sharing. simple_smile

How can I do that? It is .zip file with the source code (.net 2.0 c# solution) and also a readme file and a .tasks file.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 27-Dec-2006 11:04:53   

pg wrote:

Chester wrote:

You can attach your code to this thread and we'll take a look at it. Thanks for sharing. simple_smile

How can I do that? It is .zip file with the source code (.net 2.0 c# solution) and also a readme file and a .tasks file.

You can also send it to support AT llblgen.com and I'll post it on the website simple_smile The 'General' forum doesn't allow attachments.

Frans Bouma | Lead developer LLBLGen Pro
pg
User
Posts: 13
Joined: 19-Oct-2005
# Posted on: 28-Dec-2006 17:08:13   

Otis wrote:

pg wrote:

Chester wrote:

You can attach your code to this thread and we'll take a look at it. Thanks for sharing. simple_smile

How can I do that? It is .zip file with the source code (.net 2.0 c# solution) and also a readme file and a .tasks file.

You can also send it to support AT llblgen.com and I'll post it on the website simple_smile The 'General' forum doesn't allow attachments.

Sent.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 28-Dec-2006 17:23:20   

Received! simple_smile

I'll add it tomorrow (friday). Thanks for the work on this! simple_smile

(edit) posted simple_smile

Frans Bouma | Lead developer LLBLGen Pro
wtijsma
User
Posts: 252
Joined: 18-Apr-2006
# Posted on: 30-Mar-2007 13:58:39   

Otis wrote:

Received! simple_smile

I'll add it tomorrow (friday). Thanks for the work on this! simple_smile

(edit) posted simple_smile

Can't find it, where is it posted? Thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 30-Mar-2007 14:38:40   

It was posted on the site but the publish flag wasn't checked flushed .

I've published the task performer now, it's available in the 3rd party section.

Frans Bouma | Lead developer LLBLGen Pro
wtijsma
User
Posts: 252
Joined: 18-Apr-2006
# Posted on: 30-Mar-2007 14:40:30   

Otis wrote:

It was posted on the site but the publish flag wasn't checked flushed .

I've published the task performer now, it's available in the 3rd party section.

Thanks!

bruynr
User
Posts: 2
Joined: 27-Nov-2007
# Posted on: 27-Nov-2007 13:29:04   

I am still searching for the posted generator, but I really can't find it. I can't even find the 3rd party section on the site!

Could you please post a direct link?

And does the generator still work with 2.5, or is there another solution?

Regards,

Roel

wtijsma
User
Posts: 252
Joined: 18-Apr-2006
# Posted on: 27-Nov-2007 13:31:05   

bruynr wrote:

I am still searching for the posted generator, but I really can't find it. I can't even find the 3rd party section on the site!

Could you please post a direct link?

And does the generator still work with 2.5, or is there another solution?

Regards,

Roel

Hi Roel,

See if you can get to this url:

http://www.llblgen.com/pages/secure/ListDownloads.aspx?ProductVersion=4#10

Best Regards, Wiebe Tijsma

bruynr
User
Posts: 2
Joined: 27-Nov-2007
# Posted on: 27-Nov-2007 13:39:25   

Can't get there, redirects me to defaultgeneric.aspx, with a return URL. Clearly it wants me to log in.

Is it a problem I am not a customer yet?

Regards,

Roel

wtijsma
User
Posts: 252
Joined: 18-Apr-2006
# Posted on: 27-Nov-2007 13:40:29   

bruynr wrote:

Can't get there, redirects me to defaultgeneric.aspx, with a return URL. Clearly it wants me to log in.

Is it a problem I am not a customer yet?

Regards,

Roel

Hi Roel,

Yes this is a customer's only area.

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 28-Nov-2007 12:12:38   

We are sorry but non-customers can only download the LLBLGen Pro Demo version. All other downloadables are for customers.