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: <jfi...@us...> - 2003-01-09 01:53:42
|
Update of /cvsroot/modus/org/bacfug/modus/persistence In directory sc8-pr-cvs1:/tmp/cvs-serv5475/persistence Modified Files: basepersister.cfc Log Message: Whoops, these were the old files - pardon my CVS skills. The new files are now there. Index: basepersister.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/persistence/basepersister.cfc,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** basepersister.cfc 30 Oct 2002 03:00:29 -0000 1.11 --- basepersister.cfc 9 Jan 2003 01:53:39 -0000 1.12 *************** *** 1,42 **** ! <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"> ! <cfset var cachePathToUse = getCachePath()> ! <cfscript> ! //the cache we should use ! //if it has been cached, use the cached version ! ! /******************************* ! THIS REALLY IS A GOOD CANDIDATE FOR THE CONFIG DATA! ! ********************************/ ! ! if(NOT structKeyExists(server.modus,cachePathToUse)){ ! instance.cache = createObject("component",getCachePath()).init(); ! server.modus[cachePathToUse] = instance.cache; } ! //otherwise, make a new one ! else{ ! instance.cache = server.modus[cachePathToUse]; ! } ! </cfscript> ! <cfreturn this> ! </cffunction> ! <cffunction name="getCachePath" access="private" returntype="string" output="no" hint="returns a string with the path to the cache component to use. you can override this function in a persister implementation if you want to use a different caching mechanism other than the default."> ! <cfreturn "org.bacfug.modus.caching.serverScopeCache"> ! </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> - <!--- 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"> --- 1,207 ---- ! <cfcomponent displayname="basePersister" hint=" ! Namespace: org.bacfug.modus.persistence ! XML Declararation (modus_settings.cfm): /modus/contenttypes/contenttype/persister ! Responsibilites: The base component for persistence objects. Moves content objects on and off disk as well as maintains a memory-based cache to speed up response times. ! "> ! <cfparam name="instance" default="#structNew()#"> ! <cffunction name="init" access="public" hint="The initializer" returnType="struct" output="no"> ! <cfargument name="contentType" type="org.bacfug.modus.contenttypes.basecontenttype" required="Yes"> ! <cfargument name="descriptor" required="Yes"> ! <cfargument name="globals" type="struct" required="Yes"> ! <cfargument name="cache" type="org.bacfug.modus.caching.basecache" required="Yes"> ! <cfscript> ! //the contentType component instance ! instance.contentType = arguments.contentType; ! //datasource ! instance.datasource = globals.datasource; ! //cache for this instance ! instance.cache = arguments.cache; ! //utility component reference ! instance.util = server._modus.core[arguments.globals.util]; ! //set field metadata ! instance.fields = instance.contentType.getFields(); ! //set collection metadata ! instance.collections = instance.contentType.getCollections(); ! //get a default object ! instance.defaultObject = initObject(arguments.descriptor); ! </cfscript> ! <cfreturn this> ! </cffunction> ! <!--- ! ! ACCESSORS ! ! ---> ! <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 define 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> ! <cffunction name="getAllSorted" access="package" returntype="array" output="no" hint="The method to get all data instances of a particular type sorted - this method works for the simplefilesystempersister and simpledbpersister. It should be overriden by other implementations."> ! <cfargument name="contentObjects" type="array" required="Yes"> ! <cfargument name="sortFields" type="string" required="yes"> ! <cfset var tempQuery = ""> ! <cfset var sortQuery = ""> ! <cfset var sortedArray = arrayNew(1)> ! <cfset var objectCount = arrayLen(arguments.contentObjects)> ! <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)); ! //if there any objects, then loop through and make them ! if(objectCount){ ! //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 = arguments.contentObjects[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,lcase(thisObject[thisFieldName]),ii); ! } } ! } ! </cfscript> ! <!--- if there are objects to sort, query them, then build the new array ---> ! <cfif objectCount> ! <!--- 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] = arguments.contentObjects[sortQuery.index[ii]]; ! } ! </cfscript> ! </cfif> ! <!--- return the sorted Array ---> ! <cfreturn sortedArray> ! </cffunction> ! <!--- ! ! MUTATORS ! ! ---> ! <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> ! <!--- ! ! Simple accessors for internal use by Modus components - public but not part of the API ! ! ---> ! <cffunction name="getName" access="public" returntype="string" output="No" hint="get this instance name"> ! <cfreturn instance.contentType.getName()> ! </cffunction> ! <cffunction name="getTableName" access="public" output="No" returnType="string" hint="get the name of the table associated with this content type"> ! <cfreturn instance.tablename> ! </cffunction> ! <!--- ! ! PACKAGE AND PRIVATE METHODS FOR INTERNAL WORK ! ! ---> ! <cffunction name="getNewObject" access="package" returntype="struct" output="No" hint="I construct a new contentObject."> ! <cfset var object = duplicate(instance.defaultObject)> ! <cfset var now = now()> ! <cfscript> ! object.ID = makeID(); ! object.dateModified = createODBCDate(now); ! object.dateCreated = createODBCDate(now); ! //Modus Lib needs to be able to find the contentType, but cfc's can't be cached so just use the component name ! object._modus.contentType = getMetaData(instance.contentType).name; ! //boolean error flag for content object ! object._modus.hasErrors = false; ! //boolean new flag ! object._modus.isNew = true; ! //boolean cache flag - used by collections to determine if the content object has changed ! object._modus.fromCache = false; ! </cfscript> ! <cfreturn object> ! </cffunction> ! <cffunction name="initObject" access="package" returntype="struct" output="No" hint="Create default object, initializing collections and fields."> ! <cfargument name="descriptor" required="Yes"> ! <!--- Local default object to return ---> ! <cfset var object = structNew()> ! <!--- "Private" container for internal reference ---> ! <cfset object._modus = structNew()> ! <!--- Collections container ---> ! <cfset object._modus.collections = structNew()> ! <!--- Append each collection to the default object for internal reference ---> ! <cfset structAppend(object._modus.collections, initCollections())> ! <!--- Append each field to the default object ---> ! <cfset structAppend(object, initFields())> ! <!--- Append each collection to the default object for external reference (new objects have empty collections) ---> ! <cfset structAppend(object, object._modus.collections)> ! <cfreturn object> ! </cffunction> ! <cffunction name="initCollections" access="package" returntype="struct" output="No" hint="Initialize collections. For the default implementation return an empty struct."> ! <cfreturn structNew()> ! </cffunction> ! <cffunction name="initFields" access="package" returntype="struct" output="No" hint="Set up fields and populate default object with default values."> ! <!--- Local struct to hold fields ---> ! <cfset var object = structNew()> ! <cfscript> ! //loop over each field ! for(field in instance.fields){ ! //set each field in the default object to a default value ! object[field] = instance.fields[field].defaultValue; ! } ! </cfscript> ! <cfreturn object> ! </cffunction> ! <cffunction name="makeID" access="package" output="no" returnType="uuid" hint="The mechanism to make a new id. Used in the init() and can be overridden in specific object types to have a different kind of default id"> ! <cfreturn createUUID()> ! </cffunction> ! <cffunction name="wddxToContentObject" access="package" output="no" returnType="struct" hint="takes a WDDX packet and returns a contentObject"> ! <!--- the packet ---> ! <cfargument name="packet" required="yes"> ! <cfset var deserializedObject = ""> ! <!--- deserialize the object packet ---> ! <cftry> ! <cfwddx action="wddx2cfml" input="#arguments.packet#" output="deserializedObject"> ! <cfcatch> ! <cfthrow type="modus.corruptObject" message="object could not be deserialized" detail="The contentObject storage packet appears to be corrupt and could not be deserialized in #getMetaData(this).name#"> ! </cfcatch> ! </cftry> ! <cfreturn deserializedObject> ! </cffunction> ! <cffunction name="contentObjectToWDDX" access="package" output="No" hint="Transform a content object into a wddx packet"> ! <cfargument name="contentObject" type="struct" required="Yes"> ! <cfset arguments.contentObject._modus.isNew = false> ! <cfset arguments.contentObject.dateModified = now()> ! <!--- serialize the contentObject struct ---> ! <cfwddx action="cfml2wddx" input="#arguments.contentObject#" output="packet"> ! <cfreturn packet> ! </cffunction> ! <cffunction name="getUtil" access="package" output="No"> ! <cfreturn instance.util> ! </cffunction> ! </cfcomponent> ! ! <!--- ! ! ************ ! ORIGINAL CODE - may still be useful ! ************ <!--- 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"> *************** *** 154,176 **** <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 ---> ! <cfargument name="packet" required="yes"> ! <cfset var deserializedObject = ""> ! <!--- deserialize the object packet ---> ! <cftry> ! <cfwddx action="wddx2cfml" input="#arguments.packet#" output="deserializedObject"> ! <cfcatch> ! <cfthrow type="modus.corruptObject" message="object could not be deserialized" detail="The contentObject storage packet appears to be corrupt and could not be deserialized in #getMetaData(this).name#"> ! </cfcatch> ! </cftry> ! ! <cfif structCount(arguments) GT 1> ! <cfreturn contentObjectFromSerializable(deserializedObject,arguments[2])> ! <cfelse> ! <cfreturn contentObjectFromSerializable(deserializedObject)> ! </cfif> ! </cffunction> ! </cfcomponent> ! --- 319,321 ---- <cfreturn packet> </cffunction> ! ---> |
Update of /cvsroot/modus/org/bacfug/modus/fields In directory sc8-pr-cvs1:/tmp/cvs-serv5475/fields Modified Files: basefield.cfc basefile.cfc hidden.cfc longtext.cfc text.cfc webimage.cfc yesno.cfc Log Message: Whoops, these were the old files - pardon my CVS skills. The new files are now there. Index: basefield.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/fields/basefield.cfc,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** basefield.cfc 3 Oct 2002 05:42:22 -0000 1.7 --- basefield.cfc 9 Jan 2003 01:53:39 -0000 1.8 *************** *** 2,115 **** <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> - //the label is blank by default - instance.label = ""; - //instance to hold the error - instance.errors = arrayNew(1); - //instane rules - instance.rules = ""; - //instance metaData - instance.metaData = getMetaData(this); - //the name is whatever the name in the meta data is - instance.name = instance.metaData.name; - //the default value - instance.defaultValue = arguments.defaultValue; - //the value is blank by default - setValue(instance.defaultValue); //if necessary, create a form field factory ! if(NOT isDefined("server.modus.formFieldFactory")){ ! server.modus.formFieldFactory = createObject("component","org.bacfug.modus.form.formFieldFactory").init(); } //set the form field factory to this instance ! //instance.formFieldFactory = server.modus.formFieldFactory; ! instance.formFieldFactory = createObject("component","org.bacfug.modus.form.formFieldFactory").init(); </cfscript> <cfreturn this> </cffunction> ! ! <!--- 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> ! instance.value = arguments.value; ! validate(); ! </cfscript> ! </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 ---> ! <cfset structAppend(instance,attributesToAdd,true)> ! </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> ! <cfset var ruleToRun = ""> ! <cfscript> ! for(ii = 1; ii LTE arrayLen(ruleArray); ii = ii + 1){ ! ruleToRun = createObject("component",ruleArray[ii]).init(); ! //if it's not OK, add an error ! if(NOT ruleToRun.isOK(instance.value)){ ! addError(newError(ruleArray[ii],ruleToRun.errorMessage(getLabel(),getValue()))); ! } ! } ! </cfscript> ! </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); ! </cfscript> ! </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); ! </cfscript> ! <cfreturn error> </cffunction> </cfcomponent> --- 2,30 ---- <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"> <cfscript> //if necessary, create a form field factory ! if(NOT isDefined("server._modus.core.formFieldFactory")){ ! server._modus.core.formFieldFactory = createObject("component","org.bacfug.modus.rendering.form.formFieldFactory").init(); } //set the form field factory to this instance ! instance.formFieldFactory = server._modus.core.formFieldFactory; </cfscript> <cfreturn this> </cffunction> ! <cffunction name="setValue" access="public" output="no" returnType="string" hint="default implementation returns the value sent. Children may override this method for more complicated form fields, e.g.:file uploads"> <cfargument name="value" required="yes"> ! <cfreturn arguments.value> </cffunction> <!--- to render it by default, just spit it out ---> ! <cffunction name="renderField" access="public" output="no" returnType="string" hint="renders the value to a simple string."> ! <cfargument name="name" type="string" required="Yes"> ! <cfargument name="value" required="Yes"> ! <cfreturn toString(arguments.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"> ! <cfargument name="name" type="string" required="Yes"> ! <cfargument name="value" required="Yes"> ! <cfreturn instance.formFieldFactory.makeText(arguments.name,arguments.value)> </cffunction> </cfcomponent> Index: basefile.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/fields/basefile.cfc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** basefile.cfc 3 Sep 2002 23:47:37 -0000 1.4 --- basefile.cfc 9 Jan 2003 01:53:39 -0000 1.5 *************** *** 1,40 **** ! <cfcomponent extends="org.bacfug.modus.fields.baseField" displayname="baseFile" hint="The base field for a file. Typically, this would not be used by itself, but extended by specific types of files -- that is primarily because each type of file (image, flash, doc) will want to define a different toHTML() method."> <cfparam name="instance.directory" default="#expandPath("/")#"> ! <!--- override the toFormField method to make a TEXTAREA ---> <cffunction name="toFormField" access="public" output="no" returntype="string"> ! <cfreturn instance.formFieldFactory.makeFile(getName())> </cffunction> <!--- a method for setting the value ---> ! <cffunction name="setValue" access="public" output="no" returnType="void"> <cfargument name="value" required="yes"> <!--- if there is a form element with this name and it has the same value of as the arguments.value then we assume we're trying to upload the file ---> ! <cfif structKeyExists(form,getName()) AND len(trim(form[getName()])) AND arguments.value is form[getName()]> <!--- try the upload of the file ---> ! <cffile action="upload" fileField="#getName()#" destination="#getDirectory()#" nameconflict="MAKEUNIQUE"> ! <cfscript> ! //set the instance.value to the full path to the file ! instance.value = getDirectory() & file.serverFile; //validate the upload, if it returns false, delete the file and blank out the value ! if(NOT fileValidate(argumentCollection=file)){ ! deleteFile(); } </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> ! <cfscript> ! instance.value = arguments.value; ! </cfscript> </cfif> - <cfscript> - validate(); - </cfscript> </cffunction> --- 1,35 ---- ! <cfcomponent extends="org.bacfug.modus.fields.baseField" displayname="baseFile" hint="The base field for a file. Typically, this would not be used by itself, but extended by specific types of files -- that is primarily because each type of file (image, flash, doc) will want to define a different renderField() method."> <cfparam name="instance.directory" default="#expandPath("/")#"> ! <!--- override the toFormField method to make a File Upload Field ---> <cffunction name="toFormField" access="public" output="no" returntype="string"> ! <cfargument name="name" type="string" required="Yes"> ! <cfreturn instance.formFieldFactory.makeFile(arguments.name)> </cffunction> <!--- a method for setting the value ---> ! <cffunction name="setValue" access="public" output="no" returnType="string"> <cfargument name="value" required="yes"> + <cfargument name="name" type="string" required="Yes"> <!--- if there is a form element with this name and it has the same value of as the arguments.value then we assume we're trying to upload the file ---> ! <cfif len(arguments.value)> <!--- try the upload of the file ---> ! <cffile action="upload" fileField="#arguments.name#" destination="C:\" nameconflict="MAKEUNIQUE"> ! ! <cfscript> //validate the upload, if it returns false, delete the file and blank out the value ! if(NOT fileValidate(argumentCollection=cffile)){ ! deleteFile(arguments.value); } + return getDirectory() & file.serverFile; </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,arguments.name) AND NOT len(trim(form[arguments.name])) AND arguments.value is form[arguments.name]> ! <cfreturn ""> ! <!--- if we're not uploading the file, then the value is blank ---> <cfelse> ! <cfreturn ""> </cfif> </cffunction> *************** *** 59,65 **** <!--- a method for getting the web root relative path to this file (if possible) ---> <cffunction name="getWebRootRelativePath" access="public" output="no" returnType="string"> <cfset var webRootAbsolutePath = expandPath("/")> <cfset var webRootRelativePath = ""> ! <cfset var thisPath = getValue()> <cfset var webInfPath = webRootAbsolutePath & "WEB-INF"> <cfscript> --- 54,61 ---- <!--- a method for getting the web root relative path to this file (if possible) ---> <cffunction name="getWebRootRelativePath" access="public" output="no" returnType="string"> + <cfargument name="value" type="string" required="Yes"> <cfset var webRootAbsolutePath = expandPath("/")> <cfset var webRootRelativePath = ""> ! <cfset var thisPath = arguments.value> <cfset var webInfPath = webRootAbsolutePath & "WEB-INF"> <cfscript> *************** *** 79,86 **** <!--- a method to delete the file ---> <cffunction name="deleteFile" access="public" output="no" returnType="void"> ! <cfset var thisPath = getValue()> <!--- if there is a path, and it exists, delete the file ---> ! <cfif len(trim(thisPath)) AND fileExists(thisPath)> ! <cffile action="delete" file="#getValue()#"> </cfif> <cfscript> --- 75,82 ---- <!--- a method to delete the file ---> <cffunction name="deleteFile" access="public" output="no" returnType="void"> ! <cfargument name="value" type="string" required="Yes"> <!--- if there is a path, and it exists, delete the file ---> ! <cfif len(trim(arguments.value)) AND fileExists(arguments.value)> ! <cffile action="delete" file="#arguments.value#"> </cfif> <cfscript> *************** *** 89,93 **** </cfscript> </cffunction> ! <cffunction name="toHTML" access="public" output="no"> <cfreturn "BBBB" & toString(instance.value)> </cffunction> --- 85,89 ---- </cfscript> </cffunction> ! <cffunction name="renderField" access="public" output="no"> <cfreturn "BBBB" & toString(instance.value)> </cffunction> Index: hidden.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/fields/hidden.cfc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** hidden.cfc 24 Oct 2002 00:56:47 -0000 1.1 --- hidden.cfc 9 Jan 2003 01:53:39 -0000 1.2 *************** *** 2,6 **** <!--- override the toFormField method to make a hidden field ---> <cffunction name="toFormField" access="public" output="no" hint="returns a simple hidden form widget" returnType="string"> ! <cfreturn instance.formFieldFactory.makeHidden(getName(),getValue())> </cffunction> </cfcomponent> --- 2,8 ---- <!--- override the toFormField method to make a hidden field ---> <cffunction name="toFormField" access="public" output="no" hint="returns a simple hidden form widget" returnType="string"> ! <cfargument name="name" type="string" required="Yes"> ! <cfargument name="value" required="Yes"> ! <cfreturn instance.formFieldFactory.makeHidden(arguments.name,arguments.value)> </cffunction> </cfcomponent> Index: longtext.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/fields/longtext.cfc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** longtext.cfc 3 Sep 2002 22:29:05 -0000 1.3 --- longtext.cfc 9 Jan 2003 01:53:39 -0000 1.4 *************** *** 3,7 **** <!--- 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> </cfcomponent> --- 3,9 ---- <!--- override the toFormField method to make a TEXTAREA ---> <cffunction name="toFormField" access="public" output="no" returnType="string" hint="returns a textarea form widget"> ! <cfargument name="name" type="string" required="Yes"> ! <cfargument name="value" required="Yes"> ! <cfreturn instance.formFieldFactory.makeTextArea(arguments.name,arguments.value)> </cffunction> </cfcomponent> Index: text.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/fields/text.cfc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** text.cfc 3 Sep 2002 22:29:05 -0000 1.3 --- text.cfc 9 Jan 2003 01:53:39 -0000 1.4 *************** *** 2,6 **** <!--- 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> </cfcomponent> --- 2,8 ---- <!--- override the toFormField method to make a TEXTAREA ---> <cffunction name="toFormField" access="public" output="no" hint="returns a simple text form widget" returnType="string"> ! <cfargument name="name" type="string" required="Yes"> ! <cfargument name="value" required="Yes"> ! <cfreturn instance.formFieldFactory.makeText(arguments.name,arguments.value)> </cffunction> </cfcomponent> Index: webimage.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/fields/webimage.cfc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** webimage.cfc 3 Sep 2002 00:33:20 -0000 1.2 --- webimage.cfc 9 Jan 2003 01:53:39 -0000 1.3 *************** *** 1,6 **** <cfcomponent extends="org.bacfug.modus.fields.baseFile" displayname="webImage" hint="The field for a web image"> ! <!--- toHTML() should show an image tag if we can get a web root relative path ---> ! <cffunction name="toHTML" access="public" output="no" returnType="string" hint="Draws an IMG tag if a web root relative path can be determined"> ! <cfset var imgPath = getWebRootRelativePath()> <cfif len(trim(imgPath))> <cfreturn "<img src=""" & imgPath & """ border=""0"">"> --- 1,8 ---- <cfcomponent extends="org.bacfug.modus.fields.baseFile" displayname="webImage" hint="The field for a web image"> ! <!--- renderField() should show an image tag if we can get a web root relative path ---> ! <cffunction name="renderField" access="public" output="no" returnType="string" hint="Draws an IMG tag if a web root relative path can be determined"> ! <cfargument name="name" type="string"> ! <cfargument name="value" type="string" required="Yes"> ! <cfset var imgPath = getWebRootRelativePath(arguments.value)> <cfif len(trim(imgPath))> <cfreturn "<img src=""" & imgPath & """ border=""0"">"> Index: yesno.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/fields/yesno.cfc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** yesno.cfc 3 Sep 2002 22:29:05 -0000 1.5 --- yesno.cfc 9 Jan 2003 01:53:39 -0000 1.6 *************** *** 2,10 **** <!--- 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()) & " Yes" & ! instance.formFieldFactory.makeRadio(getName(),"no",getValue()) & " No"> --- 2,12 ---- <!--- 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"""> ! <cfargument name="name" type="string" required="Yes"> ! <cfargument name="value" required="Yes"> ! <cfreturn instance.formFieldFactory.makeRadio(arguments.name,1,arguments.value) & " Yes" & ! instance.formFieldFactory.makeRadio(arguments.name,0,arguments.value) & " No"> |
From: <jfi...@us...> - 2003-01-09 01:53:42
|
Update of /cvsroot/modus/org/bacfug/modus/caching In directory sc8-pr-cvs1:/tmp/cvs-serv5475/caching Modified Files: basecache.cfc serverscopecache.cfc Log Message: Whoops, these were the old files - pardon my CVS skills. The new files are now there. Index: basecache.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/caching/basecache.cfc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** basecache.cfc 29 Oct 2002 00:04:58 -0000 1.2 --- basecache.cfc 9 Jan 2003 01:53:39 -0000 1.3 *************** *** 8,31 **** <cfreturn this> </cffunction> ! <!--- is the cache primed ---> ! <cffunction name="isCacheInitialized" access="package" output="no" returnType="boolean" hint="Returns a boolean for whether the cache is initialized"> <cfthrow message="isCacheInitialized() not implemented in #getMetaData(this).name#"> </cffunction> - <!--- initialize the cache ---> <cffunction name="cacheInit" access="package" output="no" returnType="void" hint="Initializes the cache"> <cfthrow message="cacheInit() not implemented in #getMetaData(this).name#"> </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"> <cfthrow message="isObjectCached not implemented in #getMetaData(this).name#"> </cffunction> ! ! <!--- put an object in the cache ---> ! <cffunction name="putObject" access="package" output="no" returnType="void" hint="Put a contentObject instance into the cache"> <cfthrow message="putObject not implemented in #getMetaData(this).name#"> </cffunction> ! ! <!--- get an object from the cache ---> ! <cffunction name="getObject" access="package" output="no" returnType="org.bacfug.modus.baseContentObject" hint="get an object instance from the cache"> <cfthrow message="getObject not implemented in #getMetaData(this).name#"> </cffunction> --- 8,24 ---- <cfreturn this> </cffunction> ! <cffunction name="isCacheInitialized" access="public" output="no" returnType="boolean" hint="Returns a boolean for whether the cache is initialized"> <cfthrow message="isCacheInitialized() not implemented in #getMetaData(this).name#"> </cffunction> <cffunction name="cacheInit" access="package" output="no" returnType="void" hint="Initializes the cache"> <cfthrow message="cacheInit() not implemented in #getMetaData(this).name#"> </cffunction> ! <cffunction name="isObjectCached" access="public" output="no" returnType="boolean" hint="Returns a boolean for whether a particular object (Based on ID) is cached"> <cfthrow message="isObjectCached not implemented in #getMetaData(this).name#"> </cffunction> ! <cffunction name="putObject" access="public" output="no" returnType="void" hint="Put a contentObject instance into the cache"> <cfthrow message="putObject not implemented in #getMetaData(this).name#"> </cffunction> ! <cffunction name="getObject" access="public" output="no" returnType="org.bacfug.modus.baseContentObject" hint="get an object instance from the cache"> <cfthrow message="getObject not implemented in #getMetaData(this).name#"> </cffunction> Index: serverscopecache.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/caching/serverscopecache.cfc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** serverscopecache.cfc 18 Nov 2002 20:29:16 -0000 1.2 --- serverscopecache.cfc 9 Jan 2003 01:53:39 -0000 1.3 *************** *** 1,42 **** <cfcomponent hint="Uses the server scope for caching" extends="org.bacfug.modus.caching.baseCache"> - <!--- is the cache primed ---> - <cffunction name="isCacheInitialized" access="public" output="no" returnType="boolean" hint="Returns a boolean for whether the cache is initialized"> - <cfreturn structKeyExists(server,"modus") AND structKeyExists(server.modus,"contentObjectCache") AND structKeyExists(server.modus.contentObjectCache,"objectInstances")> - </cffunction> - <!--- initialize the cache ---> - <cffunction name="cacheInit" access="public" output="no" returnType="void" hint="Initializes the in-memory cache"> - <cfparam name="server.modus" default="#structNew()#"> - <cfparam name="server.modus.contentObjectCache" default="#structNew()#"> - <cfparam name="server.modus.contentObjectCache.objectInstances" default="#structNew()#"> - <cfparam name="server.modus.contentObjectCache.objectTypes" default="#structNew()#"> - - <!--- <cfscript> - server.modus.contentObjectCache = structNew(); - server.modus.contentObjectCache.objectInstances = structNew(); - server.modus.contentObjectCache.objectTypes = structNew(); - </cfscript> ---> - </cffunction> ! <!--- is a particular object instance in the cache? ---> ! <cffunction name="isObjectCached" access="public" 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"> ! <cfreturn structKeyExists(server.modus.contentObjectCache.objectInstances,arguments.id)> ! </cffunction> ! ! <!--- put an object in the cache ---> ! <cffunction name="putObject" access="public" output="no" returnType="void" hint="Put a contentObject instance into the cache"> ! <cfargument name="contentObject" required="yes" type="org.bacfug.modus.baseContentObject"> <cfscript> ! server.modus.contentObjectCache.objectInstances[arguments.contentObject.getID()] = arguments.contentObject.makeClone(); ! </cfscript> ! </cffunction> ! ! <!--- get an object from the cache ---> ! <cffunction name="getObject" access="public" 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.modus.contentObjectCache.objectInstances[arguments.id]> ! </cffunction> </cfcomponent> --- 1,103 ---- <cfcomponent hint="Uses the server scope for caching" extends="org.bacfug.modus.caching.baseCache"> ! <cffunction name="cacheInit" access="public" output="no" returnType="void" hint="Initializes the in-memory cache"> ! <cflock scope="SERVER" timeout="10" type="EXCLUSIVE"> ! <cfparam name="server._modus" default="#structNew()#"> <cfscript> ! server._modus.core.cache.objectInstances = structNew(); ! server._modus.core.cache.objectTypes = structNew(); ! server._modus.core.cache.collections = structNew(); ! </cfscript> ! </cflock> ! </cffunction> ! <cffunction name="isCacheInitialized" access="public" output="no" returnType="boolean" hint="Returns a boolean for whether the cache is initialized"> ! <cflock scope="SERVER" timeout="10" type="READONLY"> ! <cfreturn structKeyExists(server,"modus") AND structKeyExists(server._modus,"contentObjectCache") AND structKeyExists(server._modus.core.cache,"objectInstances")> ! </cflock> ! </cffunction> ! <cffunction name="isObjectCached" access="public" 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"> ! <cfargument name="type" required="Yes" type="string"> ! <cflock scope="SERVER" timeout="10" type="READONLY"> ! <cfreturn structKeyExists(server._modus.core.cache.objectInstances,arguments.type & arguments.id)> ! </cflock> ! </cffunction> ! <cffunction name="getObject" access="public" output="no" returnType="struct" hint="get an object instance from the cache"> ! <cfargument name="id" required="yes" type="string"> ! <cfargument name="type" required="Yes" type="string"> ! <cfif NOT isObjectCached(arguments.id, arguments.type)> ! <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> ! <cflock scope="SERVER" timeout="10" type="READONLY"> ! <cfreturn duplicate(server._modus.core.cache.objectInstances[arguments.type & arguments.id])> ! </cflock> ! </cffunction> ! <cffunction name="getObjectRef" access="public" output="no" returnType="struct" hint="get a reference to an object instance in the cache"> ! <cfargument name="id" required="yes" type="string"> ! <cfargument name="type" required="Yes" type="string"> ! <cfif NOT isObjectCached(arguments.id, arguments.type)> ! <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> ! <cflock scope="SERVER" timeout="10" type="READONLY"> ! <cfreturn server._modus.core.cache.objectInstances[arguments.type & arguments.id]> ! </cflock> ! </cffunction> ! <cffunction name="putObject" access="public" output="no" returnType="void" hint="Put a contentObject instance into the cache"> ! <cfargument name="contentObject" required="yes" type="struct"> ! <cfargument name="type" required="Yes" type="string"> ! <cflock scope="SERVER" timeout="10" type="EXCLUSIVE"> ! <cfscript> ! server._modus.core.cache.objectInstances[arguments.type & arguments.contentObject.id] = duplicate(arguments.contentObject); ! </cfscript> ! </cflock> ! </cffunction> ! <cffunction name="flushObject" access="public" output="no" returnType="void" hint="remove an object instance from the cache"> ! <cfargument name="id" required="yes" type="string"> ! <cfargument name="type" type="string" required="Yes"> ! <!--- Clear object from cache - no need to check if it exists with structClear function ---> ! <cfset structDelete(server._modus.core.cache.objectInstances,arguments.type & arguments.id)> ! </cffunction> ! <cffunction name="isCollectionCached" access="public" output="no" returnType="boolean" hint="Returns a boolean for whether a particular collection (Based on ID) is cached"> ! <cfargument name="id" required="yes" type="string"> ! <cfargument name="type" type="string" required="Yes"> ! <cflock scope="SERVER" timeout="10" type="READONLY"> ! <cfreturn structKeyExists(server._modus.core.cache.collections, arguments.type & arguments.id)> ! </cflock> ! </cffunction> ! <cffunction name="getCollection" access="public" returntype="array" output="no" hint="get a collection of collections instance from the cache"> ! <cfargument name="id" type="string" required="yes"> ! <cfargument name="type" type="string" required="Yes"> ! <cfif NOT isCollectionCached(arguments.id, arguments.type)> ! <cfthrow type="modus.badCacheRequest" message="Collection does not exist in the cache" detail="The collection with ID ""#arguments.id#"" does not exist in the cache. You may not request a collection that is not cached."> ! </cfif> ! <cflock scope="SERVER" timeout="10" type="READONLY"> ! <cfreturn duplicate(server._modus.core.cache.collections[arguments.type & arguments.id])> ! </cflock> ! </cffunction> ! <cffunction name="getCollectionRef" access="public" output="no" returnType="array" hint="get a reference to a collection instance in the cache"> ! <cfargument name="id" required="yes" type="string"> ! <cfargument name="type" type="string" required="Yes"> ! <cfif NOT isCollectionCached(arguments.id, arguments.type)> ! <cfthrow type="modus.badCacheRequest" message="Collection does not exist in the cache" detail="The contentCollection with ID ""#arguments.id#"" does not exist in the cache. You may not request an collection that is not cached."> ! </cfif> ! <cflock scope="SERVER" timeout="10" type="READONLY"> ! <cfreturn server._modus.core.cache.collections[arguments.type & arguments.id]> ! </cflock> ! </cffunction> ! <cffunction name="putCollection" access="public" output="no" returnType="void" hint="Put a collection of collections instance into the cache"> ! <cfargument name="id" type="string" required="Yes"> ! <cfargument name="collection" type="array" required="yes"> ! <cfargument name="type" type="string" required="Yes"> ! <cflock scope="SERVER" timeout="10" type="EXCLUSIVE"> ! <cfscript> ! server._modus.core.cache.collections[arguments.type & arguments.id] = duplicate(arguments.collection); ! </cfscript> ! </cflock> ! </cffunction> ! <cffunction name="flushCollection" access="public" output="no" returnType="void" hint="remove a collection from the cache"> ! <cfargument name="id" required="yes" type="string"> ! <cfargument name="type" type="string" required="Yes"> ! <!--- Clear object from cache - no need to check if it exists with structClear function ---> ! <cfset structDelete(server._modus.core.cache.collections,arguments.type & arguments.id)> ! </cffunction> </cfcomponent> |
From: <jfi...@us...> - 2003-01-09 01:51:45
|
Update of /cvsroot/modus/org/bacfug/sampleapps/pressrelease In directory sc8-pr-cvs1:/tmp/cvs-serv5190 Modified Files: specialrelease.cfc Log Message: Fixed xml descriptor variable name Index: specialrelease.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/sampleapps/pressrelease/specialrelease.cfc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** specialrelease.cfc 8 Jan 2003 16:14:37 -0000 1.1.1.1 --- specialrelease.cfc 9 Jan 2003 01:51:42 -0000 1.2 *************** *** 1,4 **** ! <cfcomponent extends="sampleapps.pressrelease.contenttypes.pressrelease"> ! <cfxml variable="sampleapps.pressrelease.contenttypes.specialrelease"> <contentType tablename="specialrelease" label="Press Release" labelPlural="Press Releases"> <fields> --- 1,4 ---- ! <cfcomponent extends="org.bacfug.sampleapps.pressrelease.pressrelease"> ! <cfxml variable="#getMetaData(this).name#"> <contentType tablename="specialrelease" label="Press Release" labelPlural="Press Releases"> <fields> |
From: <jfi...@us...> - 2003-01-09 01:50:42
|
Update of /cvsroot/modus/sampleapps/pressrelease In directory sc8-pr-cvs1:/tmp/cvs-serv5060 Modified Files: index.cfm modus_settings.cfm Log Message: content types had the wrong path - now set to org.bacfug.sampleapps Index: index.cfm =================================================================== RCS file: /cvsroot/modus/sampleapps/pressrelease/index.cfm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** index.cfm 8 Jan 2003 16:09:21 -0000 1.1.1.1 --- index.cfm 9 Jan 2003 01:50:39 -0000 1.2 *************** *** 5,12 **** if(form.isNew){ //Load a new pressrelease ! pr = server.modus.get("sampleapps.pressrelease.contenttypes.pressrelease"); }else{ //Load an existing pressrelease ! pr = server.modus.get("sampleapps.pressrelease.contenttypes.pressrelease",form.id); } // persist the changes - this calls the contentobject which will validate as required by the descriptor --- 5,12 ---- if(form.isNew){ //Load a new pressrelease ! pr = server.modus.get("org.bacfug.sampleapps.pressrelease.pressrelease"); }else{ //Load an existing pressrelease ! pr = server.modus.get("org.bacfug.sampleapps.pressrelease.pressrelease",form.id); } // persist the changes - this calls the contentobject which will validate as required by the descriptor *************** *** 15,30 **** if(NOT server.modus.hasErrors(pr)){ //reinitialize it ! pr = server.modus.get("sampleapps.pressrelease.contenttypes.pressrelease"); } } //all releases ! all = server.modus.getAll("sampleapps.pressrelease.contenttypes.pressrelease", "featured desc,title"); //if a URL id exists if(isDefined("url.id")){ ! pr = server.modus.get("sampleapps.pressrelease.contenttypes.pressrelease",url.id); //otherwise, server.modus.get a new pressrelease if one does not exist }else if(NOT isDefined('pr')){ ! pr = server.modus.get("sampleapps.pressrelease.contenttypes.pressrelease"); } //get all the errors --- 15,30 ---- if(NOT server.modus.hasErrors(pr)){ //reinitialize it ! pr = server.modus.get("org.bacfug.sampleapps.pressrelease.pressrelease"); } } //all releases ! all = server.modus.getAll("org.bacfug.sampleapps.pressrelease.pressrelease", "featured desc,title"); //if a URL id exists if(isDefined("url.id")){ ! pr = server.modus.get("org.bacfug.sampleapps.pressrelease.pressrelease",url.id); //otherwise, server.modus.get a new pressrelease if one does not exist }else if(NOT isDefined('pr')){ ! pr = server.modus.get("org.bacfug.sampleapps.pressrelease.pressrelease"); } //get all the errors Index: modus_settings.cfm =================================================================== RCS file: /cvsroot/modus/sampleapps/pressrelease/modus_settings.cfm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** modus_settings.cfm 8 Jan 2003 16:09:21 -0000 1.1.1.1 --- modus_settings.cfm 9 Jan 2003 01:50:39 -0000 1.2 *************** *** 9,14 **** <!--- Content type descriptors ---> <contentTypes> ! <contentType name="sampleapps.pressrelease.contenttypes.pressrelease"/> ! <contentType name="sampleapps.pressrelease.contenttypes.specialrelease"/> </contentTypes> </modus> --- 9,14 ---- <!--- Content type descriptors ---> <contentTypes> ! <contentType name="org.bacfug.sampleapps.pressrelease.pressrelease"/> ! <contentType name="org.bacfug.sampleapps.pressrelease.specialrelease"/> </contentTypes> </modus> |
From: <jfi...@us...> - 2003-01-08 16:53:18
|
Update of /cvsroot/modus/sampleapps/db In directory sc8-pr-cvs1:/tmp/cvs-serv4636 Added Files: modus_Data.MDF Log Message: The SQL Server db. --- NEW FILE: modus_Data.MDF --- (This appears to be a binary file; contents omitted.) |
From: <jfi...@us...> - 2003-01-08 16:51:33
|
Update of /cvsroot/modus/sampleapps/db In directory sc8-pr-cvs1:/tmp/cvs-serv3888/db Log Message: Directory /cvsroot/modus/sampleapps/db added to the repository |
From: <jfi...@us...> - 2003-01-08 16:37:43
|
Update of /cvsroot/modus/sampleapps In directory sc8-pr-cvs1:/tmp/cvs-serv31352 Removed Files: Modus.apf Log Message: Don't need my Homesite+ project definition file. --- Modus.apf DELETED --- |
Update of /cvsroot/modus/org/bacfug/modus/validation In directory sc8-pr-cvs1:/tmp/cvs-serv30859 Removed Files: baserule.cfc boolean.cfc date.cfc email.cfc full.cfc integer.cfc numeric.cfc required.cfc url.cfc uuid.cfc Log Message: Still cleaning out the old code base. Rules have moved into their own directory. --- baserule.cfc DELETED --- --- boolean.cfc DELETED --- --- date.cfc DELETED --- --- email.cfc DELETED --- --- full.cfc DELETED --- --- integer.cfc DELETED --- --- numeric.cfc DELETED --- --- required.cfc DELETED --- --- url.cfc DELETED --- --- uuid.cfc DELETED --- |
From: <jfi...@us...> - 2003-01-08 16:34:20
|
Update of /cvsroot/modus/org/bacfug/modus/persistence In directory sc8-pr-cvs1:/tmp/cvs-serv30120 Modified Files: simplefilesystempersister.cfc Removed Files: simpleobjectinstance.cfc Log Message: Still cleaning out the old code base and adding pieces that didn't make it. Index: simplefilesystempersister.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/persistence/simplefilesystempersister.cfc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** simplefilesystempersister.cfc 5 Oct 2002 01:05:12 -0000 1.3 --- simplefilesystempersister.cfc 8 Jan 2003 16:34:16 -0000 1.4 *************** *** 1,62 **** <cfcomponent extends="org.bacfug.modus.persistence.basePersister" displayname="fileSytemByType" hint="The basic component for storing object instances under the WEB-INF directory on the file system."> ! <!--- information about the base directory ---> ! <!--- this should really be in the config!! ---> ! <cfparam name="instance.baseModusDir" default="#expandPath("/WEB-INF/modus/")#"> ! <cfparam name="instance.objectStoreDir" default="#instance.baseModusDir#objectstore/"> ! ! <!--- make sure the base directory exists ---> ! <cfif NOT directoryExists(instance.objectStoreDir)> ! <cfdirectory action="create" directory="#instance.objectStoreDir#"> ! </cfif> ! ! <cffunction name="save" access="public" output="no" returnType="void" hint="The method to save data"> ! <cfargument name="contentObject" required="yes"> ! <cfset var objectToSave = ""> ! <cfset var packet = ""> ! <!--- make sure we're dealing with a contentObject ---> ! <cfif isContentObject(arguments.contentObject)> ! <cfscript> ! //make the storage struct ! packet = contentObjectToWddx(arguments.contentObject); ! </cfscript> ! <!--- write the file ---> ! <cffile action="write" file="#getPathFromObject(arguments.contentObject)#" output="#packet#"> ! <!--- put the object in the cache ---> ! <cfset instance.cache.putObject(arguments.contentObject)> ! <!--- if it's not a good contentObject ---> ! <cfelse> ! <cfthrow type="modus.badContentObject" message="Bad ContentObject" detail="A bad contentObject was passed to save() in #getMetaData(this).name#"> ! </cfif> ! </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 objectRetrieved = ""> ! <cfset var getQuery = ""> ! <cfset var packet = ""> ! <cfset var dirToCheck = getBaseStorageDirectory()> ! <!--- if this object is cached, return that one ---> <cfscript> ! if(instance.cache.isObjectCached(arguments.id)){ ! objectRetrieved = instance.cache.getObject(arguments.id); ! if(structCount(arguments) GT 1) ! return contentObjectPopulateFromInstance(arguments[2],objectRetrieved); ! else ! return objectRetrieved; } </cfscript> - <!--- try getting this instance ---> <cfdirectory action="list" directory="#dirToCheck#" name="getQuery" filter="#arguments.id#*"> - <cfscript> //if we found one, grab the object if(getQuery.recordCount){ objectRetrieved = getObjectFromFile(getQuery.name[1]); - //if there is a second argument, it means we need to load that instance - if(structCount(arguments) GT 1){ - contentObjectPopulateFromInstance(arguments[2],objectRetrieved); - } } //if none found, that's a bad error --- 1,35 ---- <cfcomponent extends="org.bacfug.modus.persistence.basePersister" displayname="fileSytemByType" hint="The basic component for storing object instances under the WEB-INF directory on the file system."> ! <!--- information about the base directory ---> ! <!--- this should really be in the config!! ---> ! <cfparam name="instance.baseModusDir" default="#expandPath("/WEB-INF/modus/")#"> ! <cfparam name="instance.objectStoreDir" default="#instance.baseModusDir#objectstore/"> ! <!--- make sure the base directory exists ---> ! <cfif NOT directoryExists(instance.objectStoreDir)> ! <cfdirectory action="create" directory="#instance.objectStoreDir#"> ! </cfif> ! <!--- ! ACCESSORS ! ! ---> ! <cffunction name="get" access="public" output="no" returnType="struct" hint="The method to get a particular data instance"> ! <cfargument name="id" type="string" required="yes"> ! <cfset var objectRetrieved = ""> ! <cfset var getQuery = ""> ! <cfset var packet = ""> ! <cfset var dirToCheck = getBaseStorageDirectory()> ! <cfif len(arguments.id)> <!--- if this object is cached, return that one ---> <cfscript> ! if(instance.cache.isObjectCached(arguments.id, getName())){ ! return instance.cache.getObject(arguments.id, getName()); } </cfscript> <!--- try getting this instance ---> <cfdirectory action="list" directory="#dirToCheck#" name="getQuery" filter="#arguments.id#*"> <cfscript> //if we found one, grab the object if(getQuery.recordCount){ objectRetrieved = getObjectFromFile(getQuery.name[1]); } //if none found, that's a bad error *************** *** 65,161 **** } </cfscript> ! <cfset instance.cache.putObject(objectRetrieved)> <cfreturn objectRetrieved> ! </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 = ""> ! <cfset var objectArray = arrayNew(1)> ! <cfset var packet = ""> ! <cfset var filter = "*"> ! <cfset var dirToCheck = getBaseStorageDirectory()> ! <cfset var objectID = ""> ! <cfset var objectInstance = ""> ! <cfscript> ! //if a type is passed, set the filter ! if(len(trim(arguments.type))){ ! filter = "*." & arguments.type; ! } ! </cfscript> ! <!--- get the appropriate files into a query ---> ! <cfdirectory action="list" directory="#dirToCheck#" name="getQuery" filter="#filter#"> ! <!--- loop through files, parsing them and putting the contents into the objectArray ---> ! <cfloop query="getQuery"> ! <cfset objectID = getObjectIDFromFileName(name)> ! <cfif instance.cache.isObjectCached(objectID)> ! <cfset objectInstance = instance.cache.getObject(objectID)> ! <cfelse> ! <cfset objectInstance = getObjectFromFile(name)> ! <cfset instance.cache.putObject(objectInstance)> ! </cfif> ! <cfset objectArray[currentRow] = objectInstance> ! </cfloop> ! <!--- return the array of objects ---> ! <cfreturn objectArray> ! </cffunction> ! ! <!--- a method to get an object from the name of its storage file ---> ! <cffunction name="getObjectFromFile" access="private" returnType="org.bacfug.modus.baseContentObject" output="no" hint="returns an object instance based on the name of the file"> ! <cfargument name="fileName" type="string" required="yes"> ! <cfset var packet = ""> ! <cftry> ! <cffile action="read" file="#getBaseStorageDirectory()##arguments.fileName#" variable="packet"> ! <cfcatch> ! <cfthrow type="modus.badFile" message="File does not exist" detail="The requested file ""#arguments.fileName#"" does not exist."> ! </cfcatch> ! </cftry> ! <!--- if there is a second argument, it means we're loading an existing object ---> ! <cfif structCount(arguments) GT 1> ! <cfreturn wddxToContentObject(packet,arguments[2])> ! <!--- otherwise, just return the object ---> <cfelse> ! <cfreturn wddxToContentObject(packet)> ! </cfif> ! </cffunction> ! ! <!--- a method to get the directory path based on an object ---> ! <cffunction name="getPathFromObject" access="private" returnType="string" output="no" hint="returns a full path based on an object"> ! <cfargument name="contentObject" type="org.bacfug.modus.baseContentObject" required="yes"> ! <cfset var directoryPath = getBaseStorageDirectory()> ! <cfset var fullPath = ""> ! <cfscript> ! //make sure the directory exists ! directoryInit(directoryPath); ! //set the full path ! fullPath = directoryPath & arguments.contentObject.getID() & "." & arguments.contentObject.getType(); ! </cfscript> ! <!--- now, be sure ---> ! <cfreturn fullPath> ! </cffunction> ! <!--- gets the ID from a file name ---> ! <cffunction name="getObjectIDFromFileName" access="private" returnType="string" output="no" hint="returns the ID of an object based on the file in the persistence"> ! <cfargument name="fileName" required="yes" type="string"> ! <cfreturn listFirst(fileName,".")> ! </cffunction> ! <!--- a method to get the base directory for storage ---> ! <cffunction name="getBaseStorageDirectory" access="private" returnType="string" output="no" hint="returns the path to the base storage directory"> ! <cfreturn instance.objectStoreDir> ! </cffunction> ! <!--- a method for make sure directories exist in the storage directory ---> ! <cffunction name="directoryInit" access="private" returnType="void" output="no" hint="a method for make sure directories exist in the storage directory"> ! <cfargument name="directory" required="yes" type="string"> ! <!--- if the directory does not exist, create it ---> ! <cfif NOT directoryExists(arguments.directory)> ! <cfdirectory action="create" directory="#arguments.directory#"> </cfif> ! </cffunction> ! <!--- a method to throw an error (DAMN YOU CFSCRIPT FOR NOT HAVING THIS FUNCTION ALREADY! ---> ! <cffunction name="throwError" access="private" returnType="void" output="no"> ! <cfargument name="type" required="yes"> ! <cfargument name="message" requied="yes"> ! <cfargument name="detail" required="no" default=""> ! <cfthrow type="#arguments.type#" message="#arguments.message#" detail="#arguments.detail#"> ! </cffunction> </cfcomponent> --- 38,141 ---- } </cfscript> ! <!--- put the object in the cache ---> ! <cfset instance.cache.putObject(objectRetrieved, getName())> ! <!--- return the object ---> <cfreturn objectRetrieved> ! <!--- Return a new object ---> ! <cfelse> ! <cfreturn getNewObject()> ! </cfif> ! </cffunction> ! <cffunction name="getAll" access="public" returntype="array" output="no" hint="The method to get all data instances of a particular type"> ! <cfset var getQuery = ""> ! <cfset var objectArray = arrayNew(1)> ! <cfset var packet = ""> ! <cfset var filter = "*." & getName()> ! <cfset var dirToCheck = getBaseStorageDirectory()> ! <cfset var objectID = ""> ! <cfset var objectInstance = ""> ! <!--- get the appropriate files into a query ---> ! <cfdirectory action="list" directory="#dirToCheck#" name="getQuery" filter="#filter#"> ! <!--- loop through files, parsing them and putting the contents into the objectArray ---> ! <cfloop query="getQuery"> ! <cfset objectID = getObjectIDFromFileName(name)> ! <cfif instance.cache.isObjectCached(objectID, getName())> ! <cfset objectInstance = instance.cache.getObject(objectID, getName())> <cfelse> ! <cfset objectInstance = getObjectFromFile(name)> ! <cfset instance.cache.putObject(objectInstance, getName())> </cfif> ! <cfset objectArray[currentRow] = objectInstance> ! </cfloop> ! <!--- return the array of objects ---> ! <cfreturn objectArray> ! </cffunction> ! <!--- ! ! MUTATORS ! ! ---> ! <cffunction name="save" access="public" output="no" returnType="void" hint="The method to save data"> ! <cfargument name="contentObject" required="yes"> ! <cfset var objectToSave = ""> ! <cfset var packet = contentObjectToWDDX(arguments.contentobject)> ! <!--- write the file ---> ! <cffile action="write" file="#getPathFromObject(arguments.contentObject)#" output="#packet#"> ! <!--- put the object in the cache ---> ! <cfset instance.cache.putObject(arguments.contentObject, getName())> ! </cffunction> ! <!--- ! ! PACKAGE AND PRIVATE METHODS FOR INTERNAL WORK ! ! ---> ! <cffunction name="getObjectFromFile" access="private" returnType="struct" output="no" hint="returns an object instance based on the name of the file"> ! <cfargument name="fileName" type="string" required="yes"> ! <cfset var packet = ""> ! <cftry> ! <cffile action="read" file="#getBaseStorageDirectory()##arguments.fileName#" variable="packet"> ! <cfcatch> ! <cfthrow type="modus.badFile" message="File does not exist" detail="The requested file ""#arguments.fileName#"" does not exist."> ! </cfcatch> ! </cftry> ! <cfreturn wddxToContentObject(packet)> ! </cffunction> ! <cffunction name="getPathFromObject" access="private" returnType="string" output="no" hint="returns a full path based on an object"> ! <cfargument name="contentObject" type="struct" required="yes"> ! <cfset var directoryPath = getBaseStorageDirectory()> ! <cfset var fullPath = ""> ! <cfscript> ! //make sure the directory exists ! directoryInit(directoryPath); ! //set the full path ! fullPath = directoryPath & arguments.contentObject.id & "." & getName(); ! </cfscript> ! <!--- now, be sure ---> ! <cfreturn fullPath> ! </cffunction> ! <!--- gets the ID from a file name ---> ! <cffunction name="getObjectIDFromFileName" access="private" returnType="string" output="no" hint="returns the ID of an object based on the file in the persistence"> ! <cfargument name="fileName" required="yes" type="string"> ! <cfreturn listFirst(fileName,".")> ! </cffunction> ! <!--- a method to get the base directory for storage ---> ! <cffunction name="getBaseStorageDirectory" access="private" returnType="string" output="no" hint="returns the path to the base storage directory"> ! <cfreturn instance.objectStoreDir> ! </cffunction> ! <!--- a method for make sure directories exist in the storage directory ---> ! <cffunction name="directoryInit" access="private" returnType="void" output="no" hint="a method for make sure directories exist in the storage directory"> ! <cfargument name="directory" required="yes" type="string"> ! <!--- if the directory does not exist, create it ---> ! <cfif NOT directoryExists(arguments.directory)> ! <cfdirectory action="create" directory="#arguments.directory#"> ! </cfif> ! </cffunction> ! <!--- a method to throw an error (DAMN YOU CFSCRIPT FOR NOT HAVING THIS FUNCTION ALREADY! ---> ! <cffunction name="throwError" access="private" returnType="void" output="no"> ! <cfargument name="type" required="yes"> ! <cfargument name="message" requied="yes"> ! <cfargument name="detail" required="no" default=""> ! <cfthrow type="#arguments.type#" message="#arguments.message#" detail="#arguments.detail#"> ! </cffunction> </cfcomponent> --- simpleobjectinstance.cfc DELETED --- |
From: <jfi...@us...> - 2003-01-08 16:26:13
|
Update of /cvsroot/modus/org/bacfug/modus/lib In directory sc8-pr-cvs1:/tmp/cvs-serv27693 Removed Files: baselibWapp.cfc Log Message: Whoops - this wasn't meant to be there. --- baselibWapp.cfc DELETED --- |
From: <jfi...@us...> - 2003-01-08 16:23:48
|
Update of /cvsroot/modus/org/bacfug/modus In directory sc8-pr-cvs1:/tmp/cvs-serv26744 Removed Files: basecontentobject.cfc modusinit.cfm Log Message: Removing remnants of the old code base. --- basecontentobject.cfc DELETED --- --- modusinit.cfm DELETED --- |
From: <jfi...@us...> - 2003-01-08 16:22:54
|
Update of /cvsroot/modus/org/bacfug/modus/form In directory sc8-pr-cvs1:/tmp/cvs-serv26259 Removed Files: formfieldfactory.cfc Log Message: Removing remnants of the old code base. --- formfieldfactory.cfc DELETED --- |
From: <ndi...@us...> - 2002-12-17 16:37:09
|
Update of /cvsroot/modus/org/bacfug/modus In directory sc8-pr-cvs1:/tmp/cvs-serv4118/bacfug/modus Added Files: modusinit.cfm Log Message: |
From: <ndi...@pr...> - 2002-11-18 21:11:32
|
Update of /cvsroot/modus/org/bacfug/modus In directory sc8-pr-cvs1:/tmp/cvs-serv7834/bacfug/modus Removed Files: modusinit.cfm Log Message: removing modusinit --- modusinit.cfm DELETED --- |
From: <ndi...@pr...> - 2002-11-18 20:29:39
|
Update of /cvsroot/modus/org/bacfug/modus In directory sc8-pr-cvs1:/tmp/cvs-serv20696/bacfug/modus Added Files: modusinit.cfm Log Message: (just cleaning up before we move to the new service-based model -- this is more for posterity than anything else). --- NEW FILE: modusinit.cfm --- <cfset request.initModusMemory = false> <cfscript> //if the in-memory storage is not made, make it if(NOT structKeyExists(server,"modus")) request.initModusMemory = true; </cfscript> <cfif request.initModusMemory> <cflock scope="server" type="exclusive" timeout="30"> <cfscript> //build the in-memory storage server.modus = structNew(); server.modus.contentObjectCache = structNew(); server.modus.contentObjectCache.objectInstances = structNew(); server.modus.contentObjectCache.objectTypes = structNew(); </cfscript> </cflock> </cfif> |
From: <ndi...@pr...> - 2002-11-18 20:29:19
|
Update of /cvsroot/modus/org/bacfug/modus/caching In directory sc8-pr-cvs1:/tmp/cvs-serv20530/bacfug/modus/caching Modified Files: serverscopecache.cfc Log Message: (just cleaning up before we move to the new service-based model -- this is more for posterity than anything else). moved the server. stuff into another file Index: serverscopecache.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/caching/serverscopecache.cfc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** serverscopecache.cfc 5 Oct 2002 00:51:43 -0000 1.1 --- serverscopecache.cfc 18 Nov 2002 20:29:16 -0000 1.2 *************** *** 7,15 **** <cffunction name="cacheInit" access="public" output="no" returnType="void" hint="Initializes the in-memory cache"> <cfparam name="server.modus" default="#structNew()#"> ! <cfscript> server.modus.contentObjectCache = structNew(); server.modus.contentObjectCache.objectInstances = structNew(); server.modus.contentObjectCache.objectTypes = structNew(); ! </cfscript> </cffunction> --- 7,19 ---- <cffunction name="cacheInit" access="public" output="no" returnType="void" hint="Initializes the in-memory cache"> <cfparam name="server.modus" default="#structNew()#"> ! <cfparam name="server.modus.contentObjectCache" default="#structNew()#"> ! <cfparam name="server.modus.contentObjectCache.objectInstances" default="#structNew()#"> ! <cfparam name="server.modus.contentObjectCache.objectTypes" default="#structNew()#"> ! ! <!--- <cfscript> server.modus.contentObjectCache = structNew(); server.modus.contentObjectCache.objectInstances = structNew(); server.modus.contentObjectCache.objectTypes = structNew(); ! </cfscript> ---> </cffunction> |
From: <ndi...@us...> - 2002-11-05 23:08:10
|
Update of /cvsroot/modus/org/bacfug/modus In directory usw-pr-cvs1:/tmp/cvs-serv14693/bacfug/modus Modified Files: basecontentobject.cfc Log Message: no need to instantiate a persister every time, just put it in the server scope. We need a cleaner way to do this, but for now it proves that it works to put the persister in memory and reuse it. Index: basecontentobject.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/basecontentobject.cfc,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** basecontentobject.cfc 5 Oct 2002 00:54:06 -0000 1.14 --- basecontentobject.cfc 5 Nov 2002 23:08:05 -0000 1.15 *************** *** 23,28 **** 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",instance.persisterComponent).init(); //initialize the properties of this instance initProperties(); --- 23,35 ---- 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")){ ! if(structKeyExists(server.modus,instance.persisterComponent)){ ! instance.persister = server.modus[instance.persisterComponent]; ! } ! else{ ! instance.persister = createObject("component",instance.persisterComponent).init(); ! server.modus[instance.persisterComponent] = instance.persister; ! } ! } //initialize the properties of this instance initProperties(); |
From: <ndi...@us...> - 2002-10-30 03:00:32
|
Update of /cvsroot/modus/org/bacfug/modus/persistence In directory usw-pr-cvs1:/tmp/cvs-serv5127/bacfug/modus/persistence Modified Files: basepersister.cfc Log Message: a nicer way to deal with the cache, though it will need to change in the final -- it shows that we can reuse a memory-based component for caching when it will have no instance data. Index: basepersister.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/persistence/basepersister.cfc,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** basepersister.cfc 29 Oct 2002 00:06:07 -0000 1.10 --- basepersister.cfc 30 Oct 2002 03:00:29 -0000 1.11 *************** *** 2,8 **** <cfparam name="instance" default="#structNew()#"> <cffunction name="init" access="public" hint="The initializer" returnType="org.bacfug.modus.persistence.basePersister" output="no"> <cfscript> //the cache we should use ! instance.cache = createObject("component",getCachePath()).init(); </cfscript> <cfreturn this> --- 2,22 ---- <cfparam name="instance" default="#structNew()#"> <cffunction name="init" access="public" hint="The initializer" returnType="org.bacfug.modus.persistence.basePersister" output="no"> + <cfset var cachePathToUse = getCachePath()> <cfscript> //the cache we should use ! //if it has been cached, use the cached version ! ! /******************************* ! THIS REALLY IS A GOOD CANDIDATE FOR THE CONFIG DATA! ! ********************************/ ! ! if(NOT structKeyExists(server.modus,cachePathToUse)){ ! instance.cache = createObject("component",getCachePath()).init(); ! server.modus[cachePathToUse] = instance.cache; ! } ! //otherwise, make a new one ! else{ ! instance.cache = server.modus[cachePathToUse]; ! } </cfscript> <cfreturn this> |
From: <ndi...@us...> - 2002-10-29 00:06:09
|
Update of /cvsroot/modus/org/bacfug/modus/persistence In directory usw-pr-cvs1:/tmp/cvs-serv20261/bacfug/modus/persistence Modified Files: basepersister.cfc Log Message: whoops, forgot to init() the cache -- this really needs to not happen for every instance of the persister, but for now it works. Index: basepersister.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/persistence/basepersister.cfc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** basepersister.cfc 5 Oct 2002 00:52:28 -0000 1.9 --- basepersister.cfc 29 Oct 2002 00:06:07 -0000 1.10 *************** *** 4,8 **** <cfscript> //the cache we should use ! instance.cache = createObject("component",getCachePath()); </cfscript> <cfreturn this> --- 4,8 ---- <cfscript> //the cache we should use ! instance.cache = createObject("component",getCachePath()).init(); </cfscript> <cfreturn this> |
From: <ndi...@us...> - 2002-10-29 00:05:01
|
Update of /cvsroot/modus/org/bacfug/modus/caching In directory usw-pr-cvs1:/tmp/cvs-serv19867/bacfug/modus/caching Modified Files: basecache.cfc Log Message: formatting only Index: basecache.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/caching/basecache.cfc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** basecache.cfc 5 Oct 2002 00:51:20 -0000 1.1 --- basecache.cfc 29 Oct 2002 00:04:58 -0000 1.2 *************** *** 16,20 **** <cfthrow message="cacheInit() not implemented in #getMetaData(this).name#"> </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"> --- 16,19 ---- |
From: <ndi...@us...> - 2002-10-24 00:56:50
|
Update of /cvsroot/modus/org/bacfug/modus/fields In directory usw-pr-cvs1:/tmp/cvs-serv20519/bacfug/modus/fields Added Files: hidden.cfc Log Message: a field for hidden fields (thanks to Jeremy Firsenbaum for this). This probably needs to also deal with the label, etc. at some point. --- NEW FILE: hidden.cfc --- <cfcomponent extends="org.bacfug.modus.fields.baseField" displayname="hiddenField" hint="The hidden field"> <!--- override the toFormField method to make a hidden field ---> <cffunction name="toFormField" access="public" output="no" hint="returns a simple hidden form widget" returnType="string"> <cfreturn instance.formFieldFactory.makeHidden(getName(),getValue())> </cffunction> </cfcomponent> |
From: <ndi...@us...> - 2002-10-24 00:55:15
|
Update of /cvsroot/modus/org/bacfug/modus/form In directory usw-pr-cvs1:/tmp/cvs-serv18770/bacfug/modus/form Modified Files: formfieldfactory.cfc Log Message: added makeHidden (thanks to Jeremy Firsenbaum for this) Index: formfieldfactory.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/form/formfieldfactory.cfc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** formfieldfactory.cfc 3 Oct 2002 05:45:19 -0000 1.5 --- formfieldfactory.cfc 24 Oct 2002 00:55:12 -0000 1.6 *************** *** 99,102 **** <cfreturn "<input type=""file"" name=""" & arguments.name & """>"> </cffunction> ! </cfcomponent> --- 99,107 ---- <cfreturn "<input type=""file"" name=""" & arguments.name & """>"> </cffunction> ! <!--- Make hidden ---> ! <cffunction name="makeHidden" access="public" output="no" returntype="string" hint="makes a hidden field"> ! <cfargument name="name" required="yes" type="variableName"> ! <cfargument name="value" required="yes" type="string"> ! <cfreturn "<input type=""hidden"" name=""" & arguments.name & """ value=""" & htmlEditFormat(arguments.value)& """>"> ! </cffunction> </cfcomponent> |
From: <ndi...@us...> - 2002-10-05 01:05:14
|
Update of /cvsroot/modus/org/bacfug/modus/persistence In directory usw-pr-cvs1:/tmp/cvs-serv2786/bacfug/modus/persistence Modified Files: simplefilesystempersister.cfc Log Message: put the caching in the getAll() method. It is now MUCH faster!! Index: simplefilesystempersister.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/persistence/simplefilesystempersister.cfc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** simplefilesystempersister.cfc 5 Oct 2002 00:53:01 -0000 1.2 --- simplefilesystempersister.cfc 5 Oct 2002 01:05:12 -0000 1.3 *************** *** 76,79 **** --- 76,81 ---- <cfset var filter = "*"> <cfset var dirToCheck = getBaseStorageDirectory()> + <cfset var objectID = ""> + <cfset var objectInstance = ""> <cfscript> //if a type is passed, set the filter *************** *** 86,90 **** <!--- loop through files, parsing them and putting the contents into the objectArray ---> <cfloop query="getQuery"> ! <cfset objectArray[currentRow] = getObjectFromFile(name)> </cfloop> <!--- return the array of objects ---> --- 88,99 ---- <!--- loop through files, parsing them and putting the contents into the objectArray ---> <cfloop query="getQuery"> ! <cfset objectID = getObjectIDFromFileName(name)> ! <cfif instance.cache.isObjectCached(objectID)> ! <cfset objectInstance = instance.cache.getObject(objectID)> ! <cfelse> ! <cfset objectInstance = getObjectFromFile(name)> ! <cfset instance.cache.putObject(objectInstance)> ! </cfif> ! <cfset objectArray[currentRow] = objectInstance> </cfloop> <!--- return the array of objects ---> *************** *** 124,127 **** --- 133,141 ---- <!--- now, be sure ---> <cfreturn fullPath> + </cffunction> + <!--- gets the ID from a file name ---> + <cffunction name="getObjectIDFromFileName" access="private" returnType="string" output="no" hint="returns the ID of an object based on the file in the persistence"> + <cfargument name="fileName" required="yes" type="string"> + <cfreturn listFirst(fileName,".")> </cffunction> <!--- a method to get the base directory for storage ---> |
From: <ndi...@us...> - 2002-10-05 00:54:08
|
Update of /cvsroot/modus/org/bacfug/modus In directory usw-pr-cvs1:/tmp/cvs-serv32222/bacfug/modus Modified Files: basecontentobject.cfc Log Message: removing the config struct, as it is inconsistent with all other components. We'll stick with "instance" since there does not appear to be any good reason to have a separate config struct. Index: basecontentobject.cfc =================================================================== RCS file: /cvsroot/modus/org/bacfug/modus/basecontentobject.cfc,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** basecontentobject.cfc 14 Sep 2002 01:22:30 -0000 1.13 --- basecontentobject.cfc 5 Oct 2002 00:54:06 -0000 1.14 *************** *** 2,6 **** <!--- 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()#"> <!--- set up some of the basics for a content object ---> --- 2,6 ---- <!--- 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()#"> <!--- set up some of the basics for a content object ---> *************** *** 15,19 **** instance.id = makeID(); //which persister will we use? Set a default. ! config.persister = "org.bacfug.modus.persistence.simpleFileSystemPersister"; //by default the instance.dateCreated is now() instance.dateCreated = now(); --- 15,19 ---- instance.id = makeID(); //which persister will we use? Set a default. ! instance.persisterComponent = "org.bacfug.modus.persistence.simpleFileSystemPersister"; //by default the instance.dateCreated is now() instance.dateCreated = now(); *************** *** 24,32 **** //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(); </cfscript> ! <!--- be sure we have an instance.label and instance.labelPlural it a instance.label and a config.plurallabel ---> <cfparam name="instance.label" default="Content Object"> <cfparam name="instance.labelPlural" default="#instance.label#s"> --- 24,32 ---- //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",instance.persisterComponent).init(); //initialize the properties of this instance initProperties(); </cfscript> ! <!--- be sure we have an instance.label and instance.labelPlural ---> <cfparam name="instance.label" default="Content Object"> <cfparam name="instance.labelPlural" default="#instance.label#s"> *************** *** 410,417 **** break; } ! //if it's a "config" variable, just pop the value into the config case "config":{ config[arguments.property.name] = arguments.property.value; } } </cfscript> --- 410,418 ---- break; } ! /* //if it's a "config" variable, just pop the value into the config case "config":{ config[arguments.property.name] = arguments.property.value; } + */ } </cfscript> |