You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(36) |
Oct
(16) |
Nov
(4) |
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(13) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ndi...@us...> - 2002-09-08 03:46:38
|
Update of /cvsroot/modus/modustest In directory usw-pr-cvs1:/tmp/cvs-serv10460 Modified Files: index.cfm Log Message: changed to use the getAllSorted() method, so it sorts on featured releases, then the title Index: index.cfm =================================================================== RCS file: /cvsroot/modus/modustest/index.cfm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** index.cfm 2 Sep 2002 21:28:48 -0000 1.2 --- index.cfm 8 Sep 2002 03:46:35 -0000 1.3 *************** *** 18,22 **** } //all releases ! all = pr.getAll(); //if a URL id exists --- 18,22 ---- } //all releases ! all = pr.getAllSorted("featured desc,title"); //if a URL id exists *************** *** 28,41 **** </cfscript> ! <cfoutput> <ul> <cfloop from="1" to="#arrayLen(all)#" index="ii"> <cfset thisObj = all[ii]> ! <li><a href="#getFileFromPath(getBaseTemplatePath())#?id=#thisObj.getID()#">#thisObj.getField("title").toHTML()#</a> <br /> #thisObj.getField("image").toHTML()# - </cfloop> --- 28,41 ---- </cfscript> ! <cfoutput> <ul> <cfloop from="1" to="#arrayLen(all)#" index="ii"> <cfset thisObj = all[ii]> ! ! <li><a href="#getFileFromPath(getBaseTemplatePath())#?id=#thisObj.getID()#"<cfif thisObj.getField("featured").getValue()> style="font-weight:bold;"</cfif>>#thisObj.getField("title").toHTML()#</a> (featured: #thisObj.getField("featured").toHTML()#) <br /> #thisObj.getField("image").toHTML()# </cfloop> |
From: <ndi...@us...> - 2002-09-08 03:45:56
|
Update of /cvsroot/modus/org/bacfug/modus In directory usw-pr-cvs1:/tmp/cvs-serv10269/bacfug/modus Modified Files: basecontentobject.cfc Log Message: added an interface to getAllSorted() in the persister. At some point we will want to abstract out the sort function, so we could filter, then sort. Index: basecontentobject.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/basecontentobject.cfc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** basecontentobject.cfc 8 Sep 2002 02:35:42 -0000 1.5 --- basecontentobject.cfc 8 Sep 2002 03:45:53 -0000 1.6 *************** *** 69,72 **** --- 69,77 ---- <cfreturn instance.persister.getAll(getType())> </cffunction> + <!--- get all of this type sorted ---> + <cffunction name="getAllSorted" access="public" returnType="array" hint="get all of this type, sorted by some fields" output="no"> + <cfargument name="sortFields" required="yes" type="string"> + <cfreturn instance.persister.getAllSorted(sortFields,getType())> + </cffunction> <!--- |
From: <ndi...@us...> - 2002-09-08 03:45:20
|
Update of /cvsroot/modus/org/bacfug/modus/persistence In directory usw-pr-cvs1:/tmp/cvs-serv10123/bacfug/modus/persistence Modified Files: basepersister.cfc Log Message: added in a method to get sorted objects of a given type Index: basepersister.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/persistence/basepersister.cfc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** basepersister.cfc 8 Sep 2002 02:37:45 -0000 1.3 --- basepersister.cfc 8 Sep 2002 03:45:16 -0000 1.4 *************** *** 20,24 **** <cffunction name="getAll" access="public" output="no" hint="The method to get all data instances of a particular type. Should return an array of contentObjects."> <cfthrow message="getAll() method not implemented!" detail="You must defined a getAll() method for #getMetaData(this).name#."> ! </cffunction> <!--- a package function to determine if an object passed is, indeed, a baseContentObject ---> --- 20,82 ---- <cffunction name="getAll" access="public" output="no" hint="The method to get all data instances of a particular type. Should return an array of contentObjects."> <cfthrow message="getAll() method not implemented!" detail="You must defined a getAll() method for #getMetaData(this).name#."> ! </cffunction> ! ! <!--- a function for sorting ---> ! <!--- ! ! I'm really not at all satisfied with this, but it does work, for now. ! ! ---> ! <cffunction name="getAllSorted" access="public" output="no" hint="A method to sort all instances and sort them by one or more fields"> ! <cfargument name="sortFields" required="yes" type="string"> ! <cfargument name="contentObjectType" required="yes" type="string"> ! <cfset var tempQuery = ""> ! <cfset var sortQuery = ""> ! <cfset var objectArray = getAll(arguments.contentObjectType)> ! <cfset var sortedArray = arrayNew(1)> ! <cfset var objectCount = arrayLen(objectArray)> ! <cfset var sortFieldsArray = listToArray(arguments.sortFields)> ! <cfset var ii = 0> ! <cfset var ff = 0> ! <cfset var thisObject = ""> ! <cfset var thisFieldName = ""> ! <cfscript> ! //clean the sortFieldsArray, so we can have the sort order in there too ! for(ii = 1; ii LTE arrayLen(sortFieldsArray); ii = ii + 1){ ! sortFieldsArray[ii] = getToken(sortFieldsArray[ii],1); ! } ! //prime the tempQuery ! tempQuery = queryNew("index," & arrayToList(sortFieldsArray)); ! //resize the query to however many objects there are ! queryAddRow(tempQuery,objectCount); ! //loop through all objects, populating the appropriate columns of the query ! for(ii = 1; ii LTE objectCount; ii = ii + 1){ ! thisObject = objectArray[ii]; ! querySetCell(tempQuery,"index",ii,ii); ! //loop through whatever fields we are sorting on, adding the values of those fields to the query ! for(ff = 1; ff LTE arrayLen(sortFieldsArray); ff = ff + 1){ ! thisFieldName = getToken(sortFieldsArray[ff],1); ! querySetCell(tempQuery,thisFieldName,trim(thisObject.getField(thisFieldName).getValue()),ii); ! } ! } ! </cfscript> ! <!--- ok, now let's get the sortedQuery ---> ! <cfquery name="sortQuery" dbtype="query"> ! SELECT * ! FROM tempQuery ! ORDER BY #arguments.sortFields# ! </cfquery> ! <!--- and now, we'll populate the sortedArray ---> ! <cfscript> ! //resize the array, so it doesn't have to keep allocating more memory ! arrayResize(sortedArray,objectCount); ! for(ii = 1; ii LTE objectCount; ii = ii + 1){ ! sortedArray[ii] = objectArray[sortQuery.index[ii]]; ! } ! </cfscript> ! <!--- return the sorted Array ---> ! <cfreturn sortedArray> ! </cffunction> ! <!--- a package function to determine if an object passed is, indeed, a baseContentObject ---> |
From: <ndi...@us...> - 2002-09-08 02:38:23
|
Update of /cvsroot/modus/org/bacfug/modus/persistence In directory usw-pr-cvs1:/tmp/cvs-serv28955/bacfug/modus/persistence Modified Files: simpleobjectinstance.cfc Log Message: added the logic for caching Index: simpleobjectinstance.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/persistence/simpleobjectinstance.cfc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** simpleobjectinstance.cfc 3 Sep 2002 22:46:19 -0000 1.2 --- simpleobjectinstance.cfc 8 Sep 2002 02:38:20 -0000 1.3 *************** *** 39,45 **** SET date_updated = #dateDBFormat(now())#, packet = '#packet#' ! WHERE id = '#contentObject.getID()#' </cfquery> </cfif> <!--- if it's not a good contentObject ---> <cfelse> --- 39,47 ---- SET date_updated = #dateDBFormat(now())#, packet = '#packet#' ! WHERE id = '#arguments.contentObject.getID()#' </cfquery> </cfif> + <!--- put the object in the cache ---> + <cfset cachePutObject(arguments.contentObject)> <!--- if it's not a good contentObject ---> <cfelse> *************** *** 53,56 **** --- 55,70 ---- <cfset var objectRetrieved = ""> <cfset var key = ""> + + <!--- if this object is cached, return that one ---> + <cfscript> + if(isObjectCached(arguments.id)){ + objectRetrieved = cacheGetObject(arguments.id); + if(structCount(arguments) GT 1) + return contentObjectPopulateFromInstance(arguments[2],objectRetrieved); + else + return objectRetrieved; + } + </cfscript> + <!--- try getting this instance ---> <cfquery name="getQuery" datasource="#datasource#"> |
From: <ndi...@us...> - 2002-09-08 02:37:48
|
Update of /cvsroot/modus/org/bacfug/modus/persistence In directory usw-pr-cvs1:/tmp/cvs-serv28848/bacfug/modus/persistence Modified Files: basepersister.cfc Log Message: added the basic mechanics for doing caching of object instances to the server scope. For now, it will never retrieve from the cache because of the errors in the pageContext() in the current release of MX, but the soon promised SP should fix that, at which time we'll just uncomment the line in the isObjectCached method. We also needed to add a way to populate a given instance from another instance, so we can instantiate an object, then populate it from an instance held in the cache. Index: basepersister.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/persistence/basepersister.cfc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** basepersister.cfc 3 Sep 2002 22:46:18 -0000 1.2 --- basepersister.cfc 8 Sep 2002 02:37:45 -0000 1.3 *************** *** 2,5 **** --- 2,10 ---- <cfparam name="instance" default="#structNew()#"> <cffunction name="init" access="public" hint="The initializer" returnType="org.bacfug.modus.persistence.basePersister" output="no"> + <cfscript> + //make sure the cache is initialized + if(NOT isCacheInitialized()) + cacheInit(); + </cfscript> <cfreturn this> </cffunction> *************** *** 17,21 **** </cffunction> - <!--- a package function to determine if an object passed is, indeed, a baseContentObject ---> <cffunction name="isContentObject" access="package" returnType="boolean" output="no" hint="determines if something is a content object"> --- 22,25 ---- *************** *** 93,96 **** --- 97,118 ---- </cffunction> + <!--- populate one object instance from another ---> + <cffunction name="contentObjectPopulateFromInstance" access="package" returnType="org.bacfug.modus.baseContentObject" output="no" hint="Populates one contentObject instance from another"> + <cfargument name="contentObjectPopulatee" type="org.bacfug.modus.baseContentObject" required="yes"> + <cfargument name="contentObjectPopulator" type="org.bacfug.modus.baseContentObject" required="yes"> + <cfscript> + //init this object + arguments.contentObjectPopulatee.init(); + //set the id + arguments.contentObjectPopulatee.setID(arguments.contentObjectPopulator.getID()); + //set the dateCreated and dateModified + arguments.contentObjectPopulatee.setDateCreated(arguments.contentObjectPopulator.getDateCreated()); + arguments.contentObjectPopulatee.setDateModified(arguments.contentObjectPopulator.getDateModified()); + //load the fields + arguments.contentObjectPopulatee.setFieldValues(argumentCollection=arguments.contentObjectPopulator.fieldValueStruct()); + </cfscript> + <cfreturn arguments.contentObjectPopulatee> + </cffunction> + <!--- serialize to WDDX ---> <cffunction name="contentObjectToWddx" access="package" output="no" returnType="string" hint="creates a WDDX packet version of a contentObject"> *************** *** 115,119 **** <cfreturn packet> </cffunction> ! <cffunction name="wddxToContentObject" access="package" output="no" returnType="org.bacfug.modus.baseContentObject" hint="takes a WDDX packet and returns a contentObject (loaded or created)"> <!--- the packet ---> --- 137,141 ---- <cfreturn packet> </cffunction> ! <!--- go from WDDX back to a contentObject ---> <cffunction name="wddxToContentObject" access="package" output="no" returnType="org.bacfug.modus.baseContentObject" hint="takes a WDDX packet and returns a contentObject (loaded or created)"> <!--- the packet ---> *************** *** 134,137 **** --- 156,217 ---- </cfif> </cffunction> + + <!--- is the cache primed ---> + <cffunction name="isCacheInitialized" access="package" output="no" returnType="boolean" hint="Returns a boolean for whether the cache is initialized"> + <cfreturn structKeyExists(server,"modusCache")> + </cffunction> + <!--- initialize the cache ---> + <cffunction name="cacheInit" access="package" output="no" returnType="void" hint="Initializes the in-memory cache"> + <cfscript> + server.modusCache = structNew(); + server.modusCache.objectInstances = structNew(); + server.modusCache.objectTypes = structNew(); + </cfscript> + </cffunction> + + <!--- is a particular object instance in the cache? ---> + <cffunction name="isObjectCached" access="package" output="no" returnType="boolean" hint="Returns a boolean for whether a particular object (Based on ID) is cached"> + <cfargument name="id" required="yes" type="string"> + <cfscript> + if(NOT isCacheInitialized()){ + cacheInit(); + } + </cfscript> + + + <!--- ---> + <!--- ---> + <!--- ---> + <!--- REMOVE THIS WHEN SP1 GETS INSTALLED ---> + + <cfreturn false> + <!--- ---> + <!--- ---> + <!--- ---> + <!--- ---> + <!--- ---> + + + + <cfreturn structKeyExists(server.modusCache.objectInstances,arguments.id)> + </cffunction> + + <!--- put an object in the cache ---> + <cffunction name="cachePutObject" access="package" output="no" returnType="void" hint="Put a contentObject instance into the cache"> + <cfargument name="contentObject" required="yes" type="org.bacfug.modus.baseContentObject"> + <cfscript> + server.modusCache.objectInstances[arguments.contentObject.getID()] = arguments.contentObject; + </cfscript> + </cffunction> + + <!--- get an object from the cache ---> + <cffunction name="cacheGetObject" access="package" output="no" returnType="org.bacfug.modus.baseContentObject" hint="get an object instance from the cache"> + <cfargument name="id" required="yes" type="string"> + <cfif NOT isObjectCached(arguments.id)> + <cfthrow type="modus.badCacheRequest" message="Object does not exist in the cache" detail="The contentObject with ID ""#arguments.id#"" does not exist in the cache. You may not request an object that is not cached."> + </cfif> + <cfreturn server.modusCache.objectInstances[arguments.id]> + </cffunction> + </cfcomponent> |
From: <ndi...@us...> - 2002-09-08 02:35:46
|
Update of /cvsroot/modus/org/bacfug/modus In directory usw-pr-cvs1:/tmp/cvs-serv28566/bacfug/modus Modified Files: basecontentobject.cfc Log Message: only instantiate a new persister if it's not already made, since the persister doesn't hold any instance data it shouldn't need a new one every time we init() the object instance, right? In fact, we should probably cache this even more aggressively in the request scope, or even a persistent scope (if they EVER fix the pageContext issues). Index: basecontentobject.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/basecontentobject.cfc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** basecontentobject.cfc 3 Sep 2002 23:02:43 -0000 1.4 --- basecontentobject.cfc 8 Sep 2002 02:35:42 -0000 1.5 *************** *** 22,27 **** //by default, it was not loaded instance.wasLoadedFlag = false; ! //create an instance of the persister for this object, to avoid unnecessary createObject() calls later ! instance.persister = createObject("component",config.persister).init(); //initialize the properties of this instance initProperties(); --- 22,28 ---- //by default, it was not loaded instance.wasLoadedFlag = false; ! //create an instance of the persister for this object if we need to, to avoid unnecessary createObject() calls later ! if(NOT structKeyExists(instance,"persister")) ! instance.persister = createObject("component",config.persister).init(); //initialize the properties of this instance initProperties(); |
From: <ndi...@us...> - 2002-09-03 23:47:40
|
Update of /cvsroot/modus/org/bacfug/modus/fields In directory usw-pr-cvs1:/tmp/cvs-serv9847/bacfug/modus/fields Modified Files: basefile.cfc Log Message: fixed a bug in which the file reference got killed if a new file was not uploaded. But, we should figure out a way to kill the file reference altogether. Hmm. Perhaps a checkbox as part of the file form widget? Kind of messy, though. Index: basefile.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/fields/basefile.cfc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** basefile.cfc 3 Sep 2002 08:44:04 -0000 1.3 --- basefile.cfc 3 Sep 2002 23:47:37 -0000 1.4 *************** *** 23,26 **** --- 23,31 ---- } </cfscript> + <!--- if the form field is there, but it is blank and the arguments.value is the same, then just set the instance.value to whatever the value already is ---> + <cfelseif structKeyExists(form,getName()) AND NOT len(trim(form[getName()])) AND arguments.value is form[getName()]> + <cfscript> + instance.value = getValue(); + </cfscript> <!--- if we're not uploading the file, then the value is just the value ---> <cfelse> |
From: <ndi...@us...> - 2002-09-03 23:05:46
|
Update of /cvsroot/modus/org/bacfug/modus/fields In directory usw-pr-cvs1:/tmp/cvs-serv31581/bacfug/modus/fields Modified Files: basefield.cfc Log Message: init() the formFieldFactory -- this is in keeping with the style throughout Modus Index: basefield.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/fields/basefield.cfc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** basefield.cfc 3 Sep 2002 22:28:24 -0000 1.4 --- basefield.cfc 3 Sep 2002 23:05:38 -0000 1.5 *************** *** 20,24 **** //if necessary, create a form field factory if(NOT isDefined("request.modus.formFieldFactory")){ ! request.modus.formFieldFactory = createObject("component","org.bacfug.modus.form.formFieldFactory"); } //set the form field factory to this instance --- 20,24 ---- //if necessary, create a form field factory if(NOT isDefined("request.modus.formFieldFactory")){ ! request.modus.formFieldFactory = createObject("component","org.bacfug.modus.form.formFieldFactory").init(); } //set the form field factory to this instance |
From: <ndi...@us...> - 2002-09-03 23:05:05
|
Update of /cvsroot/modus/org/bacfug/modus/form In directory usw-pr-cvs1:/tmp/cvs-serv31382/bacfug/modus/form Modified Files: formfieldfactory.cfc Log Message: added the instance local var and an init method to bring it inline with the rest of the stuff we use Index: formfieldfactory.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/form/formfieldfactory.cfc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** formfieldfactory.cfc 3 Sep 2002 22:37:08 -0000 1.2 --- formfieldfactory.cfc 3 Sep 2002 23:05:02 -0000 1.3 *************** *** 1,3 **** --- 1,8 ---- <cfcomponent displayname="formFieldFactory" hint="This component can create all kinds of HTML form fields"> + <cfparam name="instance" default="#structNew()#"> + <!--- an init method ---> + <cffunction name="init" access="public" output="no" returnType="org.bacfug.modus.form.formFieldFactory" hint="an initialization method"> + <cfreturn this> + </cffunction> <!--- a field to make text ---> <cffunction name="makeText" access="public" output="no" returntype="string" hint="makes a regular form field"> |
From: <ndi...@us...> - 2002-09-03 23:03:24
|
Update of /cvsroot/modus/org/bacfug/modus/errors In directory usw-pr-cvs1:/tmp/cvs-serv30967/bacfug/modus/errors Modified Files: baseerror.cfc Log Message: the init method should return itself, so that you can do: foo = createObject("component","error").init(); Index: baseerror.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/errors/baseerror.cfc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** baseerror.cfc 3 Sep 2002 22:34:32 -0000 1.3 --- baseerror.cfc 3 Sep 2002 23:03:20 -0000 1.4 *************** *** 2,6 **** <cfparam name="instance" default="#structNew()#"> <!--- init, to set type, message, detail ---> ! <cffunction name="init" access="public" output="no" hint="initialize the error" returnType="void"> <cfargument name="message" required="no" default="#instance.message#" type="string"> <cfargument name="type" required="no" default="#instance.type#" type="string"> --- 2,6 ---- <cfparam name="instance" default="#structNew()#"> <!--- init, to set type, message, detail ---> ! <cffunction name="init" access="public" output="no" hint="initialize the error" returnType="org.bacfug.modus.errors.baseError"> <cfargument name="message" required="no" default="#instance.message#" type="string"> <cfargument name="type" required="no" default="#instance.type#" type="string"> *************** *** 17,20 **** --- 17,21 ---- setDetail(arguments.detail); </cfscript> + <cfreturn this> </cffunction> <!--- getter and setter for type ---> |
From: <ndi...@us...> - 2002-09-03 23:02:46
|
Update of /cvsroot/modus/org/bacfug/modus In directory usw-pr-cvs1:/tmp/cvs-serv30783/bacfug/modus Modified Files: basecontentobject.cfc Log Message: whoops, getFields() returns a struct, not an array. Index: basecontentobject.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/basecontentobject.cfc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** basecontentobject.cfc 3 Sep 2002 22:59:54 -0000 1.3 --- basecontentobject.cfc 3 Sep 2002 23:02:43 -0000 1.4 *************** *** 75,79 **** ---> <!--- get the fields ---> ! <cffunction name="getFields" access="public" output="no" returnType="array" hint="get the fields"> <cfreturn instance.fields/> </cffunction> --- 75,79 ---- ---> <!--- get the fields ---> ! <cffunction name="getFields" access="public" output="no" returnType="struct" hint="get the fields"> <cfreturn instance.fields/> </cffunction> |
From: <ndi...@us...> - 2002-09-03 22:59:57
|
Update of /cvsroot/modus/org/bacfug/modus In directory usw-pr-cvs1:/tmp/cvs-serv29728/bacfug/modus Modified Files: basecontentobject.cfc Log Message: cleaned up the attributes of the CFFUNCTION tags to add returnType to all of them Index: basecontentobject.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/basecontentobject.cfc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** basecontentobject.cfc 3 Sep 2002 08:41:31 -0000 1.2 --- basecontentobject.cfc 3 Sep 2002 22:59:54 -0000 1.3 *************** *** 1,5 **** <cfcomponent displayname="baseContentObject" hint="This is the base content object that all others must extend"> <!--- the intialization method to be used when the cfc is instantiated ---> ! <cffunction name="init" access="public" output="no" hint="The initialization method to be used when a contentObject is instantiated"> <cfparam name="config" default="#structNew()#"> <cfparam name="instance" default="#structNew()#"> --- 1,5 ---- <cfcomponent displayname="baseContentObject" hint="This is the base content object that all others must extend"> <!--- the intialization method to be used when the cfc is instantiated ---> ! <cffunction name="init" access="public" output="no" returnType="org.bacfug.modus.baseContentObject" hint="The initialization method to be used when a contentObject is instantiated"> <cfparam name="config" default="#structNew()#"> <cfparam name="instance" default="#structNew()#"> *************** *** 40,44 **** <!--- store this instance ---> ! <cffunction name="store" access="public" output="no" hint="store this instance"> <!--- if there no errors store it ---> <cfif NOT hasErrors()> --- 40,44 ---- <!--- store this instance ---> ! <cffunction name="store" access="public" output="no" returnType="void" hint="store this instance"> <!--- if there no errors store it ---> <cfif NOT hasErrors()> *************** *** 55,59 **** </cffunction> <!--- load an existing instance into this one ---> ! <cffunction name="load" access="public" output="no" hint="load an existing instance into this one"> <cfargument name="id" required="yes" type="string"> <cfscript> --- 55,59 ---- </cffunction> <!--- load an existing instance into this one ---> ! <cffunction name="load" access="public" output="no" returnType="void" hint="load an existing instance into this one"> <cfargument name="id" required="yes" type="string"> <cfscript> *************** *** 75,83 **** ---> <!--- get the fields ---> ! <cffunction name="getFields" access="public" output="no" hint="get the fields"> <cfreturn instance.fields/> </cffunction> <!--- get a particular field ---> ! <cffunction name="getField" access="public" output="no" hint="get a particular field"> <cfargument name="name" required="yes"> <cfif fieldExists(arguments.name)> --- 75,83 ---- ---> <!--- get the fields ---> ! <cffunction name="getFields" access="public" output="no" returnType="array" hint="get the fields"> <cfreturn instance.fields/> </cffunction> <!--- get a particular field ---> ! <cffunction name="getField" access="public" output="no" returnType="org.bacfug.modus.fields.baseField" hint="get a particular field"> <cfargument name="name" required="yes"> <cfif fieldExists(arguments.name)> *************** *** 88,92 **** </cffunction> <!--- return a struct of the field values ---> ! <cffunction name="fieldValueStruct" access="public" output="no" hint="return a struct of the field values"> <cfset var struct = structNew()> <cfset var key = ""> --- 88,92 ---- </cffunction> <!--- return a struct of the field values ---> ! <cffunction name="fieldValueStruct" access="public" output="no" returnType="struct" hint="return a struct of the field values"> <cfset var struct = structNew()> <cfset var key = ""> *************** *** 98,103 **** <cfreturn struct> </cffunction> <!--- make variables in a struct for each of the fields ---> ! <cffunction name="fieldsToScope" access="public" output="no" hint="make variables in a struct for each of the fields"> <cfargument name="scope" required="no" default="#variables#"> <cfset var key = ""> --- 98,108 ---- <cfreturn struct> </cffunction> + <!--- + + THIS IS A CANDIDATE FOR BEING DELETED + + <!--- make variables in a struct for each of the fields ---> ! <cffunction name="fieldsToScope" access="public" output="no" returnType="void" hint="make variables in a struct for each of the fields"> <cfargument name="scope" required="no" default="#variables#"> <cfset var key = ""> *************** *** 108,111 **** --- 113,118 ---- </cfscript> </cffunction> + + ---> <!--- a method to see if a field exists ---> <cffunction name="fieldExists" access="public" output="no" returntype="boolean" hint="a method to see if a field exists"> *************** *** 129,133 **** ---> ! <cffunction name="getErrors" access="public" returnType="array" hint="Gets an array of errors from the fields"> <cfset var errorArray = arrayNew(1)> <cfset var fields = getFields()> --- 136,140 ---- ---> ! <cffunction name="getErrors" access="public" returnType="array" output="no" hint="Gets an array of errors from the fields"> <cfset var errorArray = arrayNew(1)> <cfset var fields = getFields()> *************** *** 147,151 **** <cfreturn errorArray> </cffunction> ! <cffunction name="hasErrors" access="public" returnType="boolean" hint="Returns a boolean for whether there are any errors. This is mostly for convenience, so you don't need to return all of the errors just to see if there are any."> <cfset var fields = getFields()> <cfset var key = ""> --- 154,158 ---- <cfreturn errorArray> </cffunction> ! <cffunction name="hasErrors" access="public" returnType="boolean" output="no" hint="Returns a boolean for whether there are any errors. This is mostly for convenience, so you don't need to return all of the errors just to see if there are any."> <cfset var fields = getFields()> <cfset var key = ""> *************** *** 169,216 **** <!--- a function to know if it was loaded ---> ! <cffunction name="isNew" access="public" output="no" hint="a function to know if it was loaded"> <cfreturn NOT instance.wasLoadedFlag> </cffunction> <!--- a method to get the instance.id of this instance ---> ! <cffunction name="getID" access="public" output="No" hint="a method to get the instance.id of this instance"> <cfreturn instance.id> </cffunction> <!--- a method to set the instance.id of this instance ---> ! <cffunction name="setID" access="public" output="No" hint="a method to set the instance.id of this instance"> <cfargument name="id" required="yes" type="string"> <cfset instance.id = arguments.id> </cffunction> <!--- a method for getting the instance.dateCreated ---> ! <cffunction name="getDateCreated" access="public" output="No" hint="a method for getting the instance.dateCreated"> <cfreturn instance.dateCreated> </cffunction> <!--- a method for setting the instance.dateCreated ---> ! <cffunction name="setDateCreated" access="public" output="No" hint="a method for setting the instance.dateCreated"> <cfargument name="dateCreated" required="yes" type="date"> <cfset instance.dateCreated = arguments.dateCreated> </cffunction> <!--- a method for getting the instance.dateModified ---> ! <cffunction name="getdateModified" access="public" output="No" hint="a method for getting the instance.dateModified"> <cfreturn instance.dateModified> </cffunction> <!--- a method for setting the instance.dateModified ---> ! <cffunction name="setdateModified" access="public" output="No" hint="a method for setting the instance.dateModified"> <cfargument name="dateModified" required="yes" type="date"> <cfset instance.dateModified = arguments.dateModified> </cffunction> <!--- a method to get the type of object ---> ! <cffunction name="getType" access="public" output="No" hint="a method to get the type of object"> <cfreturn instance.metaData["NAME"]> </cffunction> <!--- a method to get the instance.label ---> ! <cffunction name="getLabel" access="public" output="No" hint="a method to get the instance.label"> <cfreturn instance.label> </cffunction> ! <cffunction name="getLabelPlural" access="public" output="No" hint="a method to the instance.labelPlural"> <cfreturn instance.labelPlural> </cffunction> <!--- a method to set the instance.label ---> ! <cffunction name="setLabel" access="public" output="no" hint="a method to set the label and labelplural"> <cfargument name="label" required="yes" type="string"> <cfargument name="labelPlural" required="no" type="string" default="#arguments.newLabel#s"> --- 176,223 ---- <!--- a function to know if it was loaded ---> ! <cffunction name="isNew" access="public" output="no" returnType="boolean" hint="a function to know if it was loaded"> <cfreturn NOT instance.wasLoadedFlag> </cffunction> <!--- a method to get the instance.id of this instance ---> ! <cffunction name="getID" access="public" output="No" returnType="string" hint="a method to get the instance.id of this instance"> <cfreturn instance.id> </cffunction> <!--- a method to set the instance.id of this instance ---> ! <cffunction name="setID" access="public" output="No" returnType="void" hint="a method to set the instance.id of this instance"> <cfargument name="id" required="yes" type="string"> <cfset instance.id = arguments.id> </cffunction> <!--- a method for getting the instance.dateCreated ---> ! <cffunction name="getDateCreated" access="public" output="No" returnType="date" hint="a method for getting the instance.dateCreated"> <cfreturn instance.dateCreated> </cffunction> <!--- a method for setting the instance.dateCreated ---> ! <cffunction name="setDateCreated" access="public" output="No" returnType="void" hint="a method for setting the instance.dateCreated"> <cfargument name="dateCreated" required="yes" type="date"> <cfset instance.dateCreated = arguments.dateCreated> </cffunction> <!--- a method for getting the instance.dateModified ---> ! <cffunction name="getdateModified" access="public" output="No" returnType="date" hint="a method for getting the instance.dateModified"> <cfreturn instance.dateModified> </cffunction> <!--- a method for setting the instance.dateModified ---> ! <cffunction name="setdateModified" access="public" output="No" returnType="void" hint="a method for setting the instance.dateModified"> <cfargument name="dateModified" required="yes" type="date"> <cfset instance.dateModified = arguments.dateModified> </cffunction> <!--- a method to get the type of object ---> ! <cffunction name="getType" access="public" output="No" returnType="string" hint="a method to get the type of object"> <cfreturn instance.metaData["NAME"]> </cffunction> <!--- a method to get the instance.label ---> ! <cffunction name="getLabel" access="public" output="No" returnType="string" hint="a method to get the instance.label"> <cfreturn instance.label> </cffunction> ! <cffunction name="getLabelPlural" access="public" output="No" returnType="string" hint="a method to the instance.labelPlural"> <cfreturn instance.labelPlural> </cffunction> <!--- a method to set the instance.label ---> ! <cffunction name="setLabel" access="public" output="no" returnType="void" hint="a method to set the label and labelplural"> <cfargument name="label" required="yes" type="string"> <cfargument name="labelPlural" required="no" type="string" default="#arguments.newLabel#s"> *************** *** 226,230 **** ---> ! <cffunction name="renderBasicForm" output="no" access="public" hint="Create a very simple form for this instance"> <cfargument name="action" default="#getFileFromPath(getBaseTemplatePath())#"> <cfset var formString = ""> --- 233,237 ---- ---> ! <cffunction name="renderBasicForm" output="no" access="public" returnType="string" hint="Create a very simple form for this instance"> <cfargument name="action" default="#getFileFromPath(getBaseTemplatePath())#"> <cfset var formString = ""> *************** *** 275,279 **** <!--- a method for creating a field ---> ! <cffunction name="fieldAdd" access="package" output="No" hint="Makes a field used primarily in the properties of specific content object definition components."> <!--- each field must have name ---> <cfargument name="name" required="Yes" type="variableName"/> --- 282,286 ---- <!--- a method for creating a field ---> ! <cffunction name="fieldAdd" access="package" output="No" returnType="void" hint="Makes a field used primarily in the properties of specific content object definition components."> <!--- each field must have name ---> <cfargument name="name" required="Yes" type="variableName"/> *************** *** 295,299 **** <!--- a method to initialize the properties of this instance (run during the init() for this instance) ---> ! <cffunction name="initProperties" access="private" output="no" hint="Used in the base init() to activate all of the properties of this instance"> <!--- get all the properties of this instance (including up the tree) ---> <cfset var propertyStruct = getAllProperties()/> --- 302,306 ---- <!--- a method to initialize the properties of this instance (run during the init() for this instance) ---> ! <cffunction name="initProperties" access="private" output="no" returnType="void" hint="Used in the base init() to activate all of the properties of this instance"> <!--- get all the properties of this instance (including up the tree) ---> <cfset var propertyStruct = getAllProperties()/> *************** *** 306,310 **** </cffunction> <!--- a method that deals with a property ---> ! <cffunction name="propertyActivate" access="private" output="no" hint="handles each individual property, based on type"> <cfargument name="property" required="yes" type="struct"> <cfscript> --- 313,317 ---- </cffunction> <!--- a method that deals with a property ---> ! <cffunction name="propertyActivate" access="private" output="no" returnType="void" hint="handles each individual property, based on type"> <cfargument name="property" required="yes" type="struct"> <cfscript> *************** *** 329,333 **** </cffunction> <!--- a method for traversing the metaData to get properties up the tree, by default, looks at this ---> ! <cffunction name="getAllProperties" access="private" output="no" hint="a method for traversing the metaData to get properties up the tree, by default, looks at this "> <cfargument name="metaDataToCheck" required="no" default="#getMetaData(this)#" type="struct"> <cfset var ii = 1> --- 336,340 ---- </cffunction> <!--- a method for traversing the metaData to get properties up the tree, by default, looks at this ---> ! <cffunction name="getAllProperties" access="private" output="no" returnType="struct" hint="a method for traversing the metaData to get properties up the tree, by default, looks at this "> <cfargument name="metaDataToCheck" required="no" default="#getMetaData(this)#" type="struct"> <cfset var ii = 1> *************** *** 344,348 **** </cffunction> <!--- get the properties from a specific meta data or component instance (by default, this) ---> ! <cffunction name="getProperties" access="private" output="no" hint="get the properties from a specific meta data or component instance (by default, this)"> <cfargument name="metaDataToCheck" required="no" default="#getMetaData(this)#"> <cfset var ii = 1> --- 351,355 ---- </cffunction> <!--- get the properties from a specific meta data or component instance (by default, this) ---> ! <cffunction name="getProperties" access="private" output="no" returnType="struct" hint="get the properties from a specific meta data or component instance (by default, this)"> <cfargument name="metaDataToCheck" required="no" default="#getMetaData(this)#"> <cfset var ii = 1> |
Update of /cvsroot/modus/org/bacfug/modus/validation In directory usw-pr-cvs1:/tmp/cvs-serv27703/bacfug/modus/validation Modified Files: baserule.cfc boolean.cfc date.cfc email.cfc full.cfc integer.cfc numeric.cfc required.cfc url.cfc uuid.cfc Log Message: cleaned up the attributes of CFFUNCTION tags Index: baserule.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/validation/baserule.cfc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** baserule.cfc 2 Sep 2002 21:42:08 -0000 1.1 --- baserule.cfc 3 Sep 2002 22:53:40 -0000 1.2 *************** *** 2,14 **** <cfparam name="instance" default="#structNew()#"> <!--- the initializer ---> ! <cffunction name="init" access="public"> <cfreturn this> </cffunction> <!--- every rule must have an isOK method defined ---> ! <cffunction name="isOK" access="public"> <cfthrow message="isOK() method is not implemented for this rule!"> </cffunction> <!--- every rule should be able to generate an error message, so make a default one ---> ! <cffunction name="errorMessage" access="public"> <cfargument name="label" default="Field"> <cfargument name="value" default=""> --- 2,14 ---- <cfparam name="instance" default="#structNew()#"> <!--- the initializer ---> ! <cffunction name="init" access="public" returnType="org.bacfug.modus.validation.baseRule" output="no" hint="initialize this instance"> <cfreturn this> </cffunction> <!--- every rule must have an isOK method defined ---> ! <cffunction name="isOK" access="public" hint="this is the method name that each rule must create for itself" returnType="boolean"> <cfthrow message="isOK() method is not implemented for this rule!"> </cffunction> <!--- every rule should be able to generate an error message, so make a default one ---> ! <cffunction name="errorMessage" access="public" ouput="no" returnType="string" hint="a default errorMessage for this rule to create"> <cfargument name="label" default="Field"> <cfargument name="value" default=""> Index: boolean.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/validation/boolean.cfc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** boolean.cfc 3 Sep 2002 06:47:48 -0000 1.1 --- boolean.cfc 3 Sep 2002 22:53:40 -0000 1.2 *************** *** 1,5 **** <cfcomponent extends="org.bacfug.modus.validation.baseRule" hint="This is the rule for fields that need to be a boolean value."> ! <cffunction name="isOK" access="public"> <cfargument name="value" required="yes"> <cfif isBoolean(arguments.value)> --- 1,5 ---- <cfcomponent extends="org.bacfug.modus.validation.baseRule" hint="This is the rule for fields that need to be a boolean value."> ! <cffunction name="isOK" access="public" output="no" returnType="boolean" hint="method to know if the value passes this rule"> <cfargument name="value" required="yes"> <cfif isBoolean(arguments.value)> *************** *** 9,13 **** </cffunction> <!--- every rule should be able to generate an error message, so make a default one ---> ! <cffunction name="errorMessage" access="public"> <cfargument name="label" default=""> <cfargument name="value" default=""> --- 9,13 ---- </cffunction> <!--- every rule should be able to generate an error message, so make a default one ---> ! <cffunction name="errorMessage" access="public" ouput="no" returnType="string" hint="generate an error message for this rule"> <cfargument name="label" default=""> <cfargument name="value" default=""> Index: date.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/validation/date.cfc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** date.cfc 3 Sep 2002 06:47:48 -0000 1.2 --- date.cfc 3 Sep 2002 22:53:40 -0000 1.3 *************** *** 1,5 **** <cfcomponent extends="org.bacfug.modus.validation.baseRule" hint="This is the rule for fields that need to be dates."> ! <cffunction name="isOK" access="public"> <cfargument name="value" required="yes"> <cfif isDate(arguments.value)> --- 1,5 ---- <cfcomponent extends="org.bacfug.modus.validation.baseRule" hint="This is the rule for fields that need to be dates."> ! <cffunction name="isOK" access="public" output="no" returnType="boolean" hint="method to know if the value passes this rule"> <cfargument name="value" required="yes"> <cfif isDate(arguments.value)> *************** *** 9,13 **** </cffunction> <!--- every rule should be able to generate an error message, so make a default one ---> ! <cffunction name="errorMessage" access="public"> <cfargument name="label" default=""> <cfargument name="value" default=""> --- 9,13 ---- </cffunction> <!--- every rule should be able to generate an error message, so make a default one ---> ! <cffunction name="errorMessage" access="public" ouput="no" returnType="string" hint="generate an error message for this rule"> <cfargument name="label" default=""> <cfargument name="value" default=""> Index: email.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/validation/email.cfc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** email.cfc 3 Sep 2002 06:47:48 -0000 1.1 --- email.cfc 3 Sep 2002 22:53:40 -0000 1.2 *************** *** 1,5 **** <cfcomponent extends="org.bacfug.modus.validation.baseRule" hint="This is the rule for fields that need to be an email address."> ! <cffunction name="isOK" access="public"> <cfargument name="value" required="yes"> <cfif REFindNoCase("^['_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.(([a-z]{2,3})|(aero|coop|info|museum|name))$",arguments.value)> --- 1,5 ---- <cfcomponent extends="org.bacfug.modus.validation.baseRule" hint="This is the rule for fields that need to be an email address."> ! <cffunction name="isOK" access="public" output="no" returnType="boolean" hint="method to know if the value passes this rule"> <cfargument name="value" required="yes"> <cfif REFindNoCase("^['_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.(([a-z]{2,3})|(aero|coop|info|museum|name))$",arguments.value)> *************** *** 9,13 **** </cffunction> <!--- every rule should be able to generate an error message, so make a default one ---> ! <cffunction name="errorMessage" access="public"> <cfargument name="label" default=""> <cfargument name="value" default=""> --- 9,13 ---- </cffunction> <!--- every rule should be able to generate an error message, so make a default one ---> ! <cffunction name="errorMessage" access="public" ouput="no" returnType="string" hint="generate an error message for this rule"> <cfargument name="label" default=""> <cfargument name="value" default=""> Index: full.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/validation/full.cfc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** full.cfc 3 Sep 2002 06:47:48 -0000 1.2 --- full.cfc 3 Sep 2002 22:53:40 -0000 1.3 *************** *** 1,5 **** <cfcomponent extends="org.bacfug.modus.validation.baseRule" hint="This is the rule for fields that need to be filled in."> ! <cffunction name="isOK" access="public"> <cfargument name="value" required="yes"> <cfif len(trim(arguments.value))> --- 1,5 ---- <cfcomponent extends="org.bacfug.modus.validation.baseRule" hint="This is the rule for fields that need to be filled in."> ! <cffunction name="isOK" access="public" output="no" returnType="boolean" hint="method to know if the value passes this rule"> <cfargument name="value" required="yes"> <cfif len(trim(arguments.value))> *************** *** 9,13 **** </cffunction> <!--- every rule should be able to generate an error message, so make a default one ---> ! <cffunction name="errorMessage" access="public"> <cfargument name="label" default=""> <cfargument name="value" default=""> --- 9,13 ---- </cffunction> <!--- every rule should be able to generate an error message, so make a default one ---> ! <cffunction name="errorMessage" access="public" ouput="no" returnType="string" hint="generate an error message for this rule"> <cfargument name="label" default=""> <cfargument name="value" default=""> Index: integer.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/validation/integer.cfc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** integer.cfc 3 Sep 2002 06:47:48 -0000 1.1 --- integer.cfc 3 Sep 2002 22:53:40 -0000 1.2 *************** *** 1,5 **** <cfcomponent extends="org.bacfug.modus.validation.baseRule" hint="This is the rule for fields that need to be an integer."> ! <cffunction name="isOK" access="public"> <cfargument name="value" required="yes"> <cfif isNumeric(arguments.value) AND round(arguments.value) IS arguments.value> --- 1,5 ---- <cfcomponent extends="org.bacfug.modus.validation.baseRule" hint="This is the rule for fields that need to be an integer."> ! <cffunction name="isOK" access="public" output="no" returnType="boolean" hint="method to know if the value passes this rule"> <cfargument name="value" required="yes"> <cfif isNumeric(arguments.value) AND round(arguments.value) IS arguments.value> *************** *** 9,13 **** </cffunction> <!--- every rule should be able to generate an error message, so make a default one ---> ! <cffunction name="errorMessage" access="public"> <cfargument name="label" default=""> <cfargument name="value" default=""> --- 9,13 ---- </cffunction> <!--- every rule should be able to generate an error message, so make a default one ---> ! <cffunction name="errorMessage" access="public" ouput="no" returnType="string" hint="generate an error message for this rule"> <cfargument name="label" default=""> <cfargument name="value" default=""> Index: numeric.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/validation/numeric.cfc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** numeric.cfc 3 Sep 2002 06:47:48 -0000 1.1 --- numeric.cfc 3 Sep 2002 22:53:40 -0000 1.2 *************** *** 1,5 **** <cfcomponent extends="org.bacfug.modus.validation.baseRule" hint="This is the rule for fields that need to be numeric."> ! <cffunction name="isOK" access="public"> <cfargument name="value" required="yes"> <cfif isNumeric(arguments.value)> --- 1,5 ---- <cfcomponent extends="org.bacfug.modus.validation.baseRule" hint="This is the rule for fields that need to be numeric."> ! <cffunction name="isOK" access="public" output="no" returnType="boolean" hint="method to know if the value passes this rule"> <cfargument name="value" required="yes"> <cfif isNumeric(arguments.value)> *************** *** 9,13 **** </cffunction> <!--- every rule should be able to generate an error message, so make a default one ---> ! <cffunction name="errorMessage" access="public"> <cfargument name="label" default=""> <cfargument name="value" default=""> --- 9,13 ---- </cffunction> <!--- every rule should be able to generate an error message, so make a default one ---> ! <cffunction name="errorMessage" access="public" ouput="no" returnType="string" hint="generate an error message for this rule"> <cfargument name="label" default=""> <cfargument name="value" default=""> Index: required.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/validation/required.cfc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** required.cfc 3 Sep 2002 06:47:48 -0000 1.2 --- required.cfc 3 Sep 2002 22:53:40 -0000 1.3 *************** *** 1,10 **** <cfcomponent extends="org.bacfug.modus.validation.baseRule" displayname="required" hint="This is the rule for fields that are required."> ! <cffunction name="isOK" access="public"> ! <cfargumet name="value" required="yes"> ! <cfif NOT structKeyExists(form,value)> ! <cfreturn false> ! </cfif> ! <cfreturn true> </cffunction> --- 1,6 ---- <cfcomponent extends="org.bacfug.modus.validation.baseRule" displayname="required" hint="This is the rule for fields that are required."> ! <cffunction name="isOK" access="public" output="no" returnType="boolean" hint="method to know if the value passes this rule"> ! <cfthrow message="the required rule just plain does not work right now. sorry."> </cffunction> Index: url.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/validation/url.cfc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** url.cfc 3 Sep 2002 06:47:48 -0000 1.1 --- url.cfc 3 Sep 2002 22:53:40 -0000 1.2 *************** *** 1,5 **** <cfcomponent extends="org.bacfug.modus.validation.baseRule" hint="This is the rule for fields that need to be a url."> ! <cffunction name="isOK" access="public"> <cfargument name="value" required="yes"> <cfif REFindNoCase("^(((https?:|ftp:|gopher:)\/\/))[-[:alnum:]\?%,\.\/&##!@:=\+~_]+[A-Za-z0-9\/]$",arguments.value)> --- 1,5 ---- <cfcomponent extends="org.bacfug.modus.validation.baseRule" hint="This is the rule for fields that need to be a url."> ! <cffunction name="isOK" access="public" output="no" returnType="boolean" hint="method to know if the value passes this rule"> <cfargument name="value" required="yes"> <cfif REFindNoCase("^(((https?:|ftp:|gopher:)\/\/))[-[:alnum:]\?%,\.\/&##!@:=\+~_]+[A-Za-z0-9\/]$",arguments.value)> *************** *** 9,13 **** </cffunction> <!--- every rule should be able to generate an error message, so make a default one ---> ! <cffunction name="errorMessage" access="public"> <cfargument name="label" default=""> <cfargument name="value" default=""> --- 9,13 ---- </cffunction> <!--- every rule should be able to generate an error message, so make a default one ---> ! <cffunction name="errorMessage" access="public" ouput="no" returnType="string" hint="generate an error message for this rule"> <cfargument name="label" default=""> <cfargument name="value" default=""> Index: uuid.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/validation/uuid.cfc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** uuid.cfc 3 Sep 2002 06:47:48 -0000 1.1 --- uuid.cfc 3 Sep 2002 22:53:40 -0000 1.2 *************** *** 1,5 **** <cfcomponent extends="org.bacfug.modus.validation.baseRule" hint="This is the rule for fields that need to be a UUID."> ! <cffunction name="isOK" access="public"> <cfargument name="value" required="yes"> <cfif REFindNoCase("^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{16}$",arguments.value)> --- 1,5 ---- <cfcomponent extends="org.bacfug.modus.validation.baseRule" hint="This is the rule for fields that need to be a UUID."> ! <cffunction name="isOK" access="public" output="no" returnType="boolean" hint="method to know if the value passes this rule"> <cfargument name="value" required="yes"> <cfif REFindNoCase("^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{16}$",arguments.value)> *************** *** 9,13 **** </cffunction> <!--- every rule should be able to generate an error message, so make a default one ---> ! <cffunction name="errorMessage" access="public"> <cfargument name="label" default=""> <cfargument name="value" default=""> --- 9,13 ---- </cffunction> <!--- every rule should be able to generate an error message, so make a default one ---> ! <cffunction name="errorMessage" access="public" ouput="no" returnType="string" hint="generate an error message for this rule"> <cfargument name="label" default=""> <cfargument name="value" default=""> |
From: <ndi...@us...> - 2002-09-03 22:46:22
|
Update of /cvsroot/modus/org/bacfug/modus/persistence In directory usw-pr-cvs1:/tmp/cvs-serv25676/bacfug/modus/persistence Modified Files: basepersister.cfc simpleobjectinstance.cfc Log Message: cleaned up the attributes of the CFFUNCTION tags Index: basepersister.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/persistence/basepersister.cfc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** basepersister.cfc 2 Sep 2002 21:42:08 -0000 1.1 --- basepersister.cfc 3 Sep 2002 22:46:18 -0000 1.2 *************** *** 1,17 **** <cfcomponent displayname="basePersister" hint="The base component for persistence objects"> <cfparam name="instance" default="#structNew()#"> ! <cffunction name="init" access="public" hint="The initializer"> <cfreturn this> </cffunction> ! <cffunction name="save" access="public" hint="The method to save data"> <cfthrow message="save() method not implemented!" detail="You must defined a save() method for #getMetaData(this).name#."> </cffunction> ! <cffunction name="get" access="public" hint="The method to get a particular data instance"> <cfthrow message="get() method not implemented!" detail="You must defined a get() method for #getMetaData(this).name#."> </cffunction> ! <cffunction name="getAll" access="public" hint="The method to get all data instances of a particular type. Should return an array of contentObjects."> <cfthrow message="getAll() method not implemented!" detail="You must defined a getAll() method for #getMetaData(this).name#."> </cffunction> --- 1,17 ---- <cfcomponent displayname="basePersister" hint="The base component for persistence objects"> <cfparam name="instance" default="#structNew()#"> ! <cffunction name="init" access="public" hint="The initializer" returnType="org.bacfug.modus.persistence.basePersister" output="no"> <cfreturn this> </cffunction> ! <cffunction name="save" access="public" output="no" hint="The method to save data"> <cfthrow message="save() method not implemented!" detail="You must defined a save() method for #getMetaData(this).name#."> </cffunction> ! <cffunction name="get" access="public" output="no" hint="The method to get a particular data instance"> <cfthrow message="get() method not implemented!" detail="You must defined a get() method for #getMetaData(this).name#."> </cffunction> ! <cffunction name="getAll" access="public" output="no" hint="The method to get all data instances of a particular type. Should return an array of contentObjects."> <cfthrow message="getAll() method not implemented!" detail="You must defined a getAll() method for #getMetaData(this).name#."> </cffunction> *************** *** 19,23 **** <!--- a package function to determine if an object passed is, indeed, a baseContentObject ---> ! <cffunction name="isContentObject" access="package" hint="determines if something is a content object"> <cfargument name="objectToCheck" required="yes" type="any"> <cfset var metaData = 0> --- 19,23 ---- <!--- a package function to determine if an object passed is, indeed, a baseContentObject ---> ! <cffunction name="isContentObject" access="package" returnType="boolean" output="no" hint="determines if something is a content object"> <cfargument name="objectToCheck" required="yes" type="any"> <cfset var metaData = 0> *************** *** 48,52 **** </cffunction> <!--- a package function to prepare a content object for storage ---> ! <cffunction name="contentObjectToSerializable" access="package" hint="Takes a content object and returns a struct appropriate for storage."> <cfargument name="contentObject" required="yes"> <cfset var storageStruct = structNew()> --- 48,52 ---- </cffunction> <!--- a package function to prepare a content object for storage ---> ! <cffunction name="contentObjectToSerializable" access="package" returntype="struct" output="no" hint="Takes a content object and returns a struct appropriate for storage."> <cfargument name="contentObject" required="yes"> <cfset var storageStruct = structNew()> *************** *** 66,70 **** <!--- populate a contentObject instance from a packet in the database ---> ! <cffunction name="contentObjectFromSerializable" access="package"> <!--- the serialized stuff ---> <cfargument name="serializableObject" required="yes"> --- 66,70 ---- <!--- populate a contentObject instance from a packet in the database ---> ! <cffunction name="contentObjectFromSerializable" access="package" returnType="org.bacfug.modus.baseContentObject" output="no" hint="creates or loads a contentObject from a serializable struct"> <!--- the serialized stuff ---> <cfargument name="serializableObject" required="yes"> *************** *** 94,98 **** <!--- serialize to WDDX ---> ! <cffunction name="contentObjectToWddx" access="package"> <cfargument name="contentObject" required="yes"> <cfset var objectToSerialize = ""> --- 94,98 ---- <!--- serialize to WDDX ---> ! <cffunction name="contentObjectToWddx" access="package" output="no" returnType="string" hint="creates a WDDX packet version of a contentObject"> <cfargument name="contentObject" required="yes"> <cfset var objectToSerialize = ""> *************** *** 116,120 **** </cffunction> ! <cffunction name="wddxToContentObject" access="package"> <!--- the packet ---> <cfargument name="packet" required="yes"> --- 116,120 ---- </cffunction> ! <cffunction name="wddxToContentObject" access="package" output="no" returnType="org.bacfug.modus.baseContentObject" hint="takes a WDDX packet and returns a contentObject (loaded or created)"> <!--- the packet ---> <cfargument name="packet" required="yes"> Index: simpleobjectinstance.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/persistence/simpleobjectinstance.cfc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** simpleobjectinstance.cfc 2 Sep 2002 21:42:08 -0000 1.1 --- simpleobjectinstance.cfc 3 Sep 2002 22:46:19 -0000 1.2 *************** *** 4,8 **** <cfparam name="datasource" default="modus"> ! <cffunction name="save" access="public" hint="The method to save data"> <cfargument name="contentObject" required="yes"> <cfset var objectToSave = ""> --- 4,8 ---- <cfparam name="datasource" default="modus"> ! <cffunction name="save" access="public" output="no" returnType="void" hint="The method to save data"> <cfargument name="contentObject" required="yes"> <cfset var objectToSave = ""> *************** *** 48,52 **** </cffunction> ! <cffunction name="get" access="public" hint="The method to get a particular data instance"> <cfargument name="id" type="string" required="yes"> <cfset var getQuery = ""> --- 48,52 ---- </cffunction> ! <cffunction name="get" access="public" output="no" returnType="org.bacfug.modus.baseContentObject" hint="The method to get a particular data instance"> <cfargument name="id" type="string" required="yes"> <cfset var getQuery = ""> *************** *** 77,81 **** </cffunction> ! <cffunction name="getAll" access="public" returntype="array" hint="The method to get all data instances of a particular type"> <cfargument name="type" required="no" default=""> <cfset var getQuery = ""> --- 77,81 ---- </cffunction> ! <cffunction name="getAll" access="public" returntype="array" output="no" hint="The method to get all data instances of a particular type"> <cfargument name="type" required="no" default=""> <cfset var getQuery = ""> *************** *** 104,108 **** <!--- a method to format the date (kind of a hack -- this should be more beautiful! ---> ! <cffunction name="dateDBFormat" access="private"> <cfargument name="dateToFormat" type="date" required="yes"> <cfreturn createODBCDateTime(dateToFormat)> --- 104,108 ---- <!--- a method to format the date (kind of a hack -- this should be more beautiful! ---> ! <cffunction name="dateDBFormat" returnType="date" output="no" access="private" hint="used to create a date in the proper format -- in theory, this would allow different implementations of this for different databases"> <cfargument name="dateToFormat" type="date" required="yes"> <cfreturn createODBCDateTime(dateToFormat)> |
From: <ndi...@us...> - 2002-09-03 22:37:11
|
Update of /cvsroot/modus/org/bacfug/modus/form In directory usw-pr-cvs1:/tmp/cvs-serv23174/bacfug/modus/form Modified Files: formfieldfactory.cfc Log Message: just adding the displayName Index: formfieldfactory.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/form/formfieldfactory.cfc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** formfieldfactory.cfc 3 Sep 2002 08:40:45 -0000 1.1 --- formfieldfactory.cfc 3 Sep 2002 22:37:08 -0000 1.2 *************** *** 1,3 **** ! <cfcomponent hint="This component can create all kinds of HTML form fields"> <!--- a field to make text ---> <cffunction name="makeText" access="public" output="no" returntype="string" hint="makes a regular form field"> --- 1,3 ---- ! <cfcomponent displayname="formFieldFactory" hint="This component can create all kinds of HTML form fields"> <!--- a field to make text ---> <cffunction name="makeText" access="public" output="no" returntype="string" hint="makes a regular form field"> |
From: <ndi...@us...> - 2002-09-03 22:34:35
|
Update of /cvsroot/modus/org/bacfug/modus/errors In directory usw-pr-cvs1:/tmp/cvs-serv22376/bacfug/modus/errors Modified Files: baseerror.cfc fielderror.cfc Log Message: cleaning up attributes to include the returnType Index: baseerror.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/errors/baseerror.cfc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** baseerror.cfc 3 Sep 2002 22:27:41 -0000 1.2 --- baseerror.cfc 3 Sep 2002 22:34:32 -0000 1.3 *************** *** 2,6 **** <cfparam name="instance" default="#structNew()#"> <!--- init, to set type, message, detail ---> ! <cffunction name="init" access="public" output="no" hint="initialize the error"> <cfargument name="message" required="no" default="#instance.message#" type="string"> <cfargument name="type" required="no" default="#instance.type#" type="string"> --- 2,6 ---- <cfparam name="instance" default="#structNew()#"> <!--- init, to set type, message, detail ---> ! <cffunction name="init" access="public" output="no" hint="initialize the error" returnType="void"> <cfargument name="message" required="no" default="#instance.message#" type="string"> <cfargument name="type" required="no" default="#instance.type#" type="string"> *************** *** 19,43 **** </cffunction> <!--- getter and setter for type ---> ! <cffunction name="setType" access="public" output="no" hint="Set the type"> <cfargument name="type" required="yes" type="string"> <cfset instance.type = arguments.type> </cffunction> ! <cffunction name="getType" access="public" output="no" hint="Get the type"> <cfreturn instance.type> </cffunction> <!--- getter and setter for message ---> ! <cffunction name="setMessage" access="public" output="no" hint="Set the message"> <cfargument name="message" required="yes" message="string"> <cfset instance.message = arguments.message> </cffunction> ! <cffunction name="getMessage" access="public" output="no" hint="Get the message"> <cfreturn instance.message> </cffunction> <!--- getter and setter for detail ---> ! <cffunction name="setDetail" access="public" output="no" hint="Set the detail"> <cfargument name="detail" required="yes" detail="string"> <cfset instance.detail = arguments.detail> </cffunction> ! <cffunction name="getDetail" access="public" output="no" hint="Get the detail"> <cfreturn instance.detail> </cffunction> --- 19,43 ---- </cffunction> <!--- getter and setter for type ---> ! <cffunction name="setType" access="public" output="no" hint="Set the type" returnType="void"> <cfargument name="type" required="yes" type="string"> <cfset instance.type = arguments.type> </cffunction> ! <cffunction name="getType" access="public" output="no" hint="Get the type" returnType="string"> <cfreturn instance.type> </cffunction> <!--- getter and setter for message ---> ! <cffunction name="setMessage" access="public" output="no" hint="Set the message" returnType="void"> <cfargument name="message" required="yes" message="string"> <cfset instance.message = arguments.message> </cffunction> ! <cffunction name="getMessage" access="public" output="no" hint="Get the message" returnType="string"> <cfreturn instance.message> </cffunction> <!--- getter and setter for detail ---> ! <cffunction name="setDetail" access="public" output="no" hint="Set the detail" returnType="void"> <cfargument name="detail" required="yes" detail="string"> <cfset instance.detail = arguments.detail> </cffunction> ! <cffunction name="getDetail" access="public" output="no" hint="Get the detail" returnType="string"> <cfreturn instance.detail> </cffunction> Index: fielderror.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/errors/fielderror.cfc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** fielderror.cfc 2 Sep 2002 21:42:08 -0000 1.1 --- fielderror.cfc 3 Sep 2002 22:34:32 -0000 1.2 *************** *** 1,5 **** <cfcomponent extends="org.bacfug.modus.errors.baseError" displayname="fieldError" hint="The error created by a field"> ! </cfcomponent> --- 1,5 ---- <cfcomponent extends="org.bacfug.modus.errors.baseError" displayname="fieldError" hint="The error created by a field"> ! <!--- at the moment the base error is just fine for fieldError! ---> </cfcomponent> |
From: <ndi...@us...> - 2002-09-03 22:29:08
|
Update of /cvsroot/modus/org/bacfug/modus/fields In directory usw-pr-cvs1:/tmp/cvs-serv20596/bacfug/modus/fields Modified Files: longtext.cfc text.cfc yesno.cfc Log Message: Cleaning up the attributes of CFFUNCTION to include the returnType and a hint (as well as output="no" where appropriate) Index: longtext.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/fields/longtext.cfc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** longtext.cfc 3 Sep 2002 08:44:04 -0000 1.2 --- longtext.cfc 3 Sep 2002 22:29:05 -0000 1.3 *************** *** 2,6 **** <!--- override the toFormField method to make a TEXTAREA ---> ! <cffunction name="toFormField"> <cfreturn instance.formFieldFactory.makeTextArea(getName(),getValue())> </cffunction> --- 2,6 ---- <!--- override the toFormField method to make a TEXTAREA ---> ! <cffunction name="toFormField" access="public" output="no" returnType="string" hint="returns a textarea form widget"> <cfreturn instance.formFieldFactory.makeTextArea(getName(),getValue())> </cffunction> Index: text.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/fields/text.cfc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** text.cfc 3 Sep 2002 08:44:04 -0000 1.2 --- text.cfc 3 Sep 2002 22:29:05 -0000 1.3 *************** *** 1,5 **** <cfcomponent extends="org.bacfug.modus.fields.baseField" displayname="textField" hint="The field for text"> <!--- override the toFormField method to make a TEXTAREA ---> ! <cffunction name="toFormField"> <cfreturn instance.formFieldFactory.makeText(getName(),getValue())> </cffunction> --- 1,5 ---- <cfcomponent extends="org.bacfug.modus.fields.baseField" displayname="textField" hint="The field for text"> <!--- override the toFormField method to make a TEXTAREA ---> ! <cffunction name="toFormField" access="public" output="no" hint="returns a simple text form widget" returnType="string"> <cfreturn instance.formFieldFactory.makeText(getName(),getValue())> </cffunction> Index: yesno.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/fields/yesno.cfc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** yesno.cfc 3 Sep 2002 22:06:01 -0000 1.4 --- yesno.cfc 3 Sep 2002 22:29:05 -0000 1.5 *************** *** 1,5 **** <cfcomponent extends="org.bacfug.modus.fields.baseField" displayname="yesno" hint="The field for yes/no radio buttons"> <!--- override the toFormField method to make a TEXTAREA ---> ! <cffunction name="toFormField" access="public" output="no" hint="Renders two radio buttons with values ""yes"" and ""no"""> <cfreturn instance.formFieldFactory.makeRadio(getName(),"yes",getValue()) & --- 1,5 ---- <cfcomponent extends="org.bacfug.modus.fields.baseField" displayname="yesno" hint="The field for yes/no radio buttons"> <!--- override the toFormField method to make a TEXTAREA ---> ! <cffunction name="toFormField" access="public" output="no" returnType="string" hint="Renders two radio buttons with values ""yes"" and ""no"""> <cfreturn instance.formFieldFactory.makeRadio(getName(),"yes",getValue()) & |
From: <ndi...@us...> - 2002-09-03 22:28:29
|
Update of /cvsroot/modus/org/bacfug/modus/fields In directory usw-pr-cvs1:/tmp/cvs-serv20374/bacfug/modus/fields Modified Files: basefield.cfc Log Message: cleaned up the CFFUNCTION attributes and fixed the newError() method to not improperly call the init() method on the fieldError twice. Index: basefield.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/fields/basefield.cfc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** basefield.cfc 3 Sep 2002 08:42:41 -0000 1.3 --- basefield.cfc 3 Sep 2002 22:28:24 -0000 1.4 *************** *** 1,5 **** <cfcomponent displayname="baseField" hint="The base component for a field"> <cfparam name="instance" default="#structNew()#"> ! <cffunction name="init" access="public" output="no"> <cfargument name="defaultValue" required="no" default=""> <cfscript> --- 1,5 ---- <cfcomponent displayname="baseField" hint="The base component for a field"> <cfparam name="instance" default="#structNew()#"> ! <cffunction name="init" access="public" output="no" returnType="org.bacfug.modus.fields.baseField" hint="initialize this instance, creating the instance variables"> <cfargument name="defaultValue" required="no" default=""> <cfscript> *************** *** 29,42 **** <!--- a way to set the label ---> ! <cffunction name="setLabel" access="public" output="no"> <cfargument name="label" required="yes"> <cfset instance.label = arguments.label> </cffunction> <!--- a way to get the label ---> ! <cffunction name="getLabel" access="public" output="no"> <cfreturn instance.label> </cffunction> <!--- a method for setting the value ---> ! <cffunction name="setValue" access="public" output="no"> <cfargument name="value" required="yes"> <cfscript> --- 29,42 ---- <!--- a way to set the label ---> ! <cffunction name="setLabel" access="public" output="no" returnType="void" hint="sets the value of the label"> <cfargument name="label" required="yes"> <cfset instance.label = arguments.label> </cffunction> <!--- a way to get the label ---> ! <cffunction name="getLabel" access="public" output="no" returnType="string" hint="get the value of the label"> <cfreturn instance.label> </cffunction> <!--- a method for setting the value ---> ! <cffunction name="setValue" access="public" output="no" returnType="void" hint="sets the value of the instance value -- also validates internally to set the error state"> <cfargument name="value" required="yes"> <cfscript> *************** *** 46,70 **** </cffunction> <!--- a method to get the type of CFC ---> ! <cffunction name="getType" access="public" output="no"> <cfreturn instance.metaData["NAME"]> </cffunction> <!--- a method to get the value ---> ! <cffunction name="getValue" access="public" output="no"> <cfreturn instance.value> </cffunction> <!--- a method to get the name ---> ! <cffunction name="getName" access="public" output="no"> <cfreturn instance.name> </cffunction> <!--- to render it by default, just spit it out ---> ! <cffunction name="toHTML" access="public" output="no"> <cfreturn toString(instance.value)> </cffunction> <!--- render a form field ---> ! <cffunction name="toFormField" access="public" output="no"> ! <cfreturn "<input type=""text"" name=""" & getName() & """ value=""" & htmlEditFormat(getValue()) & """>"> </cffunction> <!--- a method the package can use to set the attributes of this field with a short-hand ---> ! <cffunction name="setAttributes" access="public"<!--- access="package" --->> <cfargument name="attributesToAdd" required="yes" type="struct" output="no"> <!--- an iterator ---> --- 46,70 ---- </cffunction> <!--- a method to get the type of CFC ---> ! <cffunction name="getType" access="public" output="no" returnType="string" hint="get the type of field (based on the name key in the metaData"> <cfreturn instance.metaData["NAME"]> </cffunction> <!--- a method to get the value ---> ! <cffunction name="getValue" access="public" output="no" returnType="any" hint="get whatever the value of this instance is"> <cfreturn instance.value> </cffunction> <!--- a method to get the name ---> ! <cffunction name="getName" access="public" output="no" returnType="string" hint="get the name assigned to this instance"> <cfreturn instance.name> </cffunction> <!--- to render it by default, just spit it out ---> ! <cffunction name="toHTML" access="public" output="no" returnType="string" hint="renders the value to HTML."> <cfreturn toString(instance.value)> </cffunction> <!--- render a form field ---> ! <cffunction name="toFormField" access="public" output="no" returnType="string" hint="returns a simple text form widget. Typically overridden in any implementation of a field"> ! <cfreturn instance.formFieldFactory.makeText(getName(),getValue())> </cffunction> <!--- a method the package can use to set the attributes of this field with a short-hand ---> ! <cffunction name="setAttributes" access="public" returnType="void" output="no" hint="a convenience method. given a struct, sets private data members (instance variables) to the value in the struct, overriding any existing values."> <cfargument name="attributesToAdd" required="yes" type="struct" output="no"> <!--- an iterator ---> *************** *** 72,76 **** </cffunction> <!--- a method to validate ---> ! <cffunction name="validate" access="package" output="no"> <cfset var ruleArray = listToArray(instance.rules)> <cfset var ii = 1> --- 72,76 ---- </cffunction> <!--- a method to validate ---> ! <cffunction name="validate" access="package" output="no" returnType="void" hint="runs through any rules and sets the error state and adds any error messages necessary"> <cfset var ruleArray = listToArray(instance.rules)> <cfset var ii = 1> *************** *** 87,100 **** </cffunction> <!--- a method to get the errors ---> ! <cffunction name="getErrors" access="public" returntype="array" output="no"> <cfreturn instance.errors> </cffunction> <!--- a method to return a boolean to know if there are any errors ---> ! <cffunction name="hasErrors" access="public" returnType="boolean" output="no"> <cfreturn yesNoFormat(arrayLen(getErrors()))> </cffunction> <!--- a method to add an error ---> ! <cffunction name="addError" access="package" output="no"> ! <cfargument name="error" required="yes"> <cfscript> arrayAppend(instance.errors,arguments.error); --- 87,100 ---- </cffunction> <!--- a method to get the errors ---> ! <cffunction name="getErrors" access="public" returntype="array" output="no" hint="returns an array of fieldError objects"> <cfreturn instance.errors> </cffunction> <!--- a method to return a boolean to know if there are any errors ---> ! <cffunction name="hasErrors" access="public" returnType="boolean" output="no" hint="returns a boolean value for whether any errors exist for this instance"> <cfreturn yesNoFormat(arrayLen(getErrors()))> </cffunction> <!--- a method to add an error ---> ! <cffunction name="addError" access="package" output="no" hint="internal method to add an error to this instance"> ! <cfargument name="error" required="yes" type="org.bacfug.modus.errors.fieldError"> <cfscript> arrayAppend(instance.errors,arguments.error); *************** *** 102,110 **** </cffunction> <!--- a method to create an error ---> ! <cffunction name="newError" access="package" output="no"> <cfargument name="type" required="no" default="modus.field"> <cfargument name="message" required="no" default="A general error occurred in #instance.name#"> <cfargument name="detail" required="no" default="#arguments.message#"> ! <cfset var error = createObject("component","org.bacfug.modus.errors.fieldError").init()> <cfscript> error.init(arguments.message,arguments.type,arguments.detail); --- 102,110 ---- </cffunction> <!--- a method to create an error ---> ! <cffunction name="newError" access="package" output="no" returnType="org.bacfug.modus.errors.fieldError" hint="generates an error object, used primarily inside of addError()"> <cfargument name="type" required="no" default="modus.field"> <cfargument name="message" required="no" default="A general error occurred in #instance.name#"> <cfargument name="detail" required="no" default="#arguments.message#"> ! <cfset var error = createObject("component","org.bacfug.modus.errors.fieldError")> <cfscript> error.init(arguments.message,arguments.type,arguments.detail); |
From: <ndi...@us...> - 2002-09-03 22:27:49
|
Update of /cvsroot/modus/org/bacfug/modus/errors In directory usw-pr-cvs1:/tmp/cvs-serv20178/bacfug/modus/errors Modified Files: baseerror.cfc Log Message: fixed bug in which I (stupidly) defined the init method twice Index: baseerror.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/errors/baseerror.cfc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** baseerror.cfc 2 Sep 2002 21:42:08 -0000 1.1 --- baseerror.cfc 3 Sep 2002 22:27:41 -0000 1.2 *************** *** 1,16 **** <cfcomponent displayname="baseError" hint="The base component for a Modus error"> <cfparam name="instance" default="#structNew()#"> - <cffunction name="init" access="public" hint="The initializer -- run it every time you instantiate"> - <cfscript> - //it's type - instance.type = "modus"; - //the message - instance.message = "An error occurred."; - //the detail - instance.detail = "An unspecified error occurred."; - </cfscript> - <cfreturn this> - </cffunction> - <!--- init, to set type, message, detail ---> <cffunction name="init" access="public" output="no" hint="initialize the error"> --- 1,4 ---- *************** *** 19,22 **** --- 7,16 ---- <cfargument name="detail" required="no" default="#instance.detail#" type="string"> <cfscript> + //it's type + instance.type = "modus"; + //the message + instance.message = "An error occurred."; + //the detail + instance.detail = "An unspecified error occurred."; setMessage(arguments.message); setType(arguments.type); |
From: <ndi...@us...> - 2002-09-03 22:06:04
|
Update of /cvsroot/modus/org/bacfug/modus/fields In directory usw-pr-cvs1:/tmp/cvs-serv14147/bacfug/modus/fields Modified Files: yesno.cfc Log Message: just adding in the attributes. mostly I just want to see if the new CVS syncmail is actually working ;) Index: yesno.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/fields/yesno.cfc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** yesno.cfc 3 Sep 2002 08:49:03 -0000 1.3 --- yesno.cfc 3 Sep 2002 22:06:01 -0000 1.4 *************** *** 1,5 **** <cfcomponent extends="org.bacfug.modus.fields.baseField" displayname="yesno" hint="The field for yes/no radio buttons"> <!--- override the toFormField method to make a TEXTAREA ---> ! <cffunction name="toFormField"> <cfreturn instance.formFieldFactory.makeRadio(getName(),"yes",getValue()) & --- 1,5 ---- <cfcomponent extends="org.bacfug.modus.fields.baseField" displayname="yesno" hint="The field for yes/no radio buttons"> <!--- override the toFormField method to make a TEXTAREA ---> ! <cffunction name="toFormField" access="public" output="no" hint="Renders two radio buttons with values ""yes"" and ""no"""> <cfreturn instance.formFieldFactory.makeRadio(getName(),"yes",getValue()) & |