Code Monkey home page Code Monkey logo

cfcgenerator's Introduction

Illudium PU-36 Code Generator

This project generates ColdFusion components (i.e. bean, DAO, gateway, service), ColdSpring XML, Transfer XML, and ActionScript Value-Objects using the ColdFusion admin API and database introspection. The UI is built in Flex for an easy-to-use and intuitive interface. The code is outputted for easily saving or pasting into a project to allow you to get a head-start on some of the grunt work of building object-oriented applications in ColdFusion. It uses XSL or CFML to generate the components and is designed to allow you to easily add to or modify the generated code. You can even create new templates that can be swapped out at run-time.

REQUIREMENTS

  • ColdFusion MX 7.0.2 - Flash Remoting support must be enabled under Data & Services Flex Integration
    • NOTE: This component utlizes the adminAPI, so you must have access to the local ColdFusion server administrator password.
  • Currently supports MySQL 4.1 and 5 and MSSQL 2000/2005 and Oracle (contributed by Beth Bowden)
  • Running ColdFusion 8 Beta adds limited support for any type of database supported by ColdFusion
    • Access is supported in Unicode mode only
    • Identity field support is not available
    • Unknown data types (due to a bug in the beta) will default to string

Installation:

  1. Copy the contents into a directory name "cfcgenerator" under your web root
    • NOTE: If you need to place it elsewhere, a mapping should work, but you will need to edit your [webroot]\web-inf\flex\services-config.xml and set true
  2. That's it!

ABOUT

The Illudium PU-36 Code Generator uses database metadata that it converts into a custom XML format and applies to XSL or CFML templates to generate ColdFusion code for you. While most of the templates generate ColdFusion components (cfc), the generator can generate any type of code. Out of the box it also includes some XML templates as well as a simple ActionScript value object template. Keep in mind, the generated code is intended as a starting point for you to customize, not an end point.

USING THE GENERATOR

When the generator initially loads it will prompt you for your ColdFusion administrator password, after which it should automatically populate several select boxes. The first is available DSNs (for supported dbms see above). Once the DSN loads, the tables select should populate with a list of tables within that DSN. Lastly, the templates select should populate with all available xsl template options (for tips on how to customize templates, see below).

To generate templates:

  1. Select the DSN that contains the table you would like to generate against.
  2. Select the table from the list of tables.
  3. Optionally, choose a different template to generate against.
  4. Required, specify the default dot notation cfc path (i.e. com.user.user for /com/user/user.cfc)
  5. Optionally, choose a system save path using the directory browser (this is required to activate the save file capability)
  6. Optionally, check "Strip extra line breaks" if the generated code displays with extra line breaks
  7. Click Generate

Once the code generates, you will receive a set of tabs relating to each item you generated with a text area containing the generated code. You can choose to simply copy/paste each item by clicking the "Select All" button or you can save the file to a specified path by clicking the save file button - a default path and file name is specified for you, however you can change this before saving (Note: if the path doesn't exist it will be created for you).

CUSTOMIZING TEMPLATES

The code is generated off a set of XSL or CFML templates located in the /xsl/ folder. Each is configured using the yac.xml file in the /xsl/ folder (yet another config). You can list the items you wish to generate off the stylesheet - each child of the root (i.e. ) should have a base template (i.e. bean.xsl or bean.cfm) - note: the default is xsl, to use a cfm template you specify templateType="cfm". The internal functions of most of these stylesheets have been seperated out to make them easier to tweak and customize to suit your needs - the includes are defined by the children of the xml node and should be located in a folder of the same name (i.e. functions should be in the /xsl/bean/ folder). The xsl/cfml of each function will be added in the order you specify in the yac.xml. You determine where the function will be placed in your base stylesheet by the location of a comment reading "" (see the current files if this isn't clear). Feel free to add your own generated files and templates, you aren't limited to only the items that I created.

If you would like to have the ability to save files directly from the generator, you will need to specify the fileType attribute within each child of the root.

By default the file name will append the object type name, but this can be overidden using the fileNameAppend attribute. For instance, the bean has a fileNameAppend="" so that the generated name is the base object name, for example user.cfc and not userBean.cfc.

The generator allows you to choose the set of templates that you would like to generate against, allowing you the ability to add custom templates without modifying the core code. The custom stylesheets should be placed in a subfolder of /xsl/projects/. You will find a copy of the core files in there under the prototype folder that you can copy or rename. There is also an included set of templates for using Mark Mandel's Transfer ORM project. Each set of templates needs its own yac.xml file.

For reference purposes, here is the XML that is used to populate the templates (note: for XSL this is applied directly to the template using XSLT, for CFML it is passed to the template as a variable called root):

Using the Generated Code

While the tool is not designed to teach you object-oriented coding concepts, if you would like to learn how to use the generated code and some of the OO concepts behind it, I wrote a series of posts covering this topic (specifically relating it back to the generated code):

Part 1 - http://www.remotesynthesis.com/blog/index.cfm/2007/6/1/Objects-and-Composition-in-CFCs Part 2 (ColdSpring) - http://www.remotesynthesis.com/blog/index.cfm/2007/6/5/Objects-and-Composition-in-CFCs--Part-2-ColdSpring Part 3 (Transfer) - http://www.remotesynthesis.com/blog/index.cfm/2007/6/20/Objects-and-Composition-Part-3--Using-Transfer

SUPPORT AND CONTRIBUTIONS

Please feel free to share your custom templates or ask questions via the Google Group at: http://groups.google.com/group/cfcgenerator

If you need assistance or would like to contribute to this project, email [email protected]. If you find this project useful/helpful, you can visit my wishlist at http://www.amazon.com/gp/registry/wishlist/1BL8G2FZM978/ref=wl_web/

cfcgenerator's People

Contributors

deanlaw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cfcgenerator's Issues

Bug in release cfcgenerator_build_11_2007-07-03.zip

What steps will reproduce the problem?
1. Download cfcgenerator_build_11_2007-07-03.zip and install on local CFMX
server.
2. Connect to database
3. try to create transfer objects 
4. Application returns error "Could not find the ColdFusion Component
cfcgenerator.com.cf.model.xsl.generatedPage." 

Original issue reported on code.google.com by [email protected] on 2 Aug 2007 at 5:19

Reset tab index on re-generate

What steps will reproduce the problem?
1. Generate some code (any code).
2. Choose the DAO tab. 
3. Click generate again.  The DAO tab is still selected but the code 
displayed is actually the bean code.

What is the expected output? What do you see instead?
Uhhh...i just explained that :)

What version of the product are you using? On what operating system?
The newest version - on Vista but this happened on XP too I just forgot to 
report it.

Please provide any additional information below.
No thanks...

Original issue reported on code.google.com by [email protected] on 13 Apr 2007 at 3:05

Order DSN list alpha order

Brian,

I am looking for a good code generator, and I’m very impressed with yours
so far. 

2 quick suggestions: 

1.  When creating files, it would be nice to be able to use an absolute
path instead of a relative path.  We would run this program from a central
domain, but the results would be stored in numerous other domains, so the
system root folder does not equal the export folder.  I couldn’t find where
this was set.  I don’t have flex yet, and I’ve already burned my flex
builder demo, so I couldn’t look too far into this one.

2.  We have a very large number of DSNs, and the default listing in the
dropdown is not in a predictable order.

I added the following two functions to  com.cf.model.adminAPI.adminAPIFacade

One of my own:    

<cffunction name="sortDatasources" access="public" output="false">

                                    <cfset var sortedArray = ArrayNew(1)>

                                    <cfset var returnArray = ArrayNew(1)>

                                    <cfset var i="">

                                    <!--- Store a 2 value structure with
name and id in a temporary array. --->

                                    <cfloop from="1"
to="#arrayLen(variables.arrDSNs)#" index="i">

                                                <cfset sortedArray[i] =
StructNew()>

                                                <cfset
sortedArray[i].dsnName = variables.arrDSNs[i].getDsnName()>

                                                <cfset
sortedArray[i].originalID = i>

                                    </cfloop>

                                    <!--- Sort the new array by dsnName --->

                                    <cfset sortedArray = 
arrayOfStructsSort(sortedArray,"dsnName","asc","Text")>



                                    <!--- Loop through sorted list, and
build a return array with

                                    original objects in the new sorted
order. --->

                                    <cfloop from="1"
to="#arrayLen(sortedArray)#" index="i">

                                                <cfset returnArray[i] =
variables.arrDSNs[sortedArray[i].originalID]>

                                    </cfloop>



                                    <cfset variables.arrDSNs = returnArray>

                        </cffunction>





The other is from cflib.org

<cfscript>

/**

 * Sorts an array of structures based on a key in the structures.

 *

 * @param aofS              Array of structures.

 * @param key  Key to sort by.

 * @param sortOrder       Order to sort by, asc or desc.

 * @param sortType        Text, textnocase, or numeric.

 * @param delim             Delimiter used for temporary data storage. Must
not exist in data. Defaults to a period.

 * @return Returns a sorted array.

 * @author Nathan Dintenfass ([email protected])

 * @version 1, December 10, 2001

 */

function arrayOfStructsSort(aOfS,key){

                        //by default we'll use an ascending sort

                        var sortOrder = "asc";                

                        //by default, we'll use a textnocase sort

                        var sortType = "textnocase";

                        //by default, use ascii character 30 as the delim

                        var delim = ".";

                        //make an array to hold the sort stuff

                        var sortArray = arraynew(1);

                        //make an array to return

                        var returnArray = arraynew(1);

                        //grab the number of elements in the array (used in
the loops)

                        var count = arrayLen(aOfS);

                        //make a variable to use in the loop

                        var ii = 1;

                        //if there is a 3rd argument, set the sortOrder

                        if(arraylen(arguments) GT 2)

                                    sortOrder = arguments[3];

                        //if there is a 4th argument, set the sortType

                        if(arraylen(arguments) GT 3)

                                    sortType = arguments[4];

                        //if there is a 5th argument, set the delim

                        if(arraylen(arguments) GT 4)

                                    delim = arguments[5];

                        //loop over the array of structs, building the
sortArray

                        for(ii = 1; ii lte count; ii = ii + 1)

                                    sortArray[ii] = aOfS[ii][key] & delim & ii;

                        //now sort the array

                        arraySort(sortArray,sortType,sortOrder);

                        //now build the return array

                        for(ii = 1; ii lte count; ii = ii + 1)

                                    returnArray[ii] =
aOfS[listLast(sortArray[ii],delim)];

                        //return the array

                        return returnArray;

}

</cfscript> 

Then I added  <cfset sortDatasources()> to the bottom of the existing
setDatasources() function.  There may be a better way to do it, but this
was the quick solution I came up with.  Our DSN list is impossible to
navigate if not in alpha order.

Program looks great.

Gabriel Hyter

Website Design and Development

Original issue reported on code.google.com by [email protected] on 11 Mar 2007 at 12:12

Possible enhancement

Optional custom DSN configuration. For developers who may not have access 
to the CF administrator. This situation might be very rare but instead of 
specifying an adminAPI password, maybe pass in a simple xml config file 
that lists dsn names and types.

Original issue reported on code.google.com by [email protected] on 12 Jan 2007 at 3:59

Getting error &quot;Current user is not authorized to invoke this method&quot; when launching application.

What steps will reproduce the problem?
1. Configure ColdFusion to run under a user account.
2. Attempt to launch the cfcGenerator application 
(http://localhost/cfcGenerator)

What is the expected output? What do you see instead?
I expected to see a select box containing the SQL Server datasources on my 
server.

What version of the product are you using? On what operating system?
ColdFusion Server Developer     7,0,2,142559 on Windows XP SP2.

Please provide any additional information below.

Because our SQL Server database is using NT Authentication I am required 
to configure my ColdFusion service to run using my network account, 
otherwise I can't connect to the database successfully.


Original issue reported on code.google.com by [email protected] on 19 Oct 2006 at 8:12

Add MySQL 4.1 Support

a 4.1. component was contributed, I simply need to determine a manner to
distinguish 4.1. from 5 datasources in the dsn list returned by the adminAPI.


Original issue reported on code.google.com by [email protected] on 24 Feb 2007 at 10:57

DAO attempts to insert into auto-generated MSSQL GUID UniqueIdentifier column

I'm currently using cfcgenerator_build_4_2007-03-11 with MS SQL 2K.

The problem I'm having is that inserts fail because the DAO attempts to
write to a GUID column that has a new(id) default. 

To reproduce the problem, create a MS SQL table with an auto-gen GUID and
try to save a record to table using the generated Service/DAO.

Other than that, I love this tool! Thanks for all the work you do, Brian!



Glenn

Original issue reported on code.google.com by [email protected] on 20 Mar 2007 at 1:40

Improvemennt Suggestions

1.  Oracle doesn't have a "top" function so the exists function in the dao
will fail. Perhaps, use a standard sql function such as count(*) and then
check to see if the count is greater than zero. You could also rely on the
maxrows attribute on the cfquery but the database still has to do all the work.

2. The update and delete logic doesn't work unless the table has a primary
key. It may be worthwhile pointing out to the user that there is no primary
key. 

3. Oracle doesn't have a UUID or GUID datatype so the code I used is a bit
of a hack. 

Original issue reported on code.google.com by [email protected] on 10 Sep 2006 at 2:55

generated DAO contains bad references to xxxBean

What steps will reproduce the problem?
1. generate code
2. try generated xxxService for saving an xxx

The generated DAO contains references to xxx instead of xxxBean. One can
rename the generated xxxBean to xxx and it works, or modify cfcgenerator
such  that the generated DAO contains references to xxxBean (see attached
xsl files from cfcgenerator/xsl/dao). 

What version of the product are you using? On what operating system?
subversion checkout on windows XP pro


Original issue reported on code.google.com by [email protected] on 21 Feb 2007 at 12:29

Attachments:

Generation of a setBeanConfig and getBeanConfig

Something that would be extremely useful would be to define a bean config 
struture. This
can be used to create lookup managers or describe your bean.  It can be 
generated
and below is a sample of the setBeanConfig() which is called from the init()

You also would need a getBeanConfig() to retreive the structure.


<cffunction name="setBeanConfig" access="private" returntype="void" 
output="false" 
displayname="users config" hint="I setup the configuration for the bean 
galleon_users.">
        <cfscript>
            variables.beanconfig = structnew();

            variables.beanconfig.Id = structNew();
            variables.beanconfig.Id.isnullable = 0;
            variables.beanconfig.Id.maxlength = 35;

            variables.beanconfig.username = structNew();
            variables.beanconfig.username.isnullable = 0;
            variables.beanconfig.username.maxlength = 50;

            variables.beanconfig.password = structNew();
            variables.beanconfig.password.isnullable = 0;
            variables.beanconfig.password.maxlength = 50;

            variables.beanconfig.emailaddress = structNew();
            variables.beanconfig.emailaddress.isnullable = 0;
            variables.beanconfig.emailaddress.maxlength = 255;

            variables.beanconfig.datecreated = structNew();
            variables.beanconfig.datecreated.isnullable = 0;
            variables.beanconfig.datecreated.maxlength = 19;

        </cfscript>
    </cffunction>

Original issue reported on code.google.com by [email protected] on 19 Oct 2006 at 1:57

MySQL Datatype transfer

\cfcgenerator_build_11_2007-07-03\com\cf\model\datasource\mysql.cfc

function: translateCfSqlType translateDataType

<cfcase value="date"><cfreturn "cf_sql_date" /></cfcase>
<cfcase value="datetime"><cfreturn "cf_sql_timestamp" /></cfcase>

the default transfer for column type "datetime" AS "cf_sql_date". this 
will not save the Time part in the database. 

Original issue reported on code.google.com by [email protected] on 26 Jul 2007 at 6:09

Attachments:

on Flex UI load, do not set a DSN

When the Flex UI loads up, a DSN is auto chosen.  Be nice to have this off
so we don't have to wait for the service to populate the tables dataProvider.


Original issue reported on code.google.com by [email protected] on 3 May 2007 at 4:40

cfc service path not in Application.cfm

Brian,

I think that it would be of great help to map the path to the generator
service (model) from the application.cfm using a ModelPath.

This way, you can place the generator wherever you want and just configure
the location from the Application.cfm

What do you think?

Original issue reported on code.google.com by [email protected] on 23 Dec 2006 at 4:26

add height to the "Generator Details" panel (bottom left)

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?
I would expect to see all the options, but I have to scroll down to see the
"Generate" button.

What version of the product are you using? On what operating system?


Please provide any additional information below.
I am attaching a screenshot

Original issue reported on code.google.com by [email protected] on 3 Aug 2007 at 12:57

Attachments:

translateDataType in mysql.cfc returns Number instead of Numeric

What steps will reproduce the problem?
1. Generate code from a mysql database
2. try components
3. your numeric values will not work when calling cfc methods whose type is
"Number"

in mysql.cfc, one has to change translateDataType to :
    <cffunction name="translateDataType" hint="I translate the MSSQL data type
names into ColdFusion data type names" output="false" returntype="string">
        <cfargument name="typeName" hint="I am the type name to translate"
required="yes" type="string" />

        <cfswitch expression="#arguments.typeName#">
            <cfcase value="bigint">
                <cfreturn "Numeric" />
            </cfcase>
            <cfcase value="binary">
                <cfreturn "String" />
            </cfcase>
            <cfcase value="bit">
                <cfreturn "Boolean" />
            </cfcase>
            <cfcase value="char">
                <cfreturn "String" />
            </cfcase>
            <cfcase value="datetime">
                <cfreturn "Date" />
            </cfcase>
            <cfcase value="decimal">
                <cfreturn "Numeric" />
            </cfcase>
            <cfcase value="double">
                <cfreturn "Numeric" />
            </cfcase>
            <cfcase value="float">
                <cfreturn "Numeric" />
            </cfcase>
            <cfcase value="image">
                <cfreturn "Numeric" />
            </cfcase>
            <cfcase value="int">
                <cfreturn "Numeric" />
            </cfcase>
            <cfcase value="money">
                <cfreturn "Numeric" />
            </cfcase>
            <cfcase value="nchar">
                <cfreturn "String" />
            </cfcase>
            <cfcase value="ntext">
                <cfreturn "String" />
            </cfcase>
            <cfcase value="numeric">
                <cfreturn "Numeric" />
            </cfcase>
            <cfcase value="nvarchar">
                <cfreturn "String" />
            </cfcase>
            <cfcase value="longtext">
                <cfreturn "String" />
            </cfcase>
            <cfcase value="real">
                <cfreturn "Numeric" />
            </cfcase>
            <cfcase value="smalldatetime">
                <cfreturn "Date" />
            </cfcase>
            <cfcase value="smallint">
                <cfreturn "Numeric" />
            </cfcase>
            <cfcase value="smallmoney">
                <cfreturn "Numeric" />
            </cfcase>
            <cfcase value="text">
                <cfreturn "String" />
            </cfcase>
            <cfcase value="timestamp">
                <cfreturn "Date" />
            </cfcase>
            <cfcase value="tinyint">
                <cfreturn "Boolean" />
            </cfcase>
            <cfcase value="uniqueidentifier">
                <cfreturn "String" />
            </cfcase>
            <cfcase value="varbinary">
                <cfreturn "String" />
            </cfcase>
            <cfcase value="varchar">
                <cfreturn "String" />
            </cfcase>
        </cfswitch>
    </cffunction>



Original issue reported on code.google.com by [email protected] on 20 Feb 2007 at 8:57

Admin Password visually asked for

Brian,
I have a problem putting my cf admin password on my template, specially if I am 
using some 
version control,etc.  Do you think, visually asking the user to enter the CF 
password would be a 
more secure mechanism?  What do you Think?

Original issue reported on code.google.com by [email protected] on 13 Mar 2007 at 2:35

Typo in /xsl/to.xsl

What steps will reproduce the problem?
1. run default template set
2. review "to" output - cfreturn is misspelled in init()

sample corrected file attached.


Original issue reported on code.google.com by [email protected] on 8 May 2007 at 12:05

Attachments:

dtproperties showing in tables list for MSSQL database

files: com.cf.model.datasource.mssql.cfc

the dtproperties tables is showing in the table list for MSSQL database.
There needs to be a filter onthe qAllTables query in the getTables function
to prevent this. Below is the code that I use to filter.

select
    table_name as table_name,
    'Table' AS table_type
from
    information_schema.tables 
where
    table_type = 'BASE TABLE'
    and table_name <> 'dtproperties'

Original issue reported on code.google.com by [email protected] on 26 Mar 2007 at 6:07

remove single blank first line from generated templates

What steps will reproduce the problem?
1. generate code
2. look at the first line
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.
There is a single blank line at the top of every generated file.  The line
actually appears at the top of the output of the generated text in the Flex
UI and is then written to file with it.  Aesthetics aside, it makes
ColdSpring barf on the cs xml files if you <import/> them from the main cs
config file.

Original issue reported on code.google.com by [email protected] on 3 Aug 2007 at 12:52

add Lower() to names

When you use Oracle, all table and field names are in upper case.  I've
added lower() to all needed code to change this and works a treat.


Original issue reported on code.google.com by [email protected] on 1 May 2007 at 7:48

some feedback from a first-time visitor to the project

Brian, are you interested in random feedback about the project, from a 
first-time visitor. I heard your interview on the podcast and was 
motivated to take a look. :-)

First, I was surprised to find that visiting the wiki link above shows the 
wiki pages the order: customizing, installation, howto, requirements, and 
about. That should be the reverse, right? It could put off first-time 
visitors who don't recognize the problem. Is it anything you can control? 

Of course, some screen shots would be nice to help motivate first-timers 
to better appreciate both the output and the process of using the tool, 
but I know that docs are always the re-headed stepchild of O/S projects. :-
) I just propose this if you're interested in driving more developers to 
get interested, which would lead both to more widespread use and finding 
more folks to get involved. Kind of a chicken-and-egg problem, I 
realize. :-)

Here's a minor point: in the download you offer, you propose people unzip 
it into a cfcgenerator directory. For some users, they would benefit from 
your having that root directory already specified in the zip file, so they 
need only unzip it to their site root (without having to create a 
directory). It's a little thing, and maybe you want to leave them free to 
choose another name for the directory. I see you address that they can put 
it other than the root and use a mapping. Would things fail to work for 
any reason if the name was not cfcgenerator? If so, then that's another 
reason to fix the name within the zip. Just I thought I'd bring it up for 
consideration.

Finally, you may ask, "so, what did you think of it". Sadly, I couldn't 
get it working because I seem to have some problem with my 7.02 
installation's support of Flex 2 at the moment. That was a surprise, but I 
can't go further until I resolve that. In any case, I wish you continued 
success on the project. It sounds compelling, and we all appreciate all 
your work in the community.

/charlie

PS Sorry if I should break these into smaller, individualy items for 
response in the issue tracker. I didn't know if you'd want to consider 
them the same sort of issues as other "real" ones related to the code 
itself.

Original issue reported on code.google.com by [email protected] on 24 Apr 2007 at 5:13

ability to choose many tables (enhancement)

What is the expected output? What do you see instead?
when saving to be intelligent enough to save each component on its own 
file. The name on the components should be at least related to the table 
name (the desire will be tolet user change it before generating)

What version of the product are you using? On what operating system?
build 7

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 4 Jun 2007 at 3:52

the type for string and date in the transfer xml has to be lower case

What steps will reproduce the problem?
1. Generate transfer XML snippet

The name for the types 'string' and 'date' should be lower case. In the
genrated fiel they are uppercase, which cause transfer to fail during
initialisation.

After I hanged the type to lowercase for string and date it worked.

Original issue reported on code.google.com by [email protected] on 9 Aug 2007 at 11:44

Error messages on startup (using Ubuntu 7.04)

What steps will reproduce the problem?

Everytime I'm accessing http://localhost/cfcgenerator/index.cfm the
following errors occur:
"flex/messaging/io/amf/UnknownTypeException"
"Server.Processing"
"Fault occured in GetTemplatesCommand."
"flex/messaging/io/amf/UnknownTypeException"
"Server.Processing"
"Fault occured in GetDatasourcesCommand."



What is the expected output? What do you see instead?

After clicking away those annoying popup messages, the flex interface is
basically working fine, but I can't select any datasources, tables and
templates.



What version of the product are you using? On what operating system?

I'm using 1.0 RC1, ColdFusion MX 7.02 and MySQL 5 on Ubuntu Linux (Feisty
7.04).

Original issue reported on code.google.com by alexander.grueneberg on 12 Apr 2007 at 7:06

Add Camel Case to Method Names

It would be nice if the method names that were generated were converted to
camel case. Instead of "getbean" it would be "getBean". Since the bean name
is the only thing that is dynamic, all you would have to do is convert it
to proper case. I realize that the XSL parameter for the bean name needs to
be lower case in other instances, so you would have to convert the first
letter to uppercase only where needed.

Here is a good article on translating strings to upper case, lower case and
proper case in XSL:
http://www.topxml.com/xml/articles/caseconvert/


Original issue reported on code.google.com by [email protected] on 15 Mar 2007 at 7:22

Show Busy Cursor

What steps will reproduce the problem?
1. Run the application. :)
2.
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.

Just a tiny tiny thing really - could you show busy cursor when loading
metadata?  Thnx.

Original issue reported on code.google.com by [email protected] on 12 Mar 2007 at 12:39

MSSQL datasources don't appear on the datasource list when you use the Microsoft JDBC driver

What steps will reproduce the problem?
1. Setup a mssql 2005 datasource utilizing the Microsoft JDBC driver
2.
3.

What is the expected output? What do you see instead?

I would expect to see the mssql datasource in the list of available
datasources.

What version of the product are you using? On what operating system?

Using v.3 winxp cfmx 7.02

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 15 Aug 2006 at 8:18

Request to add FilenamePrepend param to YAC.xml

Would really like a FilenamePrepend attribute to be added to the yac.xml to
allow for more customized naming of generated files. This would benefit
those of us who are generating framework specific code such as Fusebox and
Coldbox templates.

Just the ability to prepend any string to the beginning of the filename
before the name of the Node.

Original issue reported on code.google.com by [email protected] on 5 Jul 2007 at 6:45

Enter one-line summary

What steps will reproduce the problem?
1. Download flex version.
2. Change admin pass.
3. Run [host]/bin/index.cfm

What is the expected output? What do you see instead?
Expected - the generator.  Found - errors.  The Flex version of the zip is
packaged as /cfcgeneratorFLEX - but some of the createObject calls point to
/cfcgenerator.  A simple global find and replace on cfcgeneratorFlex seems
to do the trick (there were about 5 places that needed to be changed).

What version of the product are you using? On what operating system?
N/A.

Please provide any additional information below.
N/A.

Original issue reported on code.google.com by [email protected] on 11 Feb 2007 at 7:51

MySQL 5 CF8 (Public & GMC Release) Strang Issue in bean validate function

What steps will reproduce the problem?
1. Run the generator on a mysql 5 database with the CF8 Beta (&GMC)

What is the expected output? What do you see instead?

When I run the generator on a table in a my MySQL 5 database the validate
function does not pick up the tables (metadata) correctly. Here's what I
get back from the generator with mysql 5:

        <!--- NewsID --->

        <!--- Headline --->
        <cfif (NOT len(trim(getHeadline())))>
            <cfset val.addError("Headline", "Headline is required") />
        </cfif>

        <!--- SubHeadline --->

        <!--- Body --->
        <cfif (NOT len(trim(getBody())))>
            <cfset val.addError("Body", "Body is required") />
        </cfif>

        <!--- SpecialComment --->

        <!--- Link1 --->

        <!--- Link2 --->

        <!--- Image1 --->

        <!--- Image2 --->

        <!--- Image3 --->

        <!--- ReleaseType --->
        <cfif (NOT len(trim(getReleaseType())))>
            <cfset val.addError("ReleaseType", "ReleaseType is required") />
        </cfif>

        <!--- DateOfNews --->
        <cfif (NOT len(trim(getDateOfNews())))>
            <cfset val.addError("DateOfNews", "DateOfNews is required") />
        </cfif>

        <!--- DateCreated --->
        <cfif (NOT len(trim(getDateCreated())))>
            <cfset val.addError("DateCreated", "DateCreated is required") />
        </cfif>

        <!--- DateModified --->
        <cfif (NOT len(trim(getDateModified())))>
            <cfset val.addError("DateModified", "DateModified is required") />
        </cfif>



********** Here's what I get from the same table in MSSQL and from CF7 on
MySQL ***********

<!--- NewsID --->
        <cfif (len(trim(getNewsID())) AND NOT isNumeric(trim(getNewsID())))>
            <cfset val.addError("NewsID", "NewsID is not numeric") />
        </cfif>

        <!--- Headline --->
        <cfif (NOT len(trim(getHeadline())))>
            <cfset val.addError("Headline", "Headline is required") />
        </cfif>
        <cfif (len(trim(getHeadline())) AND NOT IsSimpleValue(trim(getHeadline())))>
            <cfset val.addError("Headline", "Headline is not a string") />
        </cfif>
        <cfif (len(trim(getHeadline())) GT 300)>
            <cfset val.addError("Headline", "Headline is too long") />
        </cfif>

        <!--- SubHeadline --->
        <cfif (len(trim(getSubHeadline())) AND NOT
IsSimpleValue(trim(getSubHeadline())))>
            <cfset val.addError("SubHeadline", "SubHeadline is not a string") />
        </cfif>
        <cfif (len(trim(getSubHeadline())) GT 350)>
            <cfset val.addError("SubHeadline", "SubHeadline is too long") />
        </cfif>

        <!--- Body --->
        <cfif (NOT len(trim(getBody())))>
            <cfset val.addError("Body", "Body is required") />
        </cfif>
        <cfif (len(trim(getBody())) AND NOT IsSimpleValue(trim(getBody())))>
            <cfset val.addError("Body", "Body is not a string") />
        </cfif>
        <cfif (len(trim(getBody())) GT -1)>
            <cfset val.addError("Body", "Body is too long") />
        </cfif>

        <!--- SpecialComment --->
        <cfif (len(trim(getSpecialComment())) AND NOT
IsSimpleValue(trim(getSpecialComment())))>
            <cfset val.addError("SpecialComment", "SpecialComment is not a string") />
        </cfif>
        <cfif (len(trim(getSpecialComment())) GT -1)>
            <cfset val.addError("SpecialComment", "SpecialComment is too long") />
        </cfif>

        <!--- Link1 --->
        <cfif (len(trim(getLink1())) AND NOT IsSimpleValue(trim(getLink1())))>
            <cfset val.addError("Link1", "Link1 is not a string") />
        </cfif>
        <cfif (len(trim(getLink1())) GT 300)>
            <cfset val.addError("Link1", "Link1 is too long") />
        </cfif>

        <!--- Link2 --->
        <cfif (len(trim(getLink2())) AND NOT IsSimpleValue(trim(getLink2())))>
            <cfset val.addError("Link2", "Link2 is not a string") />
        </cfif>
        <cfif (len(trim(getLink2())) GT 300)>
            <cfset val.addError("Link2", "Link2 is too long") />
        </cfif>

        <!--- Image1 --->
        <cfif (len(trim(getImage1())) AND NOT IsSimpleValue(trim(getImage1())))>
            <cfset val.addError("Image1", "Image1 is not a string") />
        </cfif>
        <cfif (len(trim(getImage1())) GT 255)>
            <cfset val.addError("Image1", "Image1 is too long") />
        </cfif>

        <!--- Image2 --->
        <cfif (len(trim(getImage2())) AND NOT IsSimpleValue(trim(getImage2())))>
            <cfset val.addError("Image2", "Image2 is not a string") />
        </cfif>
        <cfif (len(trim(getImage2())) GT 255)>
            <cfset val.addError("Image2", "Image2 is too long") />
        </cfif>

        <!--- ReleaseType --->
        <cfif (len(trim(getReleaseType())) AND NOT
IsSimpleValue(trim(getReleaseType())))>
            <cfset val.addError("ReleaseType", "ReleaseType is not a string") />
        </cfif>
        <cfif (len(trim(getReleaseType())) GT 10)>
            <cfset val.addError("ReleaseType", "ReleaseType is too long") />
        </cfif>

        <!--- DateOfNews --->
        <cfif (NOT len(trim(getDateOfNews())))>
            <cfset val.addError("DateOfNews", "DateOfNews is required") />
        </cfif>
        <cfif (len(trim(getDateOfNews())) AND NOT isDate(trim(getDateOfNews())))>
            <cfset val.addError("DateOfNews", "DateOfNews is not a date") />
        </cfif>

        <!--- DateCreated --->
        <cfif (len(trim(getDateCreated())) AND NOT isDate(trim(getDateCreated())))>
            <cfset val.addError("DateCreated", "DateCreated is not a date") />
        </cfif>

        <!--- DateModified --->
        <cfif (len(trim(getDateModified())) AND NOT isDate(trim(getDateModified())))>
            <cfset val.addError("DateModified", "DateModified is not a date") />
        </cfif>



Obviously the latter is what I'm looking for! Any help would be much
appreciated. I'm also using the built in CF database connector. I did
switch the over to the JDBC connector and got the same results. I don't
think that matters but I thought I'd throw it out there.

Keep up the great work... I use your generator daily.



Original issue reported on code.google.com by [email protected] on 14 Jul 2007 at 6:44

MSSQL 2005 Throws Error

What steps will reproduce the problem?
1. Use CF's built in SQL Server driver
2. Run Program to connect to datasource
3. Try to build objects on any table

What is the expected output? What do you see instead?
For the object code to be generated but instead see:
[Macromedia][SQLServer JDBC Driver][SQLServer]Invalid object name
'master.dbo.spt_datatype_info'.

What version of the product are you using? On what operating system?
CF 7.02 with MSSQL 2005 Express on Windows XP Pro

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 25 Aug 2006 at 2:49

DB Type Passed with XML

Feature Enhancement Request

What is the expected output?
I would like to be able to get at the Database type using the XSL templates
for use with ObjectBreeze CollectionFillByQuery() method which requires a
dbtype to be passed in.


Original issue reported on code.google.com by [email protected] on 15 Mar 2007 at 4:55

Generate cfcUnit Test Cases and Test Suites

Request to generate cfcUnit tests for all generated services. Automatically
generate at least one assertEquals, assertTrue, assertFalse for each
function. The idea is to have a base to fill-in-the-blanks and have no
excuse not to test your code. 
More info here
http://corfield.org/cfcunit/documentation/
http://corfield.org/cfcunit/documentation/writing_tests.html

Original issue reported on code.google.com by [email protected] on 19 Apr 2007 at 1:50

Ideas for improvements from Luis Majano

1. Liked the idea to configure default xsl template location in config
2. Create cfcs for multiple tables saved to files
3. Stored procedure generator
4. Base DAO extended by RDBMS specific DAOs

Original issue reported on code.google.com by [email protected] on 26 Sep 2006 at 9:06

XSL - missing @ sign

Missing @ sign in 2 places...

/cfcgenerator/xsl/projects/transfer/service/getBean.xsl
/cfcgenerator/xsl/projects/transfer/service/deleteBean.xsl

line 2
type="<xsl:value-of select="type" />

should be: 
type="<xsl:value-of select="@type" />




Original issue reported on code.google.com by [email protected] on 27 Feb 2007 at 1:15

Enter one-line summary

What steps will reproduce the problem?
1. Non-nullable columns with defaults in db will be generated as required
2.
3.

What is the expected output? What do you see instead?
Expect to see non-nullables with default values not required.

What version of the product are you using? On what operating system?


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 25 Feb 2007 at 3:06

Error Executing Database Query

What steps will reproduce the problem?
1. Install the code generator
2. Set the password to the CF Admin password
3. set &lt;use-mappsings&gt;true&lt;/use-mappings&gt;
4. Generate some code, or try to at least

What is the expected output? What do you see instead?

It should work as expected. However, the Flex interface comes up and the
select lists are populated with the databases and tables as expected.
However, after I enter the relevant paths and click generate, I get a
series of errors:

Error Executing Database Query
Server.Processing
Fault Occurred in GetTablesCommand.

What version of the product are you using? On what operating system?

I am using Build 4 released on 2007-3-11. I am running Windows XP Pro and
have CFMX 7 Version 7,0,2,142559  and it is tied into IIS 5.

Please provide any additional information below.

I would really like to get this to work because the older generator
build/version that I have does not appear to support the date field in MySQL 5.

Original issue reported on code.google.com by [email protected] on 26 Apr 2007 at 3:42

save func of service

What steps will reproduce the problem?
1. service
2. passing arguments to save func
3. error abc is not in arguments
4. I am using ms-sql 2005

below is code for saveprofilelog   I have marked issue area 

    <cffunction name="saveprofileLog" access="public" output="false"
returntype="boolean">
        <cfargument name="profile_log_id" type="numeric" required="true" />
        <cfargument name="profile_log_member_username_tx" type="string"
required="true" />
        <cfargument name="profile_log_update_timestamp_dt" type="date"
required="true" />
        <cfargument name="profile_log_day_dt" type="date" required="true" />
        <cfargument name="profile_log_profile_views_ct" type="numeric"
required="true" />
        <cfargument name="profile_log_last_ip_cd" type="string" required="false" />

----------------------- how this know that profilelog bean-----
        <cfset var profileLog = getprofileLog(arguments.profile_log_id) />
----------------------------- -----
        <cfset profileLog.setprofile_log_id(arguments.profile_log_id) />
        <cfset
profileLog.setprofile_log_member_username_tx(arguments.profile_log_member_userna
me_tx)
/>
        <cfset
profileLog.setprofile_log_update_timestamp_dt(arguments.profile_log_update_times
tamp_dt)
/>
        <cfset profileLog.setprofile_log_day_dt(arguments.profile_log_day_dt) />
        <cfset
profileLog.setprofile_log_profile_views_ct(arguments.profile_log_profile_views_c
t)
/>
        <cfif structKeyExists(arguments,"profile_log_last_ip_cd")>
            <cfset
profileLog.setprofile_log_last_ip_cd(arguments.profile_log_last_ip_cd) />
        </cfif>
        <cfreturn variables.profileLogDAO.save(arguments.profileLog) />
    </cffunction>

Original issue reported on code.google.com by [email protected] on 21 Nov 2006 at 10:32

Ideas for improvements from Luis Majano

1. Liked the idea to configure default xsl template location in config
2. Create cfcs for multiple tables saved to files
3. Stored procedure generator
4. Base DAO extended by RDBMS specific DAOs

Original issue reported on code.google.com by [email protected] on 26 Sep 2006 at 9:05

getTables Failure

What steps will reproduce the problem?
1. Install application (including the /cfcgenerator mapping)
2. Visit http://localhost/cfcgenerator

What is the expected output? What do you see instead?
I expect to see the datasource names in the drop down box. Instead I get
the following error in Flex from the getTables request ....

"The value returned form function getDatasource() is not of type
cfgenerator.com.cf.model.datasource.datasource."


What version of the product are you using? On what operating system?
Windows XP, Apache, MX7 (same errors with PWS)

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 29 Jan 2007 at 7:23

Request for custom component prefix

What steps will reproduce the problem?
1. Fill in details
2. Generate code

What is the expected output? What do you see instead?
The generated filenames use the final directory in the CFC path as the
filename prefix. The issue is that, often the final directory is named
'com' or 'cfc' so you end up with com.cfc, comDAO.cfc, etc.  It would be
helpful if there were an optional field where the user could specify their
own component prefix that would be used instead of the last directory name.


What version of the product are you using? On what operating system?
cfcgenerator_build_7_2007-06-01 / WinXP Pro




Original issue reported on code.google.com by [email protected] on 11 Jun 2007 at 12:36

Duplicate datetime column code for MSSQL

What steps will reproduce the problem?

1. Generate CFCs for a MSSQL table with a datetime column.

What is the expected output? What do you see instead?

You expect to see the datetime column listed once in the generated
components however code for any date time columns is generated twice.

What version of the product are you using? On what operating system?

cfcGenerator revision 19 running on CFMX 7.0.2, Windows XP Pro, and MSSQL 2000.

Please provide any additional information below.

It seems the query in the setTableMetadata method of the mssql.cfc is
returning duplicate rows for datetime columns. The attached patch has an
updated query which fixes this issue.


Original issue reported on code.google.com by [email protected] on 19 Aug 2006 at 6:09

Attachments:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.