Project

General

Profile

1
<!doctype html public "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
2
<html>
3
<head>
4
<title>
5
<a href='http://mapbuilder.sourceforge.net'>Community Map Builder</a> 27 Apr 2008 Overview
6
</title>
7
<link rel ="stylesheet" type="text/css" href="stylesheet.css" title="Style">
8
<script>
9
function asd() {
10
	
11
		parent.document.title="Caps2Context.js Overview";
12
	
13
}
14
</script>
15
</head>
16
<body bgcolor="white" onload="asd();">
17

    
18
<!-- ========== START OF NAVBAR ========== -->
19
<a name="navbar_top"><!-- --></a>
20
<table border="0" width="100%" cellpadding="1" cellspacing="0">
21
<tr>
22
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
23
<a name="navbar_top_firstrow"><!-- --></a>
24
<table border="0" cellpadding="0" cellspacing="3">
25
  <tr align="center" valign="top">
26
  
27
  
28
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
29
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
30
  
31

    
32
  <td bgcolor="#FFFFFF" class="NavBarCell1"> 	<font class="NavBarFont1">Class</font>&nbsp;</td>
33
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
34
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
35
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
36
  </tr>
37
</table>
38
</td>
39
<td bgcolor="#EEEEFF" align="right" valign="top">
40
<em>
41
<b><a href='http://mapbuilder.sourceforge.net'>Community Map Builder</a> 27 Apr 2008</b></em>
42
</td>
43
</tr>
44

    
45
<tr>
46
<td bgcolor="white" class="NavBarCell2"><font size="-2">
47
&nbsp;PREV&nbsp;
48
&nbsp;NEXT</font></td>
49
<td bgcolor="white" class="NavBarCell2"><font size="-2">
50
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
51
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
52
&nbsp;&nbsp;
53
<script>
54
  <!--
55
  if(window==top) {
56
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
57
  }
58
  //-->
59
</script>
60
<noscript>
61
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
62
</noscript>
63
</font></td>
64
</tr>
65
</table>
66
<!-- =========== END OF NAVBAR =========== -->
67

    
68
<hr>
69
<center>
70
	
71
	   <h2>Caps2Context.js</h2>
72
	
73
</center>
74

    
75
	
76

    
77

    
78
<h4>Summary</h4>
79
<p>
80
	
81
		No overview generated for 'Caps2Context.js'<BR/><BR/>
82
	
83
</p>
84

    
85
<hr>
86

    
87

    
88
    <table border="1" cellpadding="3" cellspacing="0" width="100%">
89
    <tr bgcolor="#CCCCFF" class="TableHeadingColor">
90
    <td colspan=2><font size="+2">
91
    
92
        <b>Class Summary</b>
93
    
94
    </font></td>
95
    </tr>
96
    
97
    <tr bgcolor="white" class="TableRowColor">
98
    <td width="15%"><b><a href="Caps2Context.html">Caps2Context</a></b></td>
99
    <td>&nbsp;</td>
100
    </tr>
101
    
102
    </table>
103
    <hr/> 
104

    
105

    
106
<!-- ========== METHOD SUMMARY =========== -->
107

    
108
<!-- ========== END METHOD SUMMARY =========== -->
109

    
110

    
111
        <pre class="sourceview"><span class="comment">/*
112
Author:   
113
License:      LGPL as per: http://www.gnu.org/copyleft/lesser.html
114

    
115
$Id: Caps2Context.js 3881 2008-02-27 15:41:07Z gjvoosten $
116
*/</span>
117
<span class="comment">
118
// Ensure this object's dependancies are loaded.</span>
119
mapbuilder.loadScript(baseDir+<span class="literal">"/tool/ToolBase.js"</span>);
120

    
121
<span class="comment">/**
122

    
123
 * Build a Web Map Context (WMC) from a Web Map Server getCapabilities response.
124

    
125
 * This tool will replace the identified targetModel as opposed to editing
126

    
127
 * the target model which the EditContext tool will do. 
128

    
129
 * <span class="attrib">@constructor</span>
130

    
131
 * <span class="attrib">@base</span> ToolBase
132

    
133
 * <span class="attrib">@param</span> toolNode The tools's XML object node from the configuration document.
134

    
135
 * <span class="attrib">@param</span> model    The model that this tool belongs to
136

    
137
 */</span>
138

    
139
<span class="reserved">function</span> Caps2Context(toolNode, model) {
140

    
141
  ToolBase.apply(<span class="reserved">this</span>, new Array(toolNode, model));
142

    
143
  
144

    
145
  var styleUrl = baseDir+<span class="literal">"/tool/xsl/Caps2Context.xsl"</span>;
146

    
147
  <span class="reserved">this</span>.stylesheet = new XslProcessor(styleUrl,model.namespace);
148
<span class="comment">
149

    
150

    
151
  // Set stylesheet parameters for all the child nodes from the config file</span>
152

    
153
  <span class="reserved">for</span> (var j=0;j&lt;toolNode.childNodes.length;j++) {
154

    
155
    <span class="reserved">if</span> (getNodeValue(toolNode.childNodes[j])) {
156

    
157
      <span class="reserved">this</span>.stylesheet.setParameter(toolNode.childNodes[j].nodeName,getNodeValue(toolNode.childNodes[j]));
158

    
159
    }
160

    
161
  }
162

    
163

    
164

    
165
  <span class="comment">/**
166

    
167
   * Listener function which does the transformation and loads the target model
168

    
169
   * <span class="attrib">@param</span> requestName the name of the web service operation to execute
170

    
171
   * <span class="attrib">@param</span> featureNodeId the id of the node in the doc to be processed by the stylesheet
172

    
173
   */</span>
174

    
175
  <span class="reserved">this</span>.mapAllLayers = <span class="reserved">function</span>(objRef) {
176

    
177
    objRef.stylesheet.setParameter(<span class="literal">"selectedLayer"</span>,<span class="literal">''</span>);
178

    
179
    var newContext = objRef.stylesheet.transformNodeToObject(objRef.model.doc);
180

    
181
    objRef.targetModel.setParam(<span class="literal">"newModel"</span>, null);
182

    
183
    objRef.targetModel.url = <span class="literal">''</span>;
184

    
185
    objRef.targetModel.doc = newContext;
186

    
187
    objRef.targetModel.finishLoading();
188

    
189
  }
190

    
191
  <span class="reserved">this</span>.model.addListener(<span class="literal">"mapAllLayers"</span>, <span class="reserved">this</span>.mapAllLayers, <span class="reserved">this</span>);
192

    
193

    
194

    
195
  <span class="comment">/**
196

    
197
   * Listener function which does the transformation and loads the target model.
198

    
199
   * this wersion will convert a single layer from the Capabilities doc into a
200

    
201
   * context doc.
202

    
203
   * <span class="attrib">@param</span> requestName the name of the web service operation to execute
204

    
205
   * <span class="attrib">@param</span> featureNodeId the id of the node in the doc to be processed by the stylesheet
206

    
207
   */</span>
208

    
209
  <span class="reserved">this</span>.mapSingleLayer = <span class="reserved">function</span>(objRef, layerName) {
210

    
211
    objRef.stylesheet.setParameter(<span class="literal">"selectedLayer"</span>,layerName);
212

    
213
    var newContext = objRef.stylesheet.transformNodeToObject(objRef.model.doc);
214

    
215
    objRef.targetModel.setParam(<span class="literal">"newModel"</span>, null);
216

    
217
    objRef.targetModel.url = <span class="literal">''</span>;
218

    
219
    objRef.targetModel.doc = newContext;
220

    
221
    objRef.targetModel.finishLoading();
222

    
223
  }
224

    
225
  <span class="reserved">this</span>.model.addListener(<span class="literal">"mapLayer"</span>, <span class="reserved">this</span>.mapSingleLayer, <span class="reserved">this</span>);
226

    
227

    
228

    
229
}
230

    
231
</pre>
232
	<hr>
233

    
234

    
235

    
236
<!-- ========== START OF NAVBAR ========== -->
237
<a name="navbar_top"><!-- --></a>
238
<table border="0" width="100%" cellpadding="1" cellspacing="0">
239
<tr>
240
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
241
<a name="navbar_top_firstrow"><!-- --></a>
242
<table border="0" cellpadding="0" cellspacing="3">
243
  <tr align="center" valign="top">
244
  
245
  
246
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
247
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
248
  
249

    
250
  <td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font>&nbsp;</td>
251
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
252
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
253
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
254
  </tr>
255
</table>
256
</td>
257
<td bgcolor="#EEEEFF" align="right" valign="top"><em>
258
<b><a href='http://mapbuilder.sourceforge.net'>Community Map Builder</a> 27 Apr 2008</b></em>
259
</td>
260
</tr>
261

    
262
<tr>
263
<td bgcolor="white" class="NavBarCell2"><font size="-2">
264
&nbsp;PREV&nbsp;
265
&nbsp;NEXT</font></td>
266
<td bgcolor="white" class="NavBarCell2"><font size="-2">
267
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
268
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
269
&nbsp;&nbsp;
270
<script>
271
  <!--
272
  if(window==top) {
273
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
274
  }
275
  //-->
276
</script>
277
<noscript>
278
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
279
</noscript>
280
</font></td>
281
</tr>
282
</table>
283
<!-- =========== END OF NAVBAR =========== -->
284

    
285
<hr>
286
<font size="-1">
287

    
288
</font>
289
<div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/" target="_parent">JSDoc</a> on Sun Apr 27 20:30:54 2008</div>
290
</body>
291
</html>
(220-220/316)