Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added a feature that allows you selectively remove columns from being…

… wired up in entities.
  • Loading branch information...
commit d6ae096bd04f0cb52befc27f559e13893a6b9ba4 1 parent 03abe01
@tpryan authored
View
15 build.xml
@@ -112,7 +112,20 @@
</target>
- <target name="test" depends="test.apptacular,test.rebuild.apps,test.build.report" />
+ <target name="test" depends="test.setup,test.apptacular,test.rebuild.apps,test.build.report,test.teardown" />
+
+
+ <target name="test.setup">
+ <echo message="Deactivating debugging on ColdFusion Server."/>
+ <get src="http://${server}/apptacular/utils/debugging/disableDebugging.cfm" dest="getresult.html" verbose="true" />
+ <delete file='getresult.html' />
+ </target>
+
+ <target name="test.teardown">
+ <echo message="Reactivating debugging on ColdFusion Server."/>
+ <get src="http://${server}/apptacular/utils/debugging/enableDebugging.cfm" dest="getresult.html" verbose="true" />
+ <delete file='getresult.html' />
+ </target>
<target name="test.apptacular">
<echo message="Running Apptacular Tests"/>
View
3  handlers/cfc/db/column.cfc
@@ -19,7 +19,8 @@ component accessors="true" extends="dbItem"
property name="uiType" hint="The type to generate ui's for." ;
property name="Type" hint="The ColdFusion datatype" ;
property name="TestType" hint="The type used for unit testing";
- property name="displayLength" type="boolean" hint="Whether or not to put the length of the column into the property for it.";
+ property name="includeInEntity" type="boolean" hint="Whether or not to include this column in an entity";
+ property name="displayLength" type="boolean" hint="Whether or not to put the length of the column into the property for it.";
/**
* @hint Converts table to XML for serialization
View
1  handlers/cfc/db/table.cfc
@@ -416,6 +416,7 @@ component accessors="true" extends="dbItem"
column.setisMemeberOfCompositeForeignKey(false);
column.setisComputed(false);
column.setisIdentity(false);
+ column.setIncludeInEntity(true);
//dont create blank foriegn keys or they will cause issues.
if (CompareNoCase(column.getForeignKeyTable(), "N/A") neq 0){
View
8 handlers/cfc/generators/cfapp/ormGenerator.cfc
@@ -82,7 +82,9 @@ component extends="codeGenerator"{
property.setORMType(column.getOrmType());
property.setColumn(column.getColumn());
-
+ if (not column.getIncludeInEntity()){
+ continue;
+ }
//If it is an identity.
if (column.getIsPrimaryKey() or FindNoCase("Identity", column.getDataType())){
@@ -347,6 +349,10 @@ component extends="codeGenerator"{
for (i= 1; i <= ArrayLen(columns); i++){
column = columns[i];
+ if (not column.getIncludeInEntity()){
+ continue;
+ }
+
if(column.getIsPrimaryKey()){
populate.StartSimpleIF('StructKeyExists(arguments.formstruct, "#column.getName()#") AND arguments.formstruct.#column.getName()# gt 0',2);
populate.AddSimpleSet('This = EntityLoad("#table.getEntityName()#", arguments.formstruct.#column.getName()#, true)',3);
View
16 handlers/cfc/generators/cfapp/viewGenerator.cfc
@@ -63,6 +63,10 @@ component extends="codeGenerator"{
for (i = 1; i <= ArrayLen(columns); i++){
var column = columns[i];
+ if (not column.getIncludeInEntity()){
+ continue;
+ }
+
if (column.getIsForeignKey()){
var fkTable = datasource.getTable(column.getForeignKeyTable());
@@ -141,6 +145,10 @@ component extends="codeGenerator"{
for (i = 1; i <= ArrayLen(columns); i++){
var column = columns[i];
+ if (not column.getIncludeInEntity()){
+ continue;
+ }
+
if (column.getIsPrimaryKey() or FindNoCase("Identity", column.getDataType())){
ct.AppendBody(' <td>###entityName#.get#columns[i].getName()#()##</td>');
}
@@ -318,6 +326,10 @@ component extends="codeGenerator"{
for (i = 1; i <= ArrayLen(columns); i++){
column = columns[i];
+
+ if (not column.getIncludeInEntity()){
+ continue;
+ }
if (column.getIsPrimaryKey() or FindNoCase("Identity", column.getDataType())){
ct.AppendBody(' <tr>');
@@ -509,6 +521,10 @@ component extends="codeGenerator"{
var columnName = column.getName();
var fktableCount = 0;
+ if (not column.getIncludeInEntity()){
+ continue;
+ }
+
if (column.getisForeignKey()){
var fkTable = datasource.getTable(column.getForeignKeyTable());
var fktableCount = fkTable.getRowCount();
View
4 handlers/cfc/utils/editor.cfc
@@ -24,7 +24,7 @@ component accessors="true"{
var allowed = structNew();
allowed['datasource'] = "displayName,prefix";
allowed['table'] = "entityName,displayName,displayPlural,ForeignKeyLabel,orderby,plural,createInterface,IsJoinTable";
- allowed['column'] = "name,column,displayName,uiType";
+ allowed['column'] = "name,column,displayName,uiType,includeInEntity";
allowed['config'] = "LockApplication,CreateAppCFC,CreateEntities,CreateViews,CreateServices,CreateLogin,OverwriteDataModel,";
allowed['config'] = allowed['config'] & "<Path Information>,rootCFCPath,rootFilePath,cssfolder,customTagFolder,entityFolder,serviceFolder,appFolder,";
allowed['config'] = allowed['config'] & "<Service Methods>,serviceGetMethod,serviceUpdateMethod,serviceDeleteMethod,serviceListMethod,serviceListPagedMethod,serviceSearchMethod,serviceSearchPagedMethod,serviceInitMethod,serviceCountMethod";
@@ -45,7 +45,7 @@ component accessors="true"{
var booleans = structNew();
booleans['datasource'] = "";
booleans['table'] = "createInterface,IsJoinTable";
- booleans['column'] = "";
+ booleans['column'] = "includeInEntity";
booleans['config'] = "LockApplication,CreateAppCFC,CreateEntities,CreateLogin,CreateServices,CreateViews,OverwriteDataModel,MakeSuperSerivces,MakeSuperEntities,CreateTests,WireOneToManyinViews,LogSQL,depluralize,ReturnQueriesFromService";
booleans['virtualcolumn'] = "";
View
42 handlers/customTags/XMLColumnsForm.cfm
@@ -38,8 +38,35 @@
XMLProps = XMLParse(FileRead(filePath));
for (j = 1; j <= ArrayLen(props); j++){
- newvalue = updateStruct[columns[i]][props[j]];
- XMLProps['column'][props[j]]['XMLText'] = newvalue;
+ if (compareNocase("INCLUDEINENTITY",Trim(props[j])) eq 0){
+ if (structKeyExists(updateStruct[columns[i]], props[j])){
+ XMLProps['column'][props[j]]['XMLText'] = true;
+ }
+ else{
+ XMLProps['column'][props[j]]['XMLText'] = false;
+ }
+
+ }
+ else{
+
+ try{
+ newvalue = updateStruct[columns[i]][props[j]];
+
+ }catch(any e){
+ writeDump(columns[i],"console");
+ writeDump(props[j],"console");
+ rethrow;
+
+ }
+
+
+
+ XMLProps['column'][props[j]]['XMLText'] = newvalue;
+ }
+
+
+
+
}
FileWrite(filePath,XMLProps);
@@ -81,8 +108,6 @@
</cfloop>
</tr>
-
- <cflog text="#uilist#" />
<cfloop query="columns">
<tr>
<cfloop list="#columns.columnList#" index="attribute">
@@ -91,7 +116,6 @@
<cfelseif ListFindNoCase("uiType", attribute)>
<cfset fieldname = columns['column'][columns.currentRow] & "." & attribute />
<cfset value = columns[attribute][columns.currentRow] />
- <cflog text="#attribute#: #columns[attribute][columns.currentRow]#" />
<td>
<select name="#fieldname#" id="#attribute#">
<cfloop list="#uilist#" index="uilisttype">
@@ -104,7 +128,13 @@
<cfset value = columns[attribute][columns.currentRow] />
<td>
<input name="#fieldname#" type="text" value="#value#" tabindex="#currentRow#" />
- </td>
+ </td>
+ <cfelseif ListFindNoCase("includeInEntity", attribute)>
+ <cfset fieldname = columns['column'][columns.currentRow] & "." & attribute />
+ <cfset value = columns[attribute][columns.currentRow] />
+ <td>
+ <input name="#fieldname#" type="checkbox" value="true" <cfif value> checked="checked"</cfif> tabindex="#currentRow#" />
+ </td>
<cfelse>
<cfset fieldname = columns['column'][columns.currentRow] & "." & attribute />
<cfset value = columns[attribute][columns.currentRow] />
View
2  handlers/customTags/ideWrapper.cfm
@@ -11,7 +11,7 @@
<cfheader name="Content-Type" value="text/xml">
<response showresponse="true" >
<cfoutput><ide url="#attributes.messageURL#" ></cfoutput>
- <dialog title="Apptacular" image="handlers/logo.png" width="655" height="600" />
+ <dialog title="Apptacular" image="handlers/logo.png" width="710" height="600" />
<cfelse>
Please sign in to comment.
Something went wrong with that request. Please try again.