From 6831a1055e7ae2e0c7eb57759eb5333fa8d60061 Mon Sep 17 00:00:00 2001 From: marcel Date: Sun, 29 Sep 2013 21:48:53 +1000 Subject: [PATCH] Compatibility with open bluedragon 3.0 Added a patch for compatibility with open bluedragon 3.0 The recurse and filter options for cfdirectory work differently in openbd. Added a compatibility component which uses a custom method to emulate the same behaviour for cfdirectoy in openbluedragon. Changed the keys for META_ABSTRACT and META_GENERIC as openbluedragon throws an error when a structure key name contains a colon. The patch has been tested with openbd 3.0 and Railo 4 --- ColdDoc.cfc | 4 +- compatibility.cfc | 70 +++++++++++++++++++++++++++ strategy/AbstractTemplateStrategy.cfc | 32 ++++++------ 3 files changed, 89 insertions(+), 17 deletions(-) create mode 100644 compatibility.cfc diff --git a/ColdDoc.cfc b/ColdDoc.cfc index 40d20d8..14b0488 100644 --- a/ColdDoc.cfc +++ b/ColdDoc.cfc @@ -71,11 +71,11 @@ var i = 0; var implements = 0; var fullextends = 0; + var cfoCompatibility = createObject("component","colddoc.compatibility"); - - + diff --git a/compatibility.cfc b/compatibility.cfc new file mode 100644 index 0000000..33096a3 --- /dev/null +++ b/compatibility.cfc @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + if(arguments.filter EQ "" OR (qDir.type EQ "File" AND reFindNoCase(arguments.filter,qDir.name))) + { + queryaddrow(qResult,1); + querysetcell(qResult,"name",qDir.name); + querysetcell(qResult,"size",qDir.size); + querysetcell(qResult,"type",qDir.type); + querysetcell(qResult,"directory",qDir.directory); + querysetcell(qResult,"dateLastModified",qDir.dateLastModified); + querysetcell(qResult,"attributes",qDir.attributes); + querysetcell(qResult,"mode",qDir.mode); + } + + + + + + + if(arguments.filter EQ "" OR (qChild.type EQ "File" AND reFindNoCase(arguments.filter,qChild.name))) + { + queryaddrow(qResult,1); + querysetcell(qResult,"name",qChild.name); + querysetcell(qResult,"size",qChild.size); + querysetcell(qResult,"type",qChild.type); + querysetcell(qResult,"directory",qChild.directory); + querysetcell(qResult,"dateLastModified",qChild.dateLastModified); + querysetcell(qResult,"attributes",qChild.attributes); + querysetcell(qResult,"mode",qChild.mode); + } + + + + + + + + \ No newline at end of file diff --git a/strategy/AbstractTemplateStrategy.cfc b/strategy/AbstractTemplateStrategy.cfc index bb8c5c6..f4409ff 100644 --- a/strategy/AbstractTemplateStrategy.cfc +++ b/strategy/AbstractTemplateStrategy.cfc @@ -4,8 +4,8 @@ - instance.static.META_ABSTRACT = "colddoc:abstract"; - instance.static.META_GENERIC = "colddoc:generic"; + instance.static.META_ABSTRACT = "colddoc_abstract"; + instance.static.META_GENERIC = "colddoc_generic"; @@ -53,7 +53,7 @@ } node = node[item]; - + @@ -68,7 +68,8 @@ var startCall = arguments.startCommand; var endCall = arguments.endCommand; - var key = 0; + var keys = 0; + var node = 0; var thisArgs = 0; if(NOT StructKeyExists(args, "fullname")) @@ -105,7 +106,7 @@ var qFunctions = QueryNew("name,metadata"); var func = 0; - var results = 0; + var result = 0; var cache = getFunctionQueryCache(); if(StructKeyExists(cache, arguments.metadata.name)) @@ -154,7 +155,7 @@ { var objectname = getObjectName(arguments.class); var lenCount = Len(arguments.class) - (Len(objectname) + 1); - + if( lenCount gt 0 ) { return Left(arguments.class, lenCount); @@ -177,7 +178,7 @@ var qClass = getMetaSubQuery(arguments.qMetaData, "LOWER(package)=LOWER('#packageName#') AND LOWER(name)=LOWER('#objectName#')"); return qClass.recordCount; - + @@ -186,7 +187,7 @@ return isPrimitive(arguments.className) OR classExists(argumentCollection=arguments); - + @@ -199,7 +200,7 @@ } return arguments.className; - + @@ -336,18 +337,17 @@ - var qFiles = 0; + var files = 0; var currentDir = ""; var safeDir = ""; arguments.fromDir = replaceNoCase(arguments.fromDir, "\", "/", "all"); arguments.toDir = replaceNoCase(arguments.toDir, "\", "/", "all"); - - - + + @@ -379,13 +379,13 @@ + var meta = 0; arguments.class = resolveClassName(arguments.class, arguments.package); - meta = getComponentMetadata(arguments.class); - if(structKeyExists(meta, instance.static.META_ABSTRACT)) + if(structKeyExists(meta,instance.static.META_ABSTRACT)) { return meta[instance.static.META_ABSTRACT]; } @@ -450,4 +450,6 @@ + +