A
download webtop.cfc
Language: ColdFusion
License: CPL
LOC: 313
Project Info
FarCry CMS - Core(farcry_core)
Server: cvsdude
Type: svn
...core\trunk\packages\farcry\
   alterType.cfc
   audit.cfc
   cache.cfc
   category.cfc
   config.cfc
   email.cfc
   file.cfc
   form.cfc
   formtools.cfc
   fu.cfc
   genericAdmin.cfc
   geoLocator.cfc
   gregorianCalendar.cfc
   i18nUtil.cfc
   image.cfc
   imageUtilities.cfc
   javaRB.cfc
   jtidy.cfc
   locking.cfc
   objectadmin.cfc
   plpUtilities.cfc
   PrototypeTree.cfc
   rbJava.cfc
   reporting.cfc
   rss.cfc
   simpleImage.cfc
   stats.cfc
   sysinfo.cfc
   tmt_file_io.cfc
   tmt_zip.cfc
   tree.cfc
   typeadmin.cfc
   UrlUtility.cfc
   verity.cfc
   veritycf7.cfc
   versioning.cfc
   webtop.cfc
   WebtopMenu.cfc
   WebtopMenuitem.cfc
   WebtopRoot.cfc
   WebtopSection.cfc
   WebtopSubsection.cfc
   workflow.cfc
   zip.cfc

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
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
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
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
<!--- 
|| LEGAL ||
$Copyright: Daemon Pty Limited 1995-2006, http://www.daemon.com.au $
$License: Released Under the "Common Public License 1.0", http://www.opensource.org/licenses/cpl.php$ 

|| VERSION CONTROL ||
$Header: $
$Author: $
$Date: $
$Name: $
$Revision: $

|| DESCRIPTION || 
$Description: Webtop component. $

|| DEVELOPER ||
$Developer: Geoff Bowers (modius@daemon.com.au)$
--->
<cfcomponent>
<!--- TODO: remove REQUEST scope security reference --->

<cffunction name="init" access="public" output="false" returntype="any" hint="Initialise component with XML configs from core and custom admin.">
	<cfargument type="string" required="false" name="xWebtop" default="" hint="Webtop XML config file as a string.">
	<cfargument type="string" required="false" name="xCustomAdmin" default="" hint="Custom Admin XML config file as a string.">
	<cfset var xmlWebtop="">
	<cfset var xmlCustomAdmin="">
	<cfset var aXMLCustomAdmin= arrayNew(1) />
	<cfset var xmlpathfull="" />
	
	<cfif NOT len(arguments.xWebtop)>
		<cffile action="read" file="#application.path.core#/config/webtop.xml" variable="arguments.xWebtop">
	</cfif>
<!---	<cfif NOT len(arguments.xCustomAdmin) AND fileexists("#application.path.project#/customadmin/customadmin.xml")>
		<cffile action="read" file="#application.path.project#/customadmin/customadmin.xml" variable="arguments.xCustomAdmin">
	</cfif> --->

	<!--- parse XML and validate config files --->
	<cfset xmlWebTop=xmlParse(arguments.xWebtop)>


	<!--- If we have passed a custom admin in through arguments, add it as the first item in the custom admin XML array --->
	<cfif len(arguments.xCustomAdmin)>
		<cfset bResult = arrayAppend(aXMLCustomAdmin, xmlParse(arguments.xCustomAdmin)) />
	</cfif>
	
	<!--- If any custom admin xml files exist, we need to add them to our custom admin XML array --->
	<cfdirectory action="list" directory="#application.path.project#/customadmin" filter="*.xml" name="qCustomAdmin" />
	

	<cfif qCustomAdmin.RecordCount>
		
		<cfloop query="qCustomAdmin">
			<cffile action="read" file="#application.path.project#/customadmin/#qCustomAdmin.Name#" variable="arguments.xCustomAdmin">
			
			<cftry>
				<!--- validate custom admin xml --->
				<cfset xmlCustomAdmin=xmlParse(arguments.xCustomAdmin)>
				<cfif arraylen(xmlsearch(xmlCustomAdmin, "/customtabs"))>
					<!--- process old-style custom admin --->
					<cffile action="read" file="#application.path.core#/config/transform.xsl" variable="xslt">
					<!--- XSLT transform customadmin --->
					<cfset xmlCustomAdmin=xmlTransform(xmlCustomAdmin,xslt)>
					<cfset xmlCustomAdmin=xmlParse(xmlCustomAdmin)>
					<!--- log deprecated approach --->
					<cftrace type="warning" category="farcry.webtop" text="../customadmin/customadmin.xml is using an old format.  This was updated to a more modern format with the release of FarCry 2.4." />
					<cflog application="true" file="deprecated" type="warning" text="../customadmin/customadmin.xml initialised using an old xml format.  This was updated to a more modern format with the release of FarCry 2.4." />
				</cfif>
				
				<!--- add the xml to our array --->
				<cfset bResult = arrayAppend(aXMLCustomAdmin, xmlCustomAdmin) />
				
				<cfcatch>
					<cftrace type="warning" category="farcry.webtop" text="../customadmin/customadmin.xml was not parsed successfully." var="cfcatch.Detail" />
				</cfcatch>
			</cftry>
			
		</cfloop>
	</cfif>
		
		
	<cfif structKeyExists(application, "lFarcryLib") and listLen(application.lFarcryLib)>

		<cfloop list="#application.lFarcryLib#" index="library">
			
			<cfif directoryExists("#application.path.library#/#library#/customadmin")>
				<cfdirectory action="list" directory="#application.path.library#/#library#/customadmin" filter="*.xml" name="qCustomAdmin" />
	

				<cfif qCustomAdmin.RecordCount>
					
					<cfloop query="qCustomAdmin">
						<cfset xmlpathfull="#application.path.library#/#library#/customadmin/#qCustomAdmin.Name#" />
						<cffile action="read" file="#application.path.library#/#library#/customadmin/#qCustomAdmin.Name#" variable="arguments.xCustomAdmin">
						
						<cftry>
							<!--- validate custom admin xml --->
							<cfset xmlCustomAdmin=xmlParse(arguments.xCustomAdmin)>
							<cfif arraylen(xmlsearch(xmlCustomAdmin, "/customtabs"))>
								<!--- process old-style custom admin --->
								<cffile action="read" file="#application.path.core#/config/transform.xsl" variable="xslt">
								<!--- XSLT transform customadmin --->
								<cfset xmlCustomAdmin=xmlTransform(xmlCustomAdmin,xslt)>
								<cfset xmlCustomAdmin=xmlParse(xmlCustomAdmin)>
								<!--- log deprecated approach --->
								<cftrace type="warning" category="farcry.webtop" text="#xmlpathfull# is using an old format.  This was updated to a more modern format with the release of FarCry 2.4." />
								<cflog application="true" file="deprecated" type="warning" text="#xmlpathfull# initialised using an old xml format.  This was updated to a more modern format with the release of FarCry 2.4." />
							</cfif>
							
							<!--- add the xml to our array --->
							<cfset bResult = arrayAppend(aXMLCustomAdmin, xmlCustomAdmin) />
							
							<cfcatch>
								<cftrace type="warning" category="farcry.webtop" text="#xmlpathfull# was not parsed successfully." var="cfcatch.Detail" />
							</cfcatch>
						</cftry>
						
					</cfloop>
				</cfif>
			</cfif>
		</cfloop>
		
	</cfif>
			
	<cfif arrayLen(aXMLCustomAdmin)>
		
			
		<cfinvoke component="WebtopRoot" method="init" returnVariable="webtopRoot"> 
  			<cfinvokeargument name="WebtopXmlDoc" value="#xmlWebtop#"> 
		</cfinvoke> 
		
		
		<cfloop from="1" to="#arrayLen(aXMLCustomAdmin)#" index="i">

						
			<cfinvoke component="WebtopRoot" method="init" returnVariable="webtopCustom"> 
				<cfinvokeargument name="WebtopXmlDoc" value="#aXMLCustomAdmin[i]#"> 
			</cfinvoke> 
			
			
			
			<cfset webtopRoot.mergeRoot(webtopCustom)>  	
			
		</cfloop>
		
		
		<cfset xmlWebtop = webtopRoot.getXmlDoc()>
		
			
	</cfif>
	<cfset this.xmlwebtop=xmlWebtop>


<!---
	<!--- parse XML and validate config files --->
	<cfset xmlWebTop=xmlParse(arguments.xWebtop)>
	<cfif len(arguments.xcustomadmin)>
		
		<!--- validate custom admin xml --->
			<cfset xmlCustomAdmin=xmlParse(arguments.xCustomAdmin)>
			<cfif arraylen(xmlsearch(xmlCustomAdmin, "/customtabs"))>
				<!--- process old-style custom admin --->
				<cffile action="read" file="#application.path.core#/config/transform.xsl" variable="xslt">
				<!--- XSLT transform customadmin --->
				<cfset xmlCustomAdmin=xmlTransform(xmlCustomAdmin,xslt)>
				<cfset xmlCustomAdmin=xmlParse(xmlCustomAdmin)>
				<!--- log deprecated approach --->
				<cftrace type="warning" category="farcry.webtop" text="../customadmin/customadmin.xml is using an old format.  This was updated to a more modern format with the release of FarCry 2.4." />
				<cflog application="true" file="deprecated" type="warning" text="../customadmin/customadmin.xml initialised using an old xml format.  This was updated to a more modern format with the release of FarCry 2.4." />
			</cfif>

	</cfif>
	
	<!--- merge xml documents--->
	<cfif len(xmlCustomAdmin)>
		<cfinvoke component="WebtopRoot" method="init" returnVariable="webtopRoot1"> 
  			<cfinvokeargument name="WebtopXmlDoc" value="#xmlWebtop#"> 
		</cfinvoke> 

		<cfinvoke component="WebtopRoot" method="init" returnVariable="webtopRoot2"> 
			<cfinvokeargument name="WebtopXmlDoc" value="#xmlCustomAdmin#"> 
		</cfinvoke> 

		<cfset webtopRoot1.mergeRoot(webtopRoot2)> 
		<cfset xmlWebtop = webtopRoot1.getXmlDoc()> 		
	</cfif> 
	
	<cfset this.xmlwebtop=xmlWebtop>
	 --->
	
	<cfreturn this>
</cffunction>

<cffunction name="getsubsectionasarray" access="public" output="false" returntype="array" hint="Return a single index array of the subsection detail.">
	<cfargument name="section" required="false" default="">
	<cfargument name="subsection" required="false" default="">
	<cfset var aSubectionToDisplay=arraynew(1)>
	
	<!--- get subsection directly, if no section (might get multiples if subsection ids not unique) --->
	<cfif NOT len(arguments.section) AND len(arguments.subsection)>
		<cfset aSubectionToDisplay=xmlSearch(this.xmlWebTop,"//subsection[@id='#arguments.subsection#']")>
		<cfdump var="#aSubectionToDisplay#">
		<cfabort>
	</cfif>
	
	<!--- get subsection by exact match --->
	<cfif len(arguments.section) AND len(arguments.subsection)>
		<cfset aSubectionToDisplay=xmlSearch(this.xmlWebTop,"//section[@id='#arguments.section#']/subsection[@id='#arguments.subsection#']")>
	</cfif>
	
	<!--- if subsection can't be determined default to first subsection --->
	<cfif arrayisempty(aSubectionToDisplay) AND len(arguments.section)>
		<cfset aSubectionToDisplay=xmlSearch(this.xmlWebTop,"//section[@id='#arguments.section#']/subsection[1]")>
	</cfif>

	<!--- if all else fails try first section & subsection --->
	<cfif arrayisempty(aSubectionToDisplay)>
		<cfset aSubectionToDisplay=xmlSearch(this.xmlWebTop,"//section[1]/subsection[1]")>
	</cfif>
	
	<cfreturn aSubectionToDisplay>
</cffunction>

<cffunction name="getSectionsAsArray" access="public" output="false" returntype="array" hint="Return an array of webtop sections, filtered by user permission set.">
	<!--- determine available section tabs --->
	<cfset var aSections=this.xmlWebtop.webtop.XMLChildren>
	<cfset var lsections="">
	<cfset var i=0>
	
	<cfloop from="1" to="#arraylen(aSections)#" index="i">
	<cfscript>
		//if there is a permission, then check it exists
		if(structKeyExists(aSections[i].xmlAttributes,"permission")) {
			if (NOT request.dmSec.oAuthorisation.checkPermission(permissionname=aSections[i].xmlAttributes.permission,reference='policyGroup'))
				// remove section if permission not available
				lSections="#i#,#lsections#";
		} 
	</cfscript>
	</cfloop>
	<!--- reverse loop to make sure we can delete relevant array position --->
	<cfloop list="#lSections#" index="i">
		<cfset arrayDeleteAt(aSections,i)>
	</cfloop>
	<cfreturn aSections>
</cffunction>

<cffunction name="getSubSectionsAsArray" access="public" output="true" returntype="array" hint="Return an array of webtop sub-sections, filtered by user permission set.">
	<cfargument name="section" required="false" type="string" default="">
	<cfargument name="subsection" required="false" type="string" default="">
	<!--- determine available section tabs --->
	<cfset var aSubSections=arraynew(1)>
	<cfset var lsubsections="">
	<cfset var i=0>
	
	<cfif len(arguments.section)>
		<!--- determine by section --->
		<cfset aSubSections=xmlSearch(this.xmlWebTop,"//section[@id='#arguments.section#']/subsection")>
	<cfelse>
		<!--- determine by subsection, getting preceding siblings, self and following siblings --->
		<cfset aSubSections=xmlSearch(this.xmlWebTop,"//subsection[@id='#arguments.subsection#']/preceding-sibling::*|//subsection[@id='#arguments.subsection#']|//subsection[@id='#arguments.subsection#']/following-sibling::*")>
	</cfif>
	
	<cfloop from="1" to="#arraylen(aSubSections)#" index="i">
	<cfscript>
		//if there is a permission, then check it exists
		if(structKeyExists(aSubSections[i].xmlAttributes,"permission")) {
			if (NOT request.dmSec.oAuthorisation.checkPermission(permissionname=aSubSections[i].xmlAttributes.permission,reference='policyGroup'))
				// remove section if permission not available
				lSubSections="#i#,#lSubsections#";
		} 
	</cfscript>
	</cfloop>
	<!--- reverse loop to make sure we can delete relevant array position --->
	<cfloop list="#lSubSections#" index="i">
		<cfset arrayDeleteAt(aSubSections,i)>
	</cfloop>
	<cfreturn aSubSections>
</cffunction>
<cffunction name="fTranslateXMLElement" hint="Translate the XmlText based on whether the to evaluate XmlAttributes.label (XmlAttributes.labelEvaluate = True)">
	<cfargument name="xmlElement" required="true" type="any">

	<!--- local variables --->
	<cfset var xElement = arguments.xmlElement>
	<cfset var stLocal = StructNew()>
	<!--- translate the xmlattributes --->

	<cfif StructKeyExists(xElement.xmlAttributes,"labelType")>
		<cftry>						
			<cfswitch expression="#xElement.xmlAttributes.labelType#">
				<cfcase value="evaluate">
					<!--- evaluate --->
					<cfset xElement.xmlAttributes.label = Evaluate(xElement.xmlAttributes.label)>
				</cfcase>
	
				<cfcase value="expression">
					<!--- expressions --->			
					<cfset xElement.xmlAttributes.label = Evaluate(xElement.xmlAttributes.label)>
				</cfcase>

				<cfcase value="text">
					<!--- text --->			
					<cfset xElement.xmlAttributes.label = xElement.xmlAttributes.label>
				</cfcase>
								
				<cfdefaultcase>

				</cfdefaultcase>
			</cfswitch>
			
			<cfcatch type="any">
				<cfset xElement.xmlAttributes.label = "<font color='red'>#xElement.xmlAttributes.label#</font>">
			</cfcatch>
		</cftry>
	<cfelse>
		<cfif NOT StructKeyExists(xElement.xmlAttributes,"label")>
			<cfif StructKeyExists(xElement,"xmlText")>
				<cfset xElement.xmlAttributes.label = xElement.xmlText>
			<cfelse>
				<cfset xElement.xmlAttributes.label = "[Add Label]">
			</cfif>
		</cfif>
	</cfif>

	<cfloop index="stLocal.i" from="1" to="#ArrayLen(xElement.xmlChildren)#">
		<cfset fTranslateXMLElement(xElement.xmlChildren[stLocal.i])>
	</cfloop>
</cffunction>

<!--- this function is specifically written for /farcry_core/admin/index.cfm
      ~line 56.
      Call like: sidebar=oWebTop.getSidebarUrl(aSubsectionToDisplay[1].xmlattributes) 
      author: Tyler Ham (tylerh@austin.utexas.edu) 
      date: 2005-10-05 --->
<cffunction name="getSidebarUrl" access="public" output="false" returntype="string" hint="takes a struct of the xmlattributes of a subsection, returns the string of a url to use for the sidebar.">
	<cfargument name="stXmlAttributes" type="Struct" required="true">
	<cfset var sReturn = "custom/sidebar.cfm">  <!--- this seems like a good default url --->
	<cfset var urlUtil = "">
	<cfset var stParams = StructNew()>

	<cfobject component="UrlUtility" name="urlUtil">
	
	<!--- if the 'sidebar' attribute exists, make it the base url --->
	<cfif StructKeyExists(arguments.stXmlAttributes, "sidebar")>
		<cfset sReturn = arguments.stXmlAttributes.sidebar>
	</cfif>
	
	<!--- add anything in our query_string to the url params --->
	<!--- getUrlParamStruct looks for the '?' --->
	<cfset stParams = urlUtil.getURLParamStruct("?" & CGI.QUERY_STRING)>
	
	<!--- if 'id' attribute exists, REPLACE any 'sub' url param with this value --->
	<cfif StructKeyExists(arguments.stXmlAttributes, "id")>
		<cfset stParams.sub = arguments.stXmlAttributes.id>
	</cfif>
	
	<!--- generate the sidebar url by appending the params we've accumulated --->
	<cfset sReturn = urlUtil.appendURLParams(address=sReturn, paramStruct=stParams, replaceExisting=false)>
	
	<cfreturn sReturn>
</cffunction>

<!--- this function is specifically written for /farcry_core/admin/index.cfm
      ~line 57
      Call like: content=oWebTop.getContentUrl(aSubsectionToDisplay[1].xmlattributes)
      author: Tyler Ham (tylerh@austin.utexas.edu)
      date: 2005-10-05 --->
<cffunction name="getContentUrl" access="public" output="false" returntype="string" hint="takes a struct of the xmlattributes of a subsection, returns the string of a url to use for the content pane.">
	<cfargument name="stXmlAttributes" type="Struct" required="true">
	
	<cfset var sReturn = "inc/content.html"> <!--- this seems like a good default url --->
	<cfset var urlUtil = "">
	<cfset var stParams = StructNew()>
	
	<cfobject component="UrlUtility" name="urlUtil">
	
	<!--- if the 'content' attribute exists, make it the base url --->
	<cfif StructKeyExists(arguments.stXmlAttributes, "content")>
		<cfset sReturn = arguments.stXmlAttributes.content>
	</cfif>
	
	<!--- add anything in our query_string to the url params --->
	<!--- getUrlParamStruct looks for the '?' --->
	<cfset stParams = urlUtil.getUrlParamStruct("?" & CGI.QUERY_STRING)>
	
	<!--- generate the sidebar url by appending the params we've accumulated --->
	<cfset sReturn = urlUtil.appendURLParams(address=sReturn, paramStruct=stParams, replaceExisting=false)>
	
	<cfreturn sReturn>
</cffunction>

<cfscript>
/**
 * Merges one xml document into another
 * 
 * @param xml1 	 The XML object into which you want to merge (Required)
 * @param xml2 	 The XML object from which you want to merge (Required)
 * @param overwriteNodes 	 Boolean value for whether you want to overwrite (default is true) (Optional)
 * @return void (changes the first XML object) 
 * @author Nathan Dintenfass (nathan@changemedia.com) 
 * @version 1, November 2, 2003 
 */
function xmlMerge(xml1,xml2){
	var readNodeParent = arguments.xml2;
	var writeNodeList = arguments.xml1;
	var writeNodeDoc = arguments.xml1;
	var readNodeList = "";
	var writeNode = "";
	var readNode = "";
	var nodeName = "";
	var ii = 0;
	var writeNodeOffset = 0;
	var toAppend = 0;
	var nodesDone = structNew();
	//by default, overwrite nodes
	var overwriteNodes = true;
	//if there's a 3rd arguments, that's the overWriteNodes flag
	if(structCount(arguments) GT 2)
		overwriteNodes = arguments[3];
	//if there's a 4th argument, it's the DOC of the writeNode -- not a user provided argument -- just used when doing recursion, so we know the original XMLDoc object
	if(structCount(arguments) GT 3)
		writeNodeDoc = arguments[4];
	//if we are looking at the whole document, get the root element
	if(isXMLDoc(arguments.xml2))
		readNodeParent = arguments.xml2.xmlRoot;
	//if we are looking at the whole Doc for the first element, get the root element
	if(isXMLDoc(arguments.xml1))
		writeNodeList = arguments.xml1.xmlRoot;	
	//loop through the readNodeParent (recursively) and override all xmlAttributes/xmlText in the first document with those of elements that match in the second document
	for(nodeName in readNodeParent){
		writeNodeOffset = 0;
		//if we haven't yet dealt with nodes of this name, do it
		if(NOT structKeyExists(nodesDone,nodeName)){
			readNodeList = readNodeParent[nodeName];
			//if there aren't any of this node, we need to append however many there are
			if(NOT structKeyExists(writeNodeList,nodeName)){
				toAppend = arrayLen(readNodeList);
			}
			//if there are already at least one node of this name
			else{
				//if we are overwriting nodes, we need to append however many there are minus however many there were (if there none new, it will be 0)
				if(overWriteNodes){
					toAppend = arrayLen(readNodeList) - arrayLen(writeNodeList[nodeName]);
				}
				//if we are not overwriting, we need to add however many there are
				else{
					toAppend = arrayLen(readNodeList);
					//if we are not overwriting, we need to make the offset of the writeNode equal to however many there already are
					writeNodeOffset = arrayLen(writeNodeList[nodeName]);
				}
			}
			//append however many nodes necessary of the name
			for(ii = 1;  ii LTE toAppend; ii = ii + 1){
				arrayAppend(writeNodeList.xmlChildren,xmlElemNew(writeNodeDoc,nodeName));
			}
			//loop through however many of this nodeName there are, writing them to the writeNodes
			for(ii = 1; ii LTE arrayLen(readNodeList); ii = ii + 1){
				writeNode = writeNodeList[nodeName][ii + writeNodeOffset];
				readNode = readNodeList[ii];
				//set the xmlAttributes and xmlText to this child's values
				writeNode.xmlAttributes = readNode.xmlAttributes;
				writeNode.xmlText = readNode.xmlText;
				//if this element has any children, recurse
				if(arrayLen(readNode.xmlChildren)){
					xmlMerge(writeNode,readNode,overwriteNodes,writeNodeDoc);
				}
			}
			//add this node name to those nodes we have done -- we need to do this because an XMLDoc object can have duplicate keys
			nodesDone[nodeName] = true;
		}
	}
}
</cfscript>

</cfcomponent>

About Koders | Resources | Downloads | Support | Black Duck | Terms of Service | DMCA | Privacy Policy | Contact Us