Home directory for Malawi's wwwroot
Duncan Ewan
2021-02-19 3e758c29e0fde36fc088efcfc88f9a3014432b64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
<cfscript>
    isTypeInterface  = IsInterface(cd);
 
    if (isTypeInterface) {
        ancestors = GetInterfaceAncestors(cd);
        componentType = "Interface"    ;
        methods = StructNew();
        methods = GetInterfaceMethods(cd,methods,true);
        properties = StructNew();
        interfaces = ArrayNew(1);
    }
    else {
        ancestors = GetAncestors(cd) ;
        componentType = "Component";
        methods = GetMethods(ancestors) ;
        properties = GetProperties(ancestors) ;
        interfaces = GetImplementedInterfaces(cd);
    }
 
    implementedMethodList = '' ;
    inheritedMethodList = '' ;
    baseMethodList = '' ;
 
    for ( name in methods ) {
        if ( methods[name].implementedIn eq cd.name )
            implementedMethodList = ListAppend( implementedMethodList, name ) ;
        else if ( methods[name].implementedIn eq 'web-inf.cftags.component' )
            baseMethodList = ListAppend( baseMethodList, name ) ;
        else
            inheritedMethodList = ListAppend( inheritedMethodList, name ) ;
    }
 
</cfscript>
 
 
<cfoutput><html>
<head>
<title>#componentType# #ListLast(cd.name,'.')#</title>
<cfinclude template="_component_style.cfm">
</head>
<body style="padding-bottom : 800px;">
</cfoutput>
 
<!--- <cfdump var="#cd#"> --->
 
<!--- NAME (header) --->
 
<cfoutput>
<font size="-2">#cd.name#</font><br>
<font size="+1"><b>#componentType# #ListLast(cd.name,'.')#
<cfif StructKeyExists(cd,"displayName") and cd.displayName neq cd.name>(#cd.displayName#)</cfif>
</b></font>
</cfoutput>
 
<!--- HIERARCHY and PATH--->
 
<cfoutput>
<br><br><br>
<table>
</cfoutput>
<cfif not isTypeInterface>
<tr><td>hierarchy:</td><td>
    <cfloop index="i" from="1" to="#ArrayLen(ancestors)#">
 
        <cfoutput>#RepeatString('&nbsp;',(i-1)*6)##GetLinkForType(ancestors[i].name, "LONG")#<br></cfoutput>
        <cfset i=i+1>
 
    </cfloop>
<cfelse>
<tr><td>extends:</td><td>
    <cfset parentStr = "">
    <cfloop index="i" from="1" to="#ArrayLen(ancestors)#">
        <cfif i neq 1>
            <cfset parentStr = parentStr & ",">
        </cfif>
        <cfset parentStr = parentStr & #GetLinkForType(ancestors[i].name, "LONG")#>
    </cfloop>
    <cfoutput>#parentStr#</cfoutput>
</cfif>
<cfoutput>
</td></tr>
<cfset numInterfaces = ArrayLen(interfaces)>
<cfif numInterfaces gt 0 >
    <tr>
        <td>Implements:</td>
        <td>
            <cfset tmpStr="">
            <cfloop index="i" from="1" to="#numInterfaces#">
                <cfif i neq 1>
                    <cfset tmpStr = tmpStr & ",">
                </cfif>
                <cfset tmpStr = tmpStr & #GetLinkForType(interfaces[i].name, "LONG")#>
            </cfloop>
            <cfoutput>#tmpStr#</cfoutput>
        </td>
    </tr>
</cfif>
<tr><td>path:</td>
    <td>#cd.path#</td>
</tr>
 
<tr><td>serializable:</td>
    <td><cfif StructKeyExists( cd, 'serializable' )>#YesNoFormat(cd.serializable)#
                <cfelse>Yes
            </cfif></td>
</tr>
</cfoutput>
 
 
 
<!--- DESCRIPTION --->
 
<cfoutput>
<cfif StructKeyExists(cd,"hint")><p>#cd.hint#</p></cfif>
 
<tr><td>properties:</td>
 
    <cfset list = ''>
    <cfloop list="#ListSort(StructKeyList(properties),'TEXTNOCASE')#" index="propName">
    <cfset list = listAppend(list, ' <a href="##property_#propName#">#propName#</a>')>
    </cfloop><br>
    <td>#list#</td>
</tr>
 
<tr><td>methods:</td>
 
    <cfset list = ''>
    <cfloop list="#ListSort(implementedMethodList,'TEXTNOCASE')#" index="methodName">
    <cfset curMethod = methods[methodName].metadata>
    <cfset item = ' <a href="##method_#methodName#">#methodName#</a>'>
    <cfif StructKeyExists( curMethod, 'access' ) and curMethod.access is 'private'>
        <cfset item = item & '*'>
    </cfif>
    <cfset list = ListAppend( list, item )>
    </cfloop>
    <td>#list#</td>
</tr>
<cfif ListLen(inheritedMethodList)>
<tr><td>inherited methods:</td>
    <cfset list = ''>
    <cfloop list="#ListSort(inheritedMethodList,'TEXTNOCASE')#" index="methodName">
    <cfset implementedIn = methods[methodName].implementedIn>
    <cfset list = ListAppend( list, ' ' & GetLinkForMethod( methodName, implementedIn ) )>
    </cfloop>
    <td>#list#</td>
</tr>
</cfif>
<cfif ListLen(baseMethodList)>
<tr><td>base methods:</td>
 
    <cfset list = ''>
    <cfloop list="#ListSort(baseMethodList,'TEXTNOCASE')#" index="methodName">
    <cfset implementedIn = methods[methodName].implementedIn>
    <cfset list = ListAppend( list, ' ' & GetLinkForMethod( methodName, implementedIn ) )>
    </cfloop>
    <td></td>
</tr>
</cfif>
 
<cfif StructKeyExists(cd,"documentation")>
    <cfif StructKeyExists( cd.documentation, "htmlSrc" )><tr><td>html document:</td><td><a href="#cd.documentation.htmlSrc#">#cd.documentation.htmlSrc#</a></td></tr></cfif>
    <cfif StructKeyExists( cd.documentation, "xmlSrc" )><tr><td>xml document:</td><td><a href="#cd.documentation.xmlSrc#">#cd.documentation.xmlSrc#</a></td></tr></cfif>
</cfif>
 
</table>
<font size="-2">* - private method</font>
</cfoutput>
 
<!--- PROPERTIES --->
<cfif StructCount(properties)>
<cfoutput>
<br><br><table>
<tr>
    <th>Property</th>
    <th>Hint</th>
    <th>Type</th>
    <th>Req.</th>
    <th>Implemented In</th>
    <th>Default Value</th>
    <th>Serializable</th>
</tr>
<cfloop list="#ListSort(StructKeyList(properties),'TEXTNOCASE')#" index="propName">
    <cfset prop = properties[propName].metadata>
    <cfset implementedIn = properties[propName].implementedIn>
    <tr>
        <td><a name="property_#prop.name#"><b>#prop.name#</b></a>
            <cfif StructKeyExists( prop, 'displayName' ) and prop.displayName neq prop.name>(#prop.displayName#)</cfif></td>
        <td><cfif StructKeyExists( prop, 'hint' )>#prop.hint#</cfif></td>
        <td><cfif StructKeyExists( prop, 'type' )>
                #GetLinkForType( prop.type, "SHORT" )#
            </cfif></td>
        <td><cfif StructKeyExists( prop, 'required' )>#YesNoFormat(prop.required)#</cfif></td>
        <td>#GetLinkForType( implementedIn, "SHORT" )#
        <!--- <cfif implementedIn eq cd.name><i>this</i><cfelse>
            <a href="#GetURLToViewer( implementedIn, '' )#">#GetShortComponentName(implementedIn,cd.name)#</a>
 
        </cfif> ---></td>
        <td><cfif StructKeyExists( prop, 'default')>
                <cfif IsSimpleValue(prop.default)>
                    #prop.default#
                <cfelse>
                    {complex value}
                </cfif>
            <cfelse>
                -
            </cfif></td>
            <td><cfif StructKeyExists( prop, 'serializable' )>#YesNoFormat(prop.serializable)#
                <cfelse>Yes
            </cfif></td>
        </tr>
</cfloop>
</table>
</cfoutput>
</cfif>
 
 
 
<!--- METHODS --->
 
<cfset colspan="1">
<cfoutput>
<br><br><table>
<!--- <tr><th colspan="#colspan#">Methods</th></tr> --->
<cfloop list="#ListSort( implementedMethodList,'TEXTNOCASE')#" index="methodName">
 
    <cfset method = methods[methodName].metadata>
 
    <!--- method header --->
 
    <tr><th align="left" colspan="#colspan#">
        <a name="method_#method.name#">#method.name#</a><cfif StructKeyExists( method, 'access' ) and method.access is 'private'>*</cfif>
        <cfif IsDefined('method.displayName') and method.displayName neq method.name>(#method.displayName#)</cfif>
        </th></tr>
    <tr><td>
 
    <!--- method syntax --->
 
    <code>
    <cfif StructKeyExists( method, "access" )>
        <i>#lcase(method.access)#</i>
    </cfif>
    <cfif StructKeyExists( method, "returnType" )>
        <i><cfif method.returnType is "VOID">void<cfelse>#GetLinkForType(method.returnType, "SHORT")#</cfif></i>
    </cfif>
    <b>#method.name#</b>
    <cfif IsDefined( "method.exceptions.types" ) and method.exceptions.types neq ""><i>throws</i> #method.exceptions.types#</cfif>
    (
     <cfloop index="j" from="1" to="#ArrayLen(method.parameters)#">
        <cfset param = method.parameters[j]>
        <i>
        <cfif IsDefined('param.required') and param.required>required</cfif>
        <cfif IsDefined('param.type')>#GetLinkForType(param.type, "SHORT")#</cfif>
        </i>
        #param.name#<cfif IsDefined('param.default')>="#param.default#"</cfif><cfif j neq ArrayLen(method.parameters)>,</cfif>
    </cfloop>
    )
    </i>
    </code>
    <br><br>
    <!--- method description --->
 
    <cfif IsDefined('method.hint') and method.hint neq "">#method.hint#<br><br></cfif>
    <cfif IsDefined( 'method.roles' ) and method.roles neq ''>Available only for users in one of the roles: #method.roles#<br></cfif>
 
    Output: <cfif !IsDefined( 'method.output' )>  <cfelseif method.output eq false>suppressed<cfelse>enabled</cfif><br>
 
    <!--- method parameters --->
    <cfif ArrayLen(method.parameters)>
        Parameters:<br>
        <cfloop index="j" from="1" to="#ArrayLen(method.parameters)#">
            <cfset param = method.parameters[j]>
            &nbsp;&nbsp; <b>#param.name#:</b>
            <cfif IsDefined('param.type')>#GetLinkForType(param.type, "SHORT")#,<cfelse>any,</cfif>
            <cfif IsDefined('param.required') and param.required>required,<cfelse>optional,</cfif>
            <cfif IsDefined('param.displayName')>#param.displayName#<cfelse>#param.name#</cfif>
            <cfif IsDefined('param.hint') and param.hint neq ''>- #param.hint#</cfif>
            <br>
        </cfloop>
 
    </cfif>
    <br>
    </td></tr>
 
</cfloop>
 
</table>
</cfoutput>
 
<cfoutput>
</body></html>
</cfoutput>