is Java Supported?

Jul 30, 2008 at 1:55 PM
Edited Aug 6, 2008 at 2:34 PM
Hi Stein,

First of all let me tell you that your code generator rules, I download it yesterday and with no or few documentation I manage to build a very complicated template for my project that just start, I'm from colombia and this project is gonna be for the goverment of Honduras, I just have one little question how can I make java names from the field names like user_table for properties and getters and  setters functions (userTable, getUserTable(), setUserTable() ), I need something like FixedName but I have to check if is a java proper name, there is a way to make my own properties so I can use them in my templates?

Please e-mail me or something ;)
Coordinator
Aug 5, 2008 at 12:14 AM
Edited Aug 5, 2008 at 12:17 AM

Hello,

You can set your own properties by changing/adding field/table properties. To do this:

1. Select the fourth tab (DB Layout Settings)

2. Select the second tab in the DB Layout Settings - Table Field Text . (this will be the third tab in future versions)

You will see a table of field names and you will see script that can be assigned to each field. The code is Python. For example, you will see the FixedName field is assigned the script FixName(FieldName). This calls the FixName function during the processing of database fields. You will find the FixName function in the code window below this table. Again this is all Python. You can add logic for any table or column property from here. You will notice some simple functions, like FixName, as well as some very complex logic that builds the SQL statements for the tables. All of this is user changeable.

These values are stored in the default.dbs layout file located in the program directory. So you can make different files for different project types.

Hope this helps.

Regards,

Stein
Aug 5, 2008 at 3:47 PM
Edited Aug 6, 2008 at 2:36 PM
Hi Stein,

I just did the steps you seggested,
example  FixedName,
my function JavaSetterName type Field,
I use muy function inserting the tag <#JavaSetterName#> manually  (because the function does not apear in the window tooltip of the other functions, I soppouse is meant like that, isn't it? )
then I try to use my function in a template (in a detail section because is type field) but a get an error  that says : " Error in EvalFuntions seccion main, detail level New Datatype"
and if I try changing the type of the function to Table and use the function in a section (not inside a detail), I don't get an error, but in the generated file I get something like this:    <function JavaSetterName at 0x0000000000000033>

What am I doing wrong?

Best regards,

Marcus
Aug 5, 2008 at 4:11 PM
Edited Aug 6, 2008 at 2:15 PM
. I need to install some libs of phyton or something else for the app to work?
Coordinator
Aug 6, 2008 at 12:35 AM

No additional Python software required, the interpreter is built in. But I see what you trying to do. The pictures were useful.

The program doesn't quite work that way, it doesn't build properties like that (however, it is in a interesting thought and I might add it in the future). The list sets the values for built in properties during database schema population. So you could populate one of the many built in ones, such as the Custom1 property, during schema population by replacing the JavaSetterName row with Custom1 (the code remains the same).

Or you can call the function from the template. So delete the row JavaSetterName from the list of properties but keep the code.

In the template simply do this: <#JavaSetterName('<#FieldName#>')#>. This will call JavaSetterName and pass the current field name.




Aug 6, 2008 at 2:31 PM

Thanks Stein,

I will be able to fine tune my templates with this info, hope my questions help others in the future.

YACGen Rocks!



Coordinator
Aug 14, 2008 at 7:32 AM

Just for FYI  the latest version (2008.08.14) now operates in the way you originally thought. If you a property that doesn't exist (i.e. JavaSetterName) in the functions list it will add it schema when evaluated. The value will appear in the custom value box under the second tab on the field form and can be used in the template as <#JavaSetterName#>.

Stein

Aug 14, 2008 at 2:33 PM
That's Just Great!

I hope I could help you with the project but I know nothing about VB :S

Anyway I have plenty of Ideas and will be using the software from Now On, for everything I could think of :)