├── .gitignore ├── ColdDoc.cfc ├── README.md ├── licence.txt ├── run.cfm └── strategy ├── AbstractTemplateStrategy.cfc ├── api ├── HTMLAPIStrategy.cfc └── resources │ ├── static │ ├── index.html │ ├── resources │ │ └── inherit.gif │ └── stylesheet.css │ └── templates │ ├── allclasses-frame.html │ ├── class.html │ ├── inc │ └── nav.html │ ├── index.html │ ├── overview-frame.html │ ├── overview-summary.html │ ├── package-frame.html │ └── package-summary.html └── uml2tools ├── XMIStrategy.cfc └── resources └── templates └── template.uml /.gitignore: -------------------------------------------------------------------------------- 1 | #ignore these files 2 | .* 3 | !.gitignore 4 | settings.xml 5 | *.iml 6 | docs/* 7 | -------------------------------------------------------------------------------- /ColdDoc.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | variables.instance = {}; 8 | 9 | return this; 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | var qMetaData = 0; 18 | var source = 0; 19 | 20 | if(NOT hasStrategy()) 21 | { 22 | throwException("colddoc.StrategyNotSetException", "No Template Strategy has been set.", 23 | "Create a Template Strategy, and set it with setStrategy() before calling generate()"); 24 | } 25 | 26 | if(isSimpleValue(arguments.inputSource)) 27 | { 28 | source = [{ inputDir=arguments.inputSource, inputMapping=arguments.inputMapping }]; 29 | } 30 | else 31 | { 32 | source = arguments.inputSource; 33 | } 34 | 35 | qMetaData = buildMetaDataCollection(source); 36 | 37 | getStrategy().run(qMetaData); 38 | 39 | 40 | 41 | 43 | 44 | 45 | 46 | 47 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | var qFiles = 0; 65 | var currentPath = 0; 66 | var qMetaData = QueryNew("package,name,extends,metadata,type,implements,fullextends"); 67 | var cfcPath = 0; 68 | var packagePath = 0; 69 | var cfcName = 0; 70 | var meta = 0; 71 | var i = 0; 72 | var implements = 0; 73 | var fullextends = 0; 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | currentPath = replace(directory, arguments.inputSource[i].inputDir, ""); 83 | currentPath = reReplace(currentPath, "[/\\]", ""); 84 | currentPath = reReplace(currentPath, "[/\\]", ".", "all"); 85 | 86 | if(len(currentPath)) 87 | { 88 | packagePath = ListAppend(arguments.inputSource[i].inputMapping, currentPath, "."); 89 | } 90 | else 91 | { 92 | packagePath = arguments.inputSource[i].inputMapping; 93 | } 94 | 95 | cfcName = ListGetAt(name, 1, "."); 96 | 97 | try 98 | { 99 | if (Len(packagePath)) { 100 | meta = getComponentMetaData(packagePath & "." & cfcName); 101 | } 102 | else { 103 | meta = getComponentMetaData(cfcName); 104 | } 105 | 106 | //let's do some cleanup, in case CF sucks. 107 | if(Len (packagePath) AND NOT meta.name contains packagePath) 108 | { 109 | meta.name = packagePath & "." & cfcName; 110 | } 111 | 112 | QueryAddRow(qMetaData); 113 | QuerySetCell(qMetaData, "package", packagePath); 114 | QuerySetCell(qMetaData, "name", cfcName); 115 | QuerySetCell(qMetaData, "metadata", meta); 116 | QuerySetCell(qMetaData, "type", meta.type); 117 | 118 | implements = getImplements(meta); 119 | implements = listQualify(arrayToList(implements), ':'); 120 | 121 | QuerySetCell(qMetaData, "implements", implements); 122 | 123 | fullextends = getInheritence(meta); 124 | fullextends = listQualify(arrayToList(fullextends), ':'); 125 | 126 | QuerySetCell(qMetaData, "fullextends", fullextends); 127 | 128 | //so we cane easily query direct desendents 129 | if(StructKeyExists(meta, "extends")) 130 | { 131 | if(meta.type eq "interface") 132 | { 133 | QuerySetCell(qMetaData, "extends", meta.extends[structKeyList(meta.extends)].name); 134 | } 135 | else 136 | { 137 | QuerySetCell(qMetaData, "extends", meta.extends.name); 138 | } 139 | } 140 | else 141 | { 142 | QuerySetCell(qMetaData, "extends", "-"); 143 | } 144 | 145 | } 146 | catch(Any exc) 147 | { 148 | warnError(packagePath & "." & cfcName, exc); 149 | } 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | var localmeta = arguments.metadata; 173 | var interfaces = {}; 174 | var key = 0; 175 | var imeta = 0; 176 | 177 | if(arguments.metadata.type neq "component") 178 | { 179 | return ArrayNew(1); 180 | } 181 | 182 | while(StructKeyExists(localmeta, "extends")) 183 | { 184 | if(StructKeyExists(localmeta, "implements")) 185 | { 186 | for(key in localmeta.implements) 187 | { 188 | imeta = localmeta.implements[local.key]; 189 | interfaces[imeta.name] = 1; 190 | } 191 | } 192 | localmeta = localmeta.extends; 193 | } 194 | 195 | interfaces = structKeyArray(interfaces); 196 | 197 | arraySort(interfaces, "textnocase"); 198 | 199 | return interfaces; 200 | 201 | 202 | 203 | 204 | 205 | 206 | var localmeta = arguments.metadata; 207 | //ignore top level 208 | var inheritence = []; 209 | 210 | while(StructKeyExists(localmeta, "extends")) 211 | { 212 | //manage interfaces 213 | if(localmeta.type eq "interface") 214 | { 215 | localmeta = localmeta.extends[structKeyList(localmeta.extends)]; 216 | } 217 | else 218 | { 219 | localmeta = localmeta.extends; 220 | } 221 | 222 | ArrayPrepend(inheritence, localmeta.name); 223 | } 224 | 225 | return inheritence; 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ColdDoc 1.0 2 | ========== 3 | 4 | Thanks for taking the time to look at ColdDoc! 5 | 6 | The ColdDoc home page can be found at [http://www.compoundtheory.com/?action=colddoc.index][1] 7 | 8 | Documentation for ColdDoc can be found on the [GitHub Wiki][2]. 9 | 10 | The main Git repository and downloads can be found on [GitHub][3]. 11 | 12 | For support, the ColdDoc mailing list can be found on [Google Groups][4]. 13 | 14 | [1]: http://www.compoundtheory.com/?action=colddoc.index 15 | [2]: https://github.com/markmandel/ColdDoc/wiki 16 | [3]: https://github.com/markmandel/ColdDoc 17 | [4]: https://groups.google.com/forum/#!forum/colddoc-dev 18 | 19 | -------------------------------------------------------------------------------- /licence.txt: -------------------------------------------------------------------------------- 1 | Common Public License Version 1.0 2 | 3 | THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC 4 | LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM 5 | CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. 6 | 7 | 1. DEFINITIONS 8 | 9 | "Contribution" means: 10 | 11 | a) in the case of the initial Contributor, the initial code and 12 | documentation distributed under this Agreement, and 13 | 14 | b) in the case of each subsequent Contributor: 15 | 16 | i) changes to the Program, and 17 | 18 | ii) additions to the Program; 19 | 20 | where such changes and/or additions to the Program originate from and are 21 | distributed by that particular Contributor. A Contribution 'originates' from a 22 | Contributor if it was added to the Program by such Contributor itself or anyone 23 | acting on such Contributor's behalf. Contributions do not include additions to 24 | the Program which: (i) are separate modules of software distributed in 25 | conjunction with the Program under their own license agreement, and (ii) are not 26 | derivative works of the Program. 27 | 28 | "Contributor" means any person or entity that distributes the Program. 29 | 30 | "Licensed Patents " mean patent claims licensable by a Contributor which are 31 | necessarily infringed by the use or sale of its Contribution alone or when 32 | combined with the Program. 33 | 34 | "Program" means the Contributions distributed in accordance with this Agreement. 35 | 36 | "Recipient" means anyone who receives the Program under this Agreement, 37 | including all Contributors. 38 | 39 | 2. GRANT OF RIGHTS 40 | 41 | a) Subject to the terms of this Agreement, each Contributor hereby grants 42 | Recipient a non-exclusive, worldwide, royalty-free copyright license to 43 | reproduce, prepare derivative works of, publicly display, publicly perform, 44 | distribute and sublicense the Contribution of such Contributor, if any, and such 45 | derivative works, in source code and object code form. 46 | 47 | b) Subject to the terms of this Agreement, each Contributor hereby grants 48 | Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed 49 | Patents to make, use, sell, offer to sell, import and otherwise transfer the 50 | Contribution of such Contributor, if any, in source code and object code form. 51 | This patent license shall apply to the combination of the Contribution and the 52 | Program if, at the time the Contribution is added by the Contributor, such 53 | addition of the Contribution causes such combination to be covered by the 54 | Licensed Patents. The patent license shall not apply to any other combinations 55 | which include the Contribution. No hardware per se is licensed hereunder. 56 | 57 | c) Recipient understands that although each Contributor grants the licenses 58 | to its Contributions set forth herein, no assurances are provided by any 59 | Contributor that the Program does not infringe the patent or other intellectual 60 | property rights of any other entity. Each Contributor disclaims any liability to 61 | Recipient for claims brought by any other entity based on infringement of 62 | intellectual property rights or otherwise. As a condition to exercising the 63 | rights and licenses granted hereunder, each Recipient hereby assumes sole 64 | responsibility to secure any other intellectual property rights needed, if any. 65 | For example, if a third party patent license is required to allow Recipient to 66 | distribute the Program, it is Recipient's responsibility to acquire that license 67 | before distributing the Program. 68 | 69 | d) Each Contributor represents that to its knowledge it has sufficient 70 | copyright rights in its Contribution, if any, to grant the copyright license set 71 | forth in this Agreement. 72 | 73 | 3. REQUIREMENTS 74 | 75 | A Contributor may choose to distribute the Program in object code form under its 76 | own license agreement, provided that: 77 | 78 | a) it complies with the terms and conditions of this Agreement; and 79 | 80 | b) its license agreement: 81 | 82 | i) effectively disclaims on behalf of all Contributors all warranties and 83 | conditions, express and implied, including warranties or conditions of title and 84 | non-infringement, and implied warranties or conditions of merchantability and 85 | fitness for a particular purpose; 86 | 87 | ii) effectively excludes on behalf of all Contributors all liability for 88 | damages, including direct, indirect, special, incidental and consequential 89 | damages, such as lost profits; 90 | 91 | iii) states that any provisions which differ from this Agreement are offered 92 | by that Contributor alone and not by any other party; and 93 | 94 | iv) states that source code for the Program is available from such 95 | Contributor, and informs licensees how to obtain it in a reasonable manner on or 96 | through a medium customarily used for software exchange. 97 | 98 | When the Program is made available in source code form: 99 | 100 | a) it must be made available under this Agreement; and 101 | 102 | b) a copy of this Agreement must be included with each copy of the Program. 103 | 104 | Contributors may not remove or alter any copyright notices contained within the 105 | Program. 106 | 107 | Each Contributor must identify itself as the originator of its Contribution, if 108 | any, in a manner that reasonably allows subsequent Recipients to identify the 109 | originator of the Contribution. 110 | 111 | 4. COMMERCIAL DISTRIBUTION 112 | 113 | Commercial distributors of software may accept certain responsibilities with 114 | respect to end users, business partners and the like. While this license is 115 | intended to facilitate the commercial use of the Program, the Contributor who 116 | includes the Program in a commercial product offering should do so in a manner 117 | which does not create potential liability for other Contributors. Therefore, if 118 | a Contributor includes the Program in a commercial product offering, such 119 | Contributor ("Commercial Contributor") hereby agrees to defend and indemnify 120 | every other Contributor ("Indemnified Contributor") against any losses, damages 121 | and costs (collectively "Losses") arising from claims, lawsuits and other legal 122 | actions brought by a third party against the Indemnified Contributor to the 123 | extent caused by the acts or omissions of such Commercial Contributor in 124 | connection with its distribution of the Program in a commercial product 125 | offering. The obligations in this section do not apply to any claims or Losses 126 | relating to any actual or alleged intellectual property infringement. In order 127 | to qualify, an Indemnified Contributor must: a) promptly notify the Commercial 128 | Contributor in writing of such claim, and b) allow the Commercial Contributor to 129 | control, and cooperate with the Commercial Contributor in, the defense and any 130 | related settlement negotiations. The Indemnified Contributor may participate in 131 | any such claim at its own expense. 132 | 133 | For example, a Contributor might include the Program in a commercial product 134 | offering, Product X. That Contributor is then a Commercial Contributor. If that 135 | Commercial Contributor then makes performance claims, or offers warranties 136 | related to Product X, those performance claims and warranties are such 137 | Commercial Contributor's responsibility alone. Under this section, the 138 | Commercial Contributor would have to defend claims against the other 139 | Contributors related to those performance claims and warranties, and if a court 140 | requires any other Contributor to pay any damages as a result, the Commercial 141 | Contributor must pay those damages. 142 | 143 | 5. NO WARRANTY 144 | 145 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN 146 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR 147 | IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, 148 | NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each 149 | Recipient is solely responsible for determining the appropriateness of using and 150 | distributing the Program and assumes all risks associated with its exercise of 151 | rights under this Agreement, including but not limited to the risks and costs of 152 | program errors, compliance with applicable laws, damage to or loss of data, 153 | programs or equipment, and unavailability or interruption of operations. 154 | 155 | 6. DISCLAIMER OF LIABILITY 156 | 157 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY 158 | CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, 159 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST 160 | PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 161 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 162 | OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS 163 | GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 164 | 165 | 7. GENERAL 166 | 167 | If any provision of this Agreement is invalid or unenforceable under applicable 168 | law, it shall not affect the validity or enforceability of the remainder of the 169 | terms of this Agreement, and without further action by the parties hereto, such 170 | provision shall be reformed to the minimum extent necessary to make such 171 | provision valid and enforceable. 172 | 173 | If Recipient institutes patent litigation against a Contributor with respect to 174 | a patent applicable to software (including a cross-claim or counterclaim in a 175 | lawsuit), then any patent licenses granted by that Contributor to such Recipient 176 | under this Agreement shall terminate as of the date such litigation is filed. In 177 | addition, if Recipient institutes patent litigation against any entity 178 | (including a cross-claim or counterclaim in a lawsuit) alleging that the Program 179 | itself (excluding combinations of the Program with other software or hardware) 180 | infringes such Recipient's patent(s), then such Recipient's rights granted under 181 | Section 2(b) shall terminate as of the date such litigation is filed. 182 | 183 | All Recipient's rights under this Agreement shall terminate if it fails to 184 | comply with any of the material terms or conditions of this Agreement and does 185 | not cure such failure in a reasonable period of time after becoming aware of 186 | such noncompliance. If all Recipient's rights under this Agreement terminate, 187 | Recipient agrees to cease use and distribution of the Program as soon as 188 | reasonably practicable. However, Recipient's obligations under this Agreement 189 | and any licenses granted by Recipient relating to the Program shall continue and 190 | survive. 191 | 192 | Everyone is permitted to copy and distribute copies of this Agreement, but in 193 | order to avoid inconsistency the Agreement is copyrighted and may only be 194 | modified in the following manner. The Agreement Steward reserves the right to 195 | publish new versions (including revisions) of this Agreement from time to time. 196 | No one other than the Agreement Steward has the right to modify this Agreement. 197 | IBM is the initial Agreement Steward. IBM may assign the responsibility to serve 198 | as the Agreement Steward to a suitable separate entity. Each new version of the 199 | Agreement will be given a distinguishing version number. The Program (including 200 | Contributions) may always be distributed subject to the version of the Agreement 201 | under which it was received. In addition, after a new version of the Agreement 202 | is published, Contributor may elect to distribute the Program (including its 203 | Contributions) under the new version. Except as expressly stated in Sections 204 | 2(a) and 2(b) above, Recipient receives no rights or licenses to the 205 | intellectual property of any Contributor under this Agreement, whether 206 | expressly, by implication, estoppel or otherwise. All rights in the Program not 207 | expressly granted under this Agreement are reserved. 208 | 209 | This Agreement is governed by the laws of the State of New York and the 210 | intellectual property laws of the United States of America. No party to this 211 | Agreement will bring a legal action under this Agreement more than one year 212 | after the cause of action arose. Each party waives its rights to a jury trial in 213 | any resulting litigation. 214 | -------------------------------------------------------------------------------- /run.cfm: -------------------------------------------------------------------------------- 1 | 4 | 5 | colddoc = createObject("component", "ColdDoc").init(); 6 | 7 | strategy = createObject("component", "colddoc.strategy.api.HTMLAPIStrategy").init(expandPath("./docs"), "ColdDoc 1.0"); 8 | colddoc.setStrategy(strategy); 9 | 10 | colddoc.generate(expandPath("/colddoc"), "colddoc"); 11 | 12 | 13 |

Done!

14 | 15 | Documentation 16 | -------------------------------------------------------------------------------- /strategy/AbstractTemplateStrategy.cfc: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | instance.static.META_ABSTRACT = "colddoc:abstract"; 8 | instance.static.META_GENERIC = "colddoc:generic"; 9 | 10 | 11 | 12 | 13 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | setFunctionQueryCache(StructNew()); 24 | 25 | 26 | 27 | 29 | 30 | 31 | var qPackages = 0; 32 | var tree = {}; 33 | var root = 0; 34 | var node = 0; 35 | var item = 0; 36 | 37 | 38 | SELECT DISTINCT 39 | package 40 | FROM 41 | arguments.qMetaData 42 | ORDER BY 43 | package 44 | 45 | 46 | 47 | 48 | 49 | 50 | if(NOT structKeyExists(node, item)) 51 | { 52 | node[item] = {}; 53 | } 54 | 55 | node = node[item]; 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | var startCall = arguments.startCommand; 70 | var endCall = arguments.endCommand; 71 | var key = 0; 72 | var thisArgs = 0; 73 | 74 | if(NOT StructKeyExists(args, "fullname")) 75 | { 76 | arguments.args.fullname = ""; 77 | } 78 | 79 | for(key in arguments.packageTree) 80 | { 81 | thisArgs = structCopy(arguments.args); 82 | thisArgs.name = key; 83 | thisArgs.fullName = listAppend(thisArgs.fullName, thisArgs.name, "."); 84 | 85 | startCall(argumentCollection=thisArgs); 86 | 87 | visitPackageTree(packageTree[key], startCall, endCall, thisArgs); 88 | 89 | endCall(argumentCollection=thisArgs); 90 | } 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | var primitives = "string,date,struct,array,void,binary,numeric,boolean,query,xml,uuid,any,component"; 99 | return ListFindNoCase(primitives, arguments.type); 100 | 101 | 102 | 103 | 104 | 105 | 106 | var qFunctions = QueryNew("name,metadata"); 107 | var func = 0; 108 | var results = 0; 109 | var cache = getFunctionQueryCache(); 110 | 111 | if(StructKeyExists(cache, arguments.metadata.name)) 112 | { 113 | return cache[arguments.metadata.name]; 114 | } 115 | 116 | if(NOT StructKeyExists(arguments.metadata, "functions")) 117 | { 118 | return qFunctions; 119 | } 120 | 121 | 122 | 123 | //dodge cfthread functions 124 | if(NOT JavaCast("string", func.name).startsWith("_cffunccfthread_")) 125 | { 126 | QueryAddRow(qFunctions); 127 | QuerySetCell(qFunctions, "name", func.name); 128 | QuerySetCell(qFunctions, "metadata", safeFunctionMeta(func, arguments.metadata)); 129 | } 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | if(len(arguments.class)) 144 | { 145 | return ListGetAt(arguments.class, ListLen(arguments.class, "."), "."); 146 | } 147 | 148 | return arguments.class; 149 | 150 | 151 | 152 | 153 | function getPackage(class) 154 | { 155 | var objectname = getObjectName(arguments.class); 156 | var lenCount = Len(arguments.class) - (Len(objectname) + 1); 157 | 158 | if( lenCount gt 0 ) 159 | { 160 | return Left(arguments.class, lenCount); 161 | } 162 | else 163 | { 164 | return arguments.class; 165 | } 166 | } 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | var resolvedClassName = resolveClassName(arguments.className, arguments.package); 175 | var objectName = getObjectName(resolvedClassName); 176 | var packageName = getPackage(resolvedClassName); 177 | var qClass = getMetaSubQuery(arguments.qMetaData, "LOWER(package)=LOWER('#packageName#') AND LOWER(name)=LOWER('#objectName#')"); 178 | 179 | return qClass.recordCount; 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | return isPrimitive(arguments.className) OR classExists(argumentCollection=arguments); 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | if(ListLen(arguments.className, ".") eq 1) 197 | { 198 | arguments.className = arguments.package & "." & arguments.className; 199 | } 200 | 201 | return arguments.className; 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | SELECT * 212 | from 213 | arguments.query 214 | 215 | WHERE 216 | #PreserveSingleQuotes(arguments.where)# 217 | 218 | 219 | ORDER BY 220 | #arguments.orderby# 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | var local = {}; 231 | 232 | if(NOT StructKeyExists(arguments.func, "returntype")) 233 | { 234 | arguments.func.returntype = "any"; 235 | } 236 | 237 | if(NOT StructKeyExists(arguments.func, "access")) 238 | { 239 | arguments.func.access = "public"; 240 | } 241 | 242 | //move the cfproperty hints onto functions 243 | if(StructKeyExists(arguments.metadata, "properties")) 244 | { 245 | if(Lcase(arguments.func.name).startsWith("get") AND NOT StructKeyExists(arguments.func, "hint")) 246 | { 247 | local.name = replaceNoCase(arguments.func.name, "get", ""); 248 | local.property = getPropertyMeta(local.name, arguments.metadata.properties); 249 | 250 | if(structKeyExists(local.property, "hint")) 251 | { 252 | arguments.func.hint = "get: " & local.property.hint; 253 | } 254 | 255 | } 256 | else if(LCase(arguments.func.name).startsWith("set") AND NOT StructKeyExists(arguments.func, "hint")) 257 | { 258 | local.name = replaceNoCase(arguments.func.name, "set", ""); 259 | local.property = getPropertyMeta(local.name, arguments.metadata.properties); 260 | 261 | if(structKeyExists(local.property, "hint")) 262 | { 263 | arguments.func.hint = "set: " & local.property.hint; 264 | } 265 | } 266 | } 267 | 268 | //move any argument meta from @foo.bar annotations onto the argument meta 269 | if(structKeyExists(arguments.func, "parameters")) 270 | { 271 | for(local.metaKey in arguments.func) 272 | { 273 | if(ListLen(local.metaKey, ".") gt 1) 274 | { 275 | local.paramKey = listGetAt(local.metaKey, 1, "."); 276 | local.paramExtraMeta = listGetAt(local.metaKey, 2, "."); 277 | local.paramMetaValue = arguments.func[local.metaKey]; 278 | 279 | local.len = ArrayLen(arguments.func.parameters); 280 | for(local.counter=1; local.counter lte local.len; local.counter++) 281 | { 282 | local.param = arguments.func.parameters[local.counter]; 283 | 284 | if(local.param.name eq local.paramKey) 285 | { 286 | local.param[local.paramExtraMeta] = local.paramMetaValue; 287 | } 288 | } 289 | } 290 | } 291 | } 292 | return arguments.func; 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | var local = {}; 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | if(NOT StructKeyExists(arguments.param, "type")) 314 | { 315 | arguments.param.type = "any"; 316 | } 317 | 318 | return arguments.param; 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | var html = 0; 327 | var local = {}; //for local variables 328 | 329 | 330 | 331 | fileWrite(arguments.path, html); 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | var qFiles = 0; 340 | var currentDir = ""; 341 | var safeDir = ""; 342 | 343 | arguments.fromDir = replaceNoCase(arguments.fromDir, "\", "/", "all"); 344 | arguments.toDir = replaceNoCase(arguments.toDir, "\", "/", "all"); 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | currentDir = arguments.toDir & replaceNoCase(safeDir & "/", arguments.fromDir, ""); 357 | ensureDirectory(currentDir); 358 | 359 | 360 | 361 | if(type neq "dir") 362 | { 363 | fileCopy(directory & "/" & name, currentDir & name); 364 | } 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | var meta = 0; 384 | arguments.class = resolveClassName(arguments.class, arguments.package); 385 | 386 | meta = getComponentMetadata(arguments.class); 387 | 388 | if(structKeyExists(meta, instance.static.META_ABSTRACT)) 389 | { 390 | return meta[instance.static.META_ABSTRACT]; 391 | } 392 | 393 | return false; 394 | 395 | 396 | 397 | 399 | 400 | 401 | 402 | var array = []; 403 | var local = {}; 404 | 405 | if(structKeyExists(arguments.meta, instance.static.META_GENERIC)) 406 | { 407 | array = listToArray(arguments.meta[instance.static.META_GENERIC]); 408 | 409 | local.len = ArrayLen(array); 410 | for(local.counter=1; local.counter lte local.len; local.counter++) 411 | { 412 | local.class = array[local.counter]; 413 | if(NOT isPrimitive(local.class)) 414 | { 415 | array[local.counter] = resolveClassName(local.class, arguments.package); 416 | } 417 | } 418 | } 419 | 420 | return array; 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | -------------------------------------------------------------------------------- /strategy/api/HTMLAPIStrategy.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | instance.static.TEMPLATE_PATH = "/colddoc/strategy/api/resources/templates"; 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | super.init(); 15 | 16 | setOutputDir(arguments.outputDir); 17 | setProjectTitle(arguments.projectTitle); 18 | 19 | return this; 20 | 21 | 22 | 23 | 24 | 25 | 26 | var basePath = getDirectoryFromPath(getMetaData(this).path); 27 | var args = 0; 28 | 29 | recursiveCopy(basePath & "resources/static", getOutputDir()); 30 | 31 | //write the index template 32 | args = {path=getOutputDir() & "/index.html", template="#instance.static.TEMPLATE_PATH#/index.html", projectTitle=getProjectTitle()}; 33 | writeTemplate(argumentCollection=args); 34 | 35 | writeOverviewSummaryAndFrame(arguments.qMetaData); 36 | 37 | writeAllClassesFrame(arguments.qMetaData); 38 | 39 | writePackagePages(arguments.qMetaData); 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | var currentDir = 0; 51 | var qPackage = 0; 52 | var qClasses = 0; 53 | var qInterfaces = 0; 54 | 55 | 56 | 57 | 58 | currentDir = getOutputDir() & "/" & replace(package, ".", "/", "all"); 59 | ensureDirectory(currentDir); 60 | qPackage = getMetaSubquery(arguments.qMetaData, "package = '#package#'", "name asc"); 61 | qClasses = getMetaSubquery(qPackage, "type='component'", "name asc"); 62 | qInterfaces = getMetaSubquery(qPackage, "type='interface'", "name asc"); 63 | 64 | writeTemplate(path=currentDir & "/package-summary.html", 65 | template="#instance.static.TEMPLATE_PATH#/package-summary.html", 66 | projectTitle = getProjectTitle(), 67 | package = package, 68 | qClasses = qClasses, 69 | qInterfaces = qInterfaces); 70 | 71 | writeTemplate(path=currentDir & "/package-frame.html", 72 | template="#instance.static.TEMPLATE_PATH#/package-frame.html", 73 | projectTitle = getProjectTitle(), 74 | package = package, 75 | qClasses = qClasses, 76 | qInterfaces = qInterfaces); 77 | 78 | buildClassPages(qPackage, 79 | arguments.qMetadata 80 | ); 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | var qSubClass = 0; 90 | var qImplementing = 0; 91 | var currentDir = 0; 92 | var subClass = 0; 93 | var safeMeta = 0; 94 | 95 | 96 | 99 | 100 | 101 | 102 | currentDir = getOutputDir() & "/" & replace(package, ".", "/", "all"); 103 | safeMeta = structCopy(metadata); 104 | 105 | if(safeMeta.type eq "component") 106 | { 107 | qSubClass = getMetaSubquery(arguments.qMetaData, "UPPER(extends) = UPPER('#arguments.qPackage.package#.#arguments.qPackage.name#')", "package asc, name asc"); 108 | qImplementing = QueryNew(""); 109 | } 110 | else 111 | { 112 | //all implementing subclasses 113 | qSubClass = getMetaSubquery(arguments.qMetaData, "UPPER(fullextends) LIKE UPPER('%:#arguments.qPackage.package#.#arguments.qPackage.name#:%')", "package asc, name asc"); 114 | qImplementing = getMetaSubquery(arguments.qMetaData, "UPPER(implements) LIKE UPPER('%:#arguments.qPackage.package#.#arguments.qPackage.name#:%')", "package asc, name asc"); 115 | } 116 | 117 | writeTemplate(path=currentDir & "/#name#.html", 118 | template="#instance.static.TEMPLATE_PATH#/class.html", 119 | projectTitle = getProjectTitle(), 120 | package = arguments.qPackage.package, 121 | name = arguments.qPackage.name, 122 | qSubClass = qSubClass, 123 | qImplementing = qImplementing, 124 | qMetadata = qMetaData, 125 | metadata = safeMeta 126 | ); 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | var qPackages = 0; 136 | 137 | 138 | SELECT DISTINCT 139 | package 140 | FROM 141 | arguments.qMetaData 142 | ORDER BY 143 | package 144 | 145 | 146 | 147 | writeTemplate(path=getOutputDir() & "/overview-summary.html", 148 | template="#instance.static.TEMPLATE_PATH#/overview-summary.html", 149 | projectTitle = getProjectTitle(), 150 | qPackages = qPackages); 151 | 152 | 153 | //overview frame 154 | writeTemplate(path=getOutputDir() & "/overview-frame.html", 155 | template="#instance.static.TEMPLATE_PATH#/overview-frame.html", 156 | projectTitle=getProjectTitle(), 157 | qPackages = qPackages); 158 | 159 | 160 | 161 | 162 | 163 | 164 | arguments.qMetadata = getMetaSubquery(query=arguments.qMetaData, orderby="name asc"); 165 | 166 | writeTemplate(path=getOutputDir() & "/allclasses-frame.html", 167 | template="#instance.static.TEMPLATE_PATH#/allclasses-frame.html", 168 | qMetaData = arguments.qMetaData); 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | -------------------------------------------------------------------------------- /strategy/api/resources/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Generated Documentation (Untitled) 8 | 9 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | <H2> 31 | Frame Alert</H2> 32 | 33 | <P> 34 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 35 | <BR> 36 | Link to<A HREF="overview-summary.html">Non-frame version.</A> 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /strategy/api/resources/static/resources/inherit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmandel/ColdDoc/1dc40049ccaa44f72d043cd633ef0412b3708f2d/strategy/api/resources/static/resources/inherit.gif -------------------------------------------------------------------------------- /strategy/api/resources/static/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Javadoc style sheet */ 2 | 3 | /* Define colors, fonts and other style attributes here to override the defaults */ 4 | 5 | /* Page background color */ 6 | body { background-color: #FFFFFF } 7 | 8 | /* Headings */ 9 | h1 { font-size: 145% } 10 | 11 | /* Table colors */ 12 | .TableHeadingColor { background: #CCCCFF } /* Dark mauve */ 13 | .TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ 14 | .TableRowColor { background: #FFFFFF } /* White */ 15 | 16 | /* Font used in left-hand frame lists */ 17 | .FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif } 18 | .FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } 19 | .FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } 20 | 21 | /* Navigation bar fonts and colors */ 22 | .NavBarCell1 { background-color:#EEEEFF;} /* Light mauve */ 23 | .NavBarCell1Rev { background-color:#00008B;} /* Dark Blue */ 24 | .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} 25 | .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} 26 | 27 | .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} 28 | .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} 29 | 30 | -------------------------------------------------------------------------------- /strategy/api/resources/templates/allclasses-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | All Classes 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | All Classes 18 | 19 |
20 | 21 | 22 | 23 | 30 | 31 |
24 | 25 | #name##name# 26 |
27 |
28 |
29 |
32 | 33 | 34 | 35 |
-------------------------------------------------------------------------------- /strategy/api/resources/templates/class.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Callable 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 38 | 39 |
40 | 41 |

42 | 43 | #arguments.package# 44 |
45 | 46 | Interface 47 | 48 | Class 49 | 50 | #arguments.name#

51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | ') /> 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 |
#local.buffer.toString()#
73 | 74 | 75 | 76 | 77 |
78 |
All Implemented Interfaces: 79 |
80 | 81 | 82 | 83 | , 84 | #writeClassLink(getPackage(interface), getObjectName(interface), arguments.qMetaData, "short")# 85 | 86 |
87 |
88 |
89 | 90 | 91 |
92 |
All Known Implementing Classes: 93 |
94 | 95 | , 96 | #writeClassLink(arguments.qImplementing.package, arguments.qImplementing.name, arguments.qMetaData, "short")# 97 | 98 |
99 |
100 |
101 |
102 | 103 | 104 |
105 |
Direct Known SubclassesAll Known Subinterfaces: 106 |
107 | 108 | , 109 | #arguments.qSubclass.name# 110 | 111 |
112 |
113 |
114 | 115 |
116 |
117 |
118 | 119 | 120 | local.buffer.setLength(0); 121 | local.buffer.append("public "); 122 | if(isAbstractClass(name, arguments.package)) 123 | { 124 | local.buffer.append("abstract "); 125 | } 126 | 127 | if(arguments.metadata.type eq "interface") 128 | { 129 | local.buffer.append("interface"); 130 | } 131 | else 132 | { 133 | local.buffer.append("class"); 134 | } 135 | 136 | local.buffer.append(" #arguments.name#"); 137 | local.buffer.append(local.ls); 138 | if(StructKeyExists(arguments.metadata, "extends")) 139 | { 140 | local.extendsmeta = arguments.metadata.extends; 141 | if(arguments.metadata.type eq "interface") 142 | { 143 | local.extendsmeta = arguments.metadata.extends[structKeyList(local.extendsmeta)]; 144 | } 145 | local.buffer.append("
extends #writeClassLink(getPackage(local.extendsmeta.name), getObjectName(local.extendsmeta.name), arguments.qMetaData, 'short')#
"); 146 | } 147 | 148 | 149 |
#local.buffer.toString()#
150 | 151 |
152 | 153 | 154 |

155 | #arguments.metadata.hint# 156 |

157 | 158 | 159 |


160 | 161 |

162 | 163 | 164 | instance.class.cache = StructNew(); 165 | local.localFunctions = StructNew(); 166 | 167 | local.qFunctions = buildFunctionMetaData(arguments.metadata); 168 | 169 | local.qInit = getMetaSubQuery(local.qFunctions, "UPPER(name)='INIT'"); 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 182 | 183 | 184 | 185 | 187 | 188 | 196 | 197 |
181 | Constructor Summary
186 | #local.init.access# 189 | #writeMethodLink(arguments.name, arguments.package, local.init, arguments.qMetaData)# 190 |
191 | 192 | 193 |           #listGetAt(local.init.hint, 1, ".")# 194 | 195 |
198 |   199 |
200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 219 | 226 | 227 | 228 | 229 |
210 | Method Summary
218 | #local.func.access# #writeTypeLink(local.func.returnType, arguments.package, arguments.qMetadata, local.func)##writeMethodLink(arguments.name, arguments.package, local.func, arguments.qMetaData)# 220 |
221 | 222 | 223 |           #listGetAt(local.func.hint, 1, ".")# 224 | 225 |
230 | 231 |
232 | 233 | 234 | 235 | 236 | 237 | if(local.localmeta.type eq "interface") 238 | { 239 | local.localmeta = local.localmeta.extends[structKeyList(local.localmeta.extends)]; 240 | } 241 | else 242 | { 243 | local.localmeta = local.localmeta.extends; 244 | } 245 | 246 | 247 | 248 | 249 |   250 | 251 | 252 | 253 | 254 | 255 | 256 | 272 | 273 |
Methods inherited from class #writeClassLink(getPackage(local.localmeta.name), getObjectName(local.localmeta.name), arguments.qMetaData, 'long')#
257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | #local.func.name#') /> 266 | 267 | 268 | 269 | 270 | #local.buffer.toString()# 271 |
274 |
275 | 276 |   277 |

278 | 279 | 280 | 281 | 282 | 283 | 284 |

285 | 286 | 288 | 289 |
287 | Constructor Detail
290 | 291 |

292 | 293 | #local.init.name#

294 | #local.init.access# #writeMethodLink(arguments.name, arguments.package, local.init, arguments.qMetaData, false)# 295 |
296 |
297 | 298 | #local.init.hint# 299 | 300 |

301 |

302 | 303 |
304 |
Parameters:
305 | 306 |
#local.param.name# - #local.param.hint#
307 |
308 |
309 |
310 | 311 |
312 | 313 |
314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 327 | 328 |
326 | Method Detail
329 | 330 | 331 |

332 | #local.func.name#

333 | #local.func.access# #writeTypeLink(local.func.returnType, arguments.package, arguments.qMetaData, local.func)# #writeMethodLink(arguments.name, arguments.package, local.func, arguments.qMetaData, false)# 334 | 335 |
336 |
337 | 338 | #local.func.hint# 339 | 340 |

341 |

342 | 343 | 356 | 357 | 358 | 359 |
360 |
Specified by:
361 |
362 | 363 | #local.func.name# 364 | in interface 365 | 366 | #writeClassLink(getPackage(local.specified), getObjectName(local.specified), arguments.qMetaData, 'short')# 367 | 368 |
369 |
370 |
371 |
372 | 373 | 374 | 375 |
376 |
Overrides:
377 |
378 | 379 | #local.func.name# 380 | in class 381 | 382 | #writeClassLink(getPackage(local.overWrites), getObjectName(local.overWrites), arguments.qMetaData, 'short')# 383 | 384 |
385 |
386 |
387 | 388 | 389 |
390 |
Parameters:
391 | 392 |
#local.param.name# - #local.param.hint#
393 |
394 |
395 |
396 | 397 | 398 |
399 |
400 |
401 |
402 | 403 | 409 | 410 |
411 | 412 | 413 | 414 |
415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | if(i++ neq 1) 432 | { 433 | builder.append(", "); 434 | } 435 | 436 | if(NOT StructKeyExists(param, "required")) 437 | { 438 | param.required = false; 439 | } 440 | 441 | if(NOT param.required) 442 | { 443 | builder.append("["); 444 | } 445 | 446 | 447 | 448 | safeParamMeta(param); 449 | builder.append(writeTypeLink(param.type, arguments.package, arguments.qMetadata, param)); 450 | 451 | builder.append(" " & param.name); 452 | 453 | if(StructKeyExists(param, "default")) 454 | { 455 | builder.append("='" & param.default & "'"); 456 | } 457 | 458 | if(NOT param.required) 459 | { 460 | builder.append("]"); 461 | } 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | #arguments.func.name##builder.toString()#'/> 470 | 471 | #arguments.func.name##builder.toString()#'/> 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | var result = createObject("java", "java.lang.StringBuilder").init(); 482 | var local = {}; 483 | 484 | if(isPrimitive(arguments.type)) 485 | { 486 | result.append(arguments.type); 487 | } 488 | else 489 | { 490 | arguments.type = resolveClassName(arguments.type, arguments.package); 491 | result.append(writeClassLink(getPackage(arguments.type), getObjectName(arguments.type), arguments.qMetaData, 'short')); 492 | } 493 | 494 | if(NOT structIsEmpty(arguments.genericMeta)) 495 | { 496 | local.array = getGenericTypes(arguments.genericMeta, arguments.package); 497 | if(NOT arrayIsEmpty(local.array)) 498 | { 499 | result.append("<"); 500 | 501 | local.len = ArrayLen(local.array); 502 | for(local.counter=1; local.counter lte local.len; local.counter++) 503 | { 504 | if(local.counter neq 1) 505 | { 506 | result.append(","); 507 | } 508 | 509 | local.generic = local.array[local.counter]; 510 | result.append(writeTypeLink(local.generic, arguments.package, arguments.qMetaData)); 511 | } 512 | 513 | result.append(">"); 514 | } 515 | } 516 | 517 | return result.toString(); 518 | 519 | 520 | 521 | 522 | /* 523 | function getArgumentList(func) 524 | { 525 | var list = ""; 526 | var len = 0; 527 | var counter = 1; 528 | var param = 0; 529 | 530 | if(StructKeyExists(arguments.func, "parameters")) 531 | { 532 | len = ArrayLen(arguments.func.parameters); 533 | for(; counter lte len; counter = counter + 1) 534 | { 535 | param = safeParamMeta(arguments.func.parameters[counter]); 536 | list = listAppend(list, param.type); 537 | } 538 | } 539 | 540 | return list; 541 | } 542 | */ 543 | 544 | function writeClassLink(package, name, qMetaData, format) 545 | { 546 | var qClass = getMetaSubQuery(arguments.qMetaData, "LOWER(package)=LOWER('#arguments.package#') AND LOWER(name)=LOWER('#arguments.name#')"); 547 | var builder = 0; 548 | var safeMeta = 0; 549 | var title = 0; 550 | 551 | if(qClass.recordCount) 552 | { 553 | safeMeta = StructCopy(qClass.metadata); 554 | 555 | title = "class"; 556 | if(safeMeta.type eq "interface") 557 | { 558 | title = "interface"; 559 | } 560 | 561 | builder = createObject("java", "java.lang.StringBuilder").init(); 562 | builder.append(''); 563 | if(arguments.format eq "short") 564 | { 565 | builder.append(qClass.name); 566 | } 567 | else 568 | { 569 | builder.append(qClass.package & "." & qClass.name); 570 | } 571 | builder.append(""); 572 | 573 | return builder.toString(); 574 | } 575 | 576 | return package & "." & name; 577 | } 578 | 579 | function getInheritence(metadata) 580 | { 581 | var localmeta = arguments.metadata; 582 | var inheritence = [arguments.metadata.name]; 583 | 584 | while(StructKeyExists(localmeta, "extends")) 585 | { 586 | //manage interfaces 587 | if(localmeta.type eq "interface") 588 | { 589 | localmeta = localmeta.extends[structKeyList(localmeta.extends)]; 590 | } 591 | else 592 | { 593 | localmeta = localmeta.extends; 594 | } 595 | 596 | ArrayPrepend(inheritence, localmeta.name); 597 | } 598 | 599 | return inheritence; 600 | } 601 | 602 | function getImplements(metadata) 603 | { 604 | var localmeta = arguments.metadata; 605 | var interfaces = {}; 606 | var key = 0; 607 | var imeta = 0; 608 | 609 | while(StructKeyExists(localmeta, "extends")) 610 | { 611 | if(StructKeyExists(localmeta, "implements")) 612 | { 613 | for(key in localmeta.implements) 614 | { 615 | imeta = localmeta.implements[local.key]; 616 | interfaces[imeta.name] = 1; 617 | } 618 | } 619 | localmeta = localmeta.extends; 620 | } 621 | 622 | interfaces = structKeyArray(interfaces); 623 | 624 | arraySort(interfaces, "textnocase"); 625 | 626 | return interfaces; 627 | } 628 | 629 | function findOverwrite(metadata, functionName) 630 | { 631 | var qFunctions = 0; 632 | 633 | while(StructKeyExists(arguments.metadata, "extends")) 634 | { 635 | if(arguments.metadata.type eq "interface") 636 | { 637 | arguments.metadata = arguments.metadata.extends[structKeyList(arguments.metadata.extends)]; 638 | } 639 | else 640 | { 641 | arguments.metadata = arguments.metadata.extends; 642 | } 643 | 644 | qFunctions = buildFunctionMetaData(arguments.metadata); 645 | qFunctions = getMetaSubQuery(qFunctions, "name='#arguments.functionName#'"); 646 | 647 | if(qFunctions.recordCount) 648 | { 649 | return arguments.metadata.name; 650 | 651 | } 652 | } 653 | 654 | return ""; 655 | } 656 | 657 | function findSpecifiedBy(metadata, functionname) 658 | { 659 | var imeta = 0; 660 | var qFunctions = 0; 661 | var key = 0; 662 | 663 | if(structKeyExists(arguments.metadata, "implements")) 664 | { 665 | for(key in arguments.metadata.implements) 666 | { 667 | imeta = arguments.metadata.implements[local.key]; 668 | 669 | qFunctions = buildFunctionMetaData(imeta); 670 | qFunctions = getMetaSubQuery(qFunctions, "name='#arguments.functionName#'"); 671 | 672 | if(qFunctions.recordCount) 673 | { 674 | return imeta.name; 675 | } 676 | 677 | //now look up super-interfaces 678 | while(structKeyExists(imeta, "extends")) 679 | { 680 | imeta = imeta.extends[structKeyList(imeta.extends)]; 681 | 682 | qFunctions = buildFunctionMetaData(imeta); 683 | qFunctions = getMetaSubQuery(qFunctions, "name='#arguments.functionName#'"); 684 | 685 | if(qFunctions.recordCount) 686 | { 687 | return imeta.name; 688 | } 689 | } 690 | } 691 | 692 | } 693 | 694 | return ""; 695 | } 696 | 697 | //stupid cleanup 698 | 699 | StructDelete(variables, "findOverwrite"); 700 | StructDelete(variables, "writeTypeLink"); 701 | StructDelete(variables, "writeMethodLink"); 702 | StructDelete(variables, "getArgumentList"); 703 | StructDelete(variables, "writeClassLink"); 704 | StructDelete(variables, "getInheritence"); 705 | StructDelete(variables, "writeObjectLink"); 706 | StructDelete(variables, "getImplements"); 707 | StructDelete(variables, "findSpecifiedBy"); 708 | 709 | //store for resident data 710 | StructDelete(variables.instance, "class"); 711 | 712 | -------------------------------------------------------------------------------- /strategy/api/resources/templates/inc/nav.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 47 | 52 | 53 | 54 | 55 | 56 | 61 | 62 | 63 |
48 | 49 | #attributes.projectTitle# 50 | 51 |
64 | 65 | -------------------------------------------------------------------------------- /strategy/api/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Generated Documentation (#arguments.projectTitle#) 8 | 9 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | <H2> 31 | Frame Alert</H2> 32 | 33 | <P> 34 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 35 | <BR> 36 | Link to<A HREF="overview-summary.html">Non-frame version.</A> 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /strategy/api/resources/templates/overview-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Overview 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 24 | 25 |
23 | #arguments.projectTitle#
26 | 27 | 28 | 29 | 45 | 46 |
All Classes 30 |

31 | 32 | Packages 33 |
34 | 35 | 36 | 37 | #package# 38 |
39 |
40 | 41 | 42 |
43 | 44 |

47 | 48 |

49 |   50 | 51 | 52 | -------------------------------------------------------------------------------- /strategy/api/resources/templates/overview-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Overview 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | 33 | 34 |


35 | 36 |

37 | #arguments.projectTitle# 38 |

39 | 40 | 41 | 42 | 43 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 |
44 | Packages
#package#
56 | 57 |

58 |  


59 | 60 | 65 | 66 |
67 | 68 | 69 | 70 |
-------------------------------------------------------------------------------- /strategy/api/resources/templates/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | #arguments.package# 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | #arguments.package# 21 | 22 | 23 | 24 | 25 | 34 | 35 |
26 | 27 | Interfaces  28 | 29 | 30 |
31 | #name# 32 |
33 |
36 |
37 | 38 | 39 | 40 | 41 | 50 | 51 |
42 | 43 | Classes  44 | 45 | 46 |
47 | #name# 48 |
49 |
52 | 53 |
54 | 55 | 56 | 57 |
-------------------------------------------------------------------------------- /strategy/api/resources/templates/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | #arguments.package# 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 35 |
36 |

37 | Package #arguments.package# 38 |

39 | 40 |

41 | 42 | 43 | 44 | 45 | 47 | 48 | 49 | 50 | 51 | 52 | 58 | 59 | 60 |
46 | Interface Summary
#name# 53 | 54 | 55 | #ListGetAt(meta.hint, 1, ".")# 56 | 57 |
61 |

62 | 63 | 64 | 65 | 66 | 67 | 69 | 70 | 71 | 72 | 73 | 74 | 80 | 81 | 82 | 83 |
68 | Class Summary
#name# 75 | 76 | 77 | #ListGetAt(meta.hint, 1, ".")# 78 | 79 |
84 |

85 | 86 | 87 | 88 | 94 | 95 |


96 | 97 | 98 | 99 |
-------------------------------------------------------------------------------- /strategy/uml2tools/XMIStrategy.cfc: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | instance.static.TEMPLATE_PATH = "/colddoc/strategy/uml2tools/resources/templates"; 8 | 9 | 10 | 11 | 12 | 13 | super.init(); 14 | 15 | if(NOT arguments.outputFile.endsWith(".uml")) 16 | { 17 | arguments.outputFile &= ".uml"; 18 | } 19 | 20 | setOutputFile(arguments.outputFile); 21 | 22 | return this; 23 | 24 | 25 | 26 | 27 | 28 | 29 | var basePath = getDirectoryFromPath(getMetaData(this).path); 30 | var args = 0; 31 | var packages = buildPackageTree(arguments.qMetadata, true); 32 | 33 | ensureDirectory(getDirectoryFromPath(getOutputFile())); 34 | 35 | //write the index template 36 | args = {path=getOutputFile() 37 | ,template="#instance.static.TEMPLATE_PATH#/template.uml" 38 | ,packages = packages 39 | ,qMetadata = qMetadata 40 | }; 41 | writeTemplate(argumentCollection=args); 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | var qFunctions = buildFunctionMetaData(arguments.meta); 54 | var qProperties = QueryNew("name, access, type, generic"); 55 | //is is used for boolean properties 56 | var qGetters = getMetaSubQuery(qFunctions, "LOWER(name) LIKE 'get%' OR LOWER(name) LIKE 'is%'"); 57 | var qSetters = 0; 58 | var propertyName = 0; 59 | var setterMeta = 0; 60 | var getterMeta = 0; 61 | var generics = 0; 62 | 63 | 64 | 65 | if(LCase(name).startsWith("get")) 66 | { 67 | propertyName = replaceNoCase(name, "get", ""); 68 | } 69 | else 70 | { 71 | propertyName = replaceNoCase(name, "is", ""); 72 | } 73 | 74 | qSetters = getMetaSubQuery(qFunctions, "LOWER(name) = LOWER('set#propertyName#')"); 75 | getterMeta = structCopy(metadata); 76 | 77 | //lets just take getter generics, easier to do. 78 | generics = getGenericTypes(metadata, arguments.package); 79 | 80 | if(qSetters.recordCount) 81 | { 82 | setterMeta = qSetters.metadata; 83 | 84 | if(structKeyExists(setterMeta, "parameters") 85 | AND arrayLen(setterMeta.parameters) eq 1 86 | AND setterMeta.parameters[1].type eq getterMeta.returnType 87 | ) 88 | { 89 | if(setterMeta.access eq "public" OR getterMeta.access eq "public") 90 | { 91 | access = "public"; 92 | } 93 | else if(setterMeta.access eq "package" OR getterMeta.access eq "package") 94 | { 95 | access = "package"; 96 | } 97 | else 98 | { 99 | access = "private"; 100 | } 101 | queryAddRow(qProperties); 102 | //lower case the front 103 | querySetCell(qProperties, "name", rereplace(propertyName, "([A-Z]*)(.*)", "\L\1\E\2")); 104 | querySetCell(qProperties, "access", access); 105 | querySetCell(qProperties, "type", getterMeta.returntype); 106 | querySetCell(qProperties, "generic", generics); 107 | } 108 | } 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /strategy/uml2tools/resources/templates/template.uml: -------------------------------------------------------------------------------- 1 | 2 | 3 | variables.qMetaData = arguments.qMetaData; 4 | 5 | primitiveMap = { 6 | boolean = "_q5yYQOXIEd686otsIQBbbA" 7 | ,String = "_q5yNUOXIEd686otsIQBbbA" 8 | ,Array = "_2vrXgOXyEd62aotsIQBbbA" 9 | ,Struct = "_3vrTgOXyEd686otsIQBbbA" 10 | ,Query = "_5Hv5sOXyEd686otsIQBbbA" 11 | ,XML = "_7UJf0OXyEd686otsIQBbbA" 12 | ,Numeric = "_HCt_wOXzEd686otsIQBbbA" 13 | ,Date = "_Hd7_wOXzEd686otsIQBbbA" 14 | ,binary = "_Kt9icOXzEd686otsIQBbbA" 15 | ,uuid = "_QHE8MOXzEd686otsIQBbbA" 16 | ,any = "_SLUr4OXzEd686otsIQBbbA" 17 | }; 18 | 19 | assocMap = {}; 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | args.builder = createObject("java", "java.lang.StringBuilder").init(); 41 | visitPackageTree(arguments.packages, displayPackageStart, displayPackageEnd, args); 42 | 43 | 44 | #args.builder.toString()# 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | var xml = 0; 55 | id = getPackageID(arguments.fullname); 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | arguments.builder.append(xml); 64 | displayClass(arguments.fullname, arguments.builder); 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | arguments.builder.append(''); 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | var xml = 0; 82 | var id = 0; 83 | var qProperties = 0; 84 | var qClasses = getMetaSubquery(qMetaData, "package = '#arguments.package#'", "name asc"); 85 | 86 | 87 | 88 | 89 | 90 | 91 | isAbstract="true"> 92 | 93 | 94 | 95 | 96 | 97 | 98 | ')> 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | var qFunctions = buildFunctionMetaData(arguments.meta); 111 | var param = 0; 112 | var package = getPackage(arguments.meta.name); 113 | var safeMeta = 0; 114 | var visited = {}; 115 | 116 | 117 | 118 | 119 | 120 | 121 | ')> 122 | 123 | 124 | 125 | 126 | ')> 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | var package = getPackage(arguments.meta.name); 137 | 138 | //ignore interfaces for now 139 | if(arguments.meta.type eq "component" and structKeyExists(arguments.meta, "extends") AND arguments.meta.extends.name neq "WEB-INF.cftags.component") 140 | { 141 | arguments.builder.append(''); 147 | } 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | var package = getPackage(arguments.meta.name); 157 | 158 | 159 | 160 | 161 | 162 | 163 | ')> 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | var fragment = 0; 173 | var package = 0; 174 | var assocID = 0; 175 | var endID = 0; 176 | var sourceID = 0; 177 | var genericType = 0; 178 | var bidirection = 0; 179 | 180 | 181 | 182 | assocID = "_" & createUUID(); 183 | endID = "_" & createUUID(); 184 | sourceID = "_" & createUUID(); 185 | 186 | package = getPackage(arguments.meta.name); 187 | 188 | 189 | 190 | 191 | bidirection = getBiderectionalAssociation(arguments.meta, type, package); 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | *1"/> 201 | 01"/> 202 | 203 | 204 | *1"/> 205 | 01"/> 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | assocID = "_" & createUUID(); 218 | endID = "_" & createUUID(); 219 | sourceID = "_" & createUUID(); 220 | 221 | package = getPackage(arguments.meta.name); 222 | 223 | bidirection = getBiderectionalAssociation(arguments.meta, genericType, package); 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | *1"/> 232 | 01"/> 233 | 234 | 235 | *1"/> 236 | 01"/> 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 252 | 253 | 254 | 255 | 256 | var local = {}; 257 | 258 | arguments.associationType = resolveClassName(arguments.associationType, arguments.package); 259 | local.class = resolveClassName(arguments.meta.name, arguments.package); 260 | 261 | local.assocMeta = getComponentMetadata(arguments.associationType); 262 | 263 | if(NOT structKeyExists(assocMap, local.class)) 264 | { 265 | assocMap[local.class] = {}; 266 | } 267 | 268 | //this is to stop the other side doing the same thing 269 | if(structKeyExists(assocMap, arguments.associationType) AND structKeyExists(assocMap[arguments.associationType], local.class)) 270 | { 271 | local.result = {completed=true}; 272 | return local.result; 273 | } 274 | 275 | local.qProperties = determineProperties(local.assocMeta, getPackage(local.assocMeta.name)); 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | var qFunctions = buildFunctionMetaData(arguments.meta); 300 | var qInitFunctions = getMetaSubQuery(qFunctions, "UPPER(name)='INIT'"); 301 | var qBodyFunctions = getMetaSubQuery(qFunctions, "UPPER(name)!='INIT'"); 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | //don't display get/set functions for properties 310 | if(NOT isFunctionAProperty(arguments.qProperties, name)) 311 | { 312 | arguments.builder.append(buildFunctionXML(arguments.meta, metadata)); 313 | } 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | var check = true; 323 | var property = 0; 324 | var qProperty = 0; 325 | 326 | if(lCase(arguments.functionName).startsWith("set")) 327 | { 328 | property = replaceNoCase(arguments.functionName, "set", ""); 329 | } 330 | else if(lCase(arguments.functionName).startsWith("get")) 331 | { 332 | property = replaceNoCase(arguments.functionName, "get", ""); 333 | } 334 | else if(lCase(arguments.functionName).startsWith("is")) 335 | { 336 | property = replaceNoCase(arguments.functionName, "is", ""); 337 | } 338 | else 339 | { 340 | return false; 341 | } 342 | 343 | qProperty = getMetaSubQuery(arguments.qProperties, "LOWER(name) = LOWER('#property#')"); 344 | return qProperty.recordCount; 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | var id= "_" & createUUID(); 353 | var package = getPackage(arguments.meta.name); 354 | var param = 0; 355 | 356 | 357 | 358 | 359 | type="#getTypeId(arguments.func.returntype, package)#" direction="return"/> 360 | 361 | 362 | 363 | type="#getTypeId(param.type, package)#"> 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | return "_" & hash("package:" & lCase(arguments.package)); 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | if(structKeyExists(primitiveMap, arguments.type)) 386 | { 387 | return primitiveMap[arguments.type]; 388 | } 389 | 390 | arguments.type = resolveClassName(arguments.type, arguments.package); 391 | 392 | return "_" & hash("class:" & lcase(arguments.type)); 393 | 394 | 395 | 396 | 397 | 398 | funcs = "getBiderectionalAssociation,displayPackageStart,displayPackageEnd,displayClass,displayClassFunctions,getPackageID,getTypeId,buildFunctionXML,displayClassProperties,isFunctionAProperty,displayClassUsage,displayClassAssociations"; 399 | 400 | 401 | 402 | 403 | 404 | 405 | --------------------------------------------------------------------------------