This repository has been archived by the owner on Feb 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLibrary.xml
69 lines (69 loc) · 2.59 KB
/
Library.xml
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
<codeTemplateLibrary version="3.4.0">
<id>7dbca90c-a008-46e8-bb2d-0562d61868e5</id>
<name>Library 1</name>
<revision>5</revision>
<lastModified>
<time>1486073430132</time>
<timezone>America/New_York</timezone>
</lastModified>
<description></description>
<includeNewChannels>false</includeNewChannels>
<enabledChannelIds>
<string>fdd39025-12ee-4398-9d81-a80470181582</string>
</enabledChannelIds>
<disabledChannelIds/>
<codeTemplates>
<codeTemplate version="3.4.0">
<id>6758f0cc-1618-4c7a-b3fe-3d1ae4b40246</id>
<name>Result Set to XML</name>
<revision>1</revision>
<lastModified>
<time>1463763329672</time>
<timezone>America/New_York</timezone>
</lastModified>
<type>FUNCTION</type>
<contextSet>
<delegate>
<contextType>DESTINATION_DISPATCHER</contextType>
<contextType>CHANNEL_ATTACHMENT</contextType>
<contextType>CHANNEL_DEPLOY</contextType>
<contextType>GLOBAL_DEPLOY</contextType>
<contextType>GLOBAL_UNDEPLOY</contextType>
<contextType>CHANNEL_BATCH</contextType>
<contextType>CHANNEL_PREPROCESSOR</contextType>
<contextType>SOURCE_RECEIVER</contextType>
<contextType>DESTINATION_FILTER_TRANSFORMER</contextType>
<contextType>CHANNEL_UNDEPLOY</contextType>
<contextType>CHANNEL_POSTPROCESSOR</contextType>
<contextType>DESTINATION_RESPONSE_TRANSFORMER</contextType>
<contextType>GLOBAL_POSTPROCESSOR</contextType>
<contextType>GLOBAL_PREPROCESSOR</contextType>
<contextType>SOURCE_FILTER_TRANSFORMER</contextType>
</delegate>
</contextSet>
<code>
/**
* Converts a java.sql.ResultSet to an XML representation. The XML will have elements named after the
* column names, and the values of those XML elements will be the column values
*
* Convert a database row to an xml document.
*
* @param rs the ResultSet instance
* @param xmlElement a string containing the document level xml element to use for the XML document
* @param aliases a map of renamed columns, actual -> desired
*/
function resultSetToXml(rs, xmlElement, aliases) {
var result = new XML(xmlElement);
var rsmd = rs.getMetaData();
for (var i = 1; i <= rsmd.getColumnCount(); i++) {
var value = rs.getString(i);
if (value !== undefined && value !== null) {
var column = rsmd.getColumnName(i).toLowerCase();
result[aliases[column] || column] = value;
}
}
return result;
}</code>
</codeTemplate>
</codeTemplates>
</codeTemplateLibrary>