Project

General

Profile

1
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
2
<%@ taglib uri="/tags/struts-html" prefix="html" %>
3
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
4

    
5
<%
6
//This file contains some ugly JSP code.
7
//Be wary, ye who brave the dragon's lair.
8
%>
9

    
10
<% try { %>
11
<html:form action="/config/data/typeEditorSubmit">
12
  <table class="info">
13
	<tr>
14
      <td class="label">
15
		<span class="help" title="<bean:message key="help.type.name"/>">
16
          <bean:message key="label.name"/>:
17
        </span>
18
      </td>
19
      <td class="datum">
20
		<bean:write name="typesEditorForm" property="typeName"/>
21
      </td>
22
    </tr>
23
	<tr>
24
      <td class="label">
25
		<span class="help" title="<bean:message key="help.wms.path"/>">
26
          <bean:message key="label.wms.path"/>:
27
        </span>
28
	  </td>
29
	  <td class="datum">
30
		<html:text property="wmsPath" size="60"/>
31
	  </td>
32
	</tr>
33
	<tr>
34
      <td class="label">
35
		<span class="help" title="<bean:message key="help.type.style"/>">
36
          <bean:message key="label.style"/>:
37
        </span>
38
      </td>
39
      <td class="datum">
40
        <html:select property="styleId">
41
          <html:options property="styles"/>
42
        </html:select> 
43
        <html:submit property="action">
44
          <bean:message key="config.data.sldWizard.label"/>
45
        </html:submit><br>
46
      </td>
47
    </tr>    
48
	<tr>
49
      <td class="label">
50
		<span class="help" title="<bean:message key="help.type.srs"/>">
51
          <bean:message key="label.SRS"/>:
52
        </span>
53
      </td>
54
	  <td class="datum">
55
	  <table>
56
	  <tr>
57
	  <td>
58
		<html:text property="SRS" size="32"/>
59
		</td>
60
		<td>
61
		      <a href="<bean:message key="label.SRSHelp.URL"/>">
62
              <bean:message key="label.SRSHelp"/>
63
            </a>
64
        </td>
65
        <td>
66
        &nbsp;-&nbsp;
67
        <a href="<%=org.vfny.geoserver.util.Requests.getBaseUrl(request)%>srsHelp.do">
68
              <bean:message key="label.SRSList"/>
69
            </a>
70
        </td>
71
        </tr>
72
        </table>
73
	</td></tr>
74
	<!------------------------->
75
	<!------ This puts in the SRS WKT definition --->
76
	
77
	<tr>
78
	<td class="label">
79
		<span class="help" title="<bean:message key="help.type.srswkt"/>">
80
          <bean:message key="label.type.srswkt"/>:
81
        </span>
82
	  </td>
83
	  <td class="greyedOut2">
84
              <bean:write name="typesEditorForm" property="SRSWKT"/>
85
            </td>
86
	</tr>
87
	
88
	
89
	<!-------------------------->
90

    
91
    <tr>
92
      <td class="label">
93
		<span class="help" title="<bean:message key="help.type.title"/>">
94
          <bean:message key="label.title"/>:
95
        </span>
96
	  </td>
97
	  <td class="datum">
98
		<html:text property="title" size="60"/>
99
	  </td>
100
	</tr>
101

    
102
    <tr>
103
      <td class="label">
104
		<span class="help" title="<bean:message key="help.type.bbox"/>">
105
          <bean:message key="label.bbox"/>:          
106
        </span>
107
	  </td>
108
	  <td class="datum">
109
        <html:submit property="action">
110
          <bean:message key="config.data.calculateBoundingBox.label"/>
111
        </html:submit><br/>
112
        
113
      <!-------------------------------------------------------------->
114
      <!----- This will add the bounding box of the data (in its CRS) to the page --->
115
      <!----- Its only added if its actually been calculated (i.e. they presed the generate bbox button) --->
116

    
117
<logic:notEmpty name="typesEditorForm"  property="dataMinX">
118
        <table border=0 width=90%>
119
          <tr>
120
            <td class="greyedOut">
121
              <span class="help" title="<bean:message key="help.type.dataminx"/>">
122
                <bean:message key="label.type.dataminx"/>:
123
              </span>
124
            </td>
125
            <td class="greyedOut">
126
              <bean:write name="typesEditorForm" property="dataMinX"/>
127
            </td>
128
            <td class="greyedOut">
129
              <span class="help" title="<bean:message key="help.type.dataminy"/>">
130
                <bean:message key="label.type.dataminy"/>:
131
              </span>
132
            </td>
133
            <td class="greyedOut">
134
              <bean:write name="typesEditorForm" property="dataMinY"/>
135
            </td>
136
          </tr>
137
          <tr>
138
            <td class="greyedOut">
139
              <span class="help" title="<bean:message key="help.type.datamaxx"/>">
140
                <bean:message key="label.type.datamaxx"/>:
141
              </span>
142
            </td>
143
            <td class="greyedOut">
144
             <bean:write name="typesEditorForm" property="dataMaxX"/>
145
            </td>
146
            <td class="greyedOut">
147
              <span class="help" title="<bean:message key="help.type.datamaxy"/>">
148
                <bean:message key="label.type.datamaxy"/>:
149
              </span>
150
            </td>
151
            <td class="greyedOut">
152
             <bean:write name="typesEditorForm" property="dataMaxY"/>
153
            </td>
154
          </tr>
155
        </table>
156
        
157
</logic:notEmpty>        
158
<!-------------------------------------------------------------->
159
        
160
        
161
        <table border=0>
162
          <tr>
163
            <td style="white-space: nowrap;">
164
              <span class="help" title="<bean:message key="help.type.minx"/>">
165
                <bean:message key="label.type.minx"/>:
166
              </span>
167
            </td>
168
            <td>
169
              <html:text property="minX" size="15"/>
170
            </td>
171
            <td style="white-space: nowrap;">
172
              <span class="help" title="<bean:message key="help.type.miny"/>">
173
                <bean:message key="label.type.miny"/>:
174
              </span>
175
            </td>
176
            <td>
177
              <html:text property="minY" size="15"/>
178
            </td>
179
          </tr>
180
          <tr>
181
            <td style="white-space: nowrap;">
182
              <span class="help" title="<bean:message key="help.type.maxx"/>">
183
                <bean:message key="label.type.maxx"/>:
184
              </span>
185
            </td>
186
            <td>
187
              <html:text property="maxX" size="15"/>
188
            </td>
189
            <td style="white-space: nowrap;">
190
              <span class="help" title="<bean:message key="help.type.maxy"/>">
191
                <bean:message key="label.type.maxy"/>:
192
              </span>
193
            </td>
194
            <td>
195
              <html:text property="maxY" size="15"/>
196
            </td>
197
          </tr>
198
        </table>
199
	  </td>
200
    </tr>
201

    
202
    <tr>
203
      <td class="label">
204
		<span class="help" title="<bean:message key="help.dataFeatureTypeKeywords"/>">
205
			<bean:message key="label.keywords"/>:
206
		</span>
207
	  </td>
208
	  <td class="datum">
209
		<html:textarea property="keywords" cols="60" rows="2"/>
210
	  </td>
211
    </tr>
212

    
213
    <tr>
214
      <td class="label">
215
		<span class="help" title="<bean:message key="help.dataFeatureTypeAbstract"/>">
216
			<bean:message key="label.abstract"/>:
217
		</span>
218
	  </td>
219
	  <td class="datum">
220
		<html:textarea property="abstract" cols="60" rows="3"/>
221
      </td>
222
    </tr>
223
    
224
    <tr>
225
	    <td class="label">
226
    		<span class="help" title="<bean:message key="help.type.cachingEnabled" />">
227
    			<bean:message key="label.cachingEnabled" />:
228
    		</span>
229
    	</td>
230
    	<td class="datum">
231
    		<html:checkbox property="cachingEnabled" />
232
    	</td>
233
    </tr>
234
    
235
    <tr>
236
    	<td class="label">
237
    		<span class="help" title="<bean:message key="help.type.cacheMaxAge" />">
238
    			<bean:message key="label.cacheMaxAge" />:
239
    		</span>
240
    	</td>
241
    	<td class="datum">
242
    		<html:text property="cacheMaxAge" size="10" />
243
    	</td>
244
    </tr>
245

    
246
    <tr>
247
      <td class="label">
248
		<span class="help" title="<bean:message key="help.type.base"/>">
249
			<bean:message key="label.base"/>:
250
		</span>
251
	  </td>
252
	  <td class="datum">
253
		<html:select property="schemaBase">
254
			<html:options property="allYourBase"/>
255
		</html:select>
256
		<html:submit property="action">
257
			<bean:message key="label.change"/>
258
		</html:submit>
259
      </td>
260
    </tr>
261

    
262
  <% boolean first = true;
263
     org.vfny.geoserver.form.data.AttributeDisplay attributeDisplay = null;;
264
     org.vfny.geoserver.form.data.AttributeForm attributeForm = null; 
265
     
266
     org.vfny.geoserver.form.data.TypesEditorForm form = 
267
             (org.vfny.geoserver.form.data.TypesEditorForm) request.getAttribute("typesEditorForm");
268
     java.util.List attributes = (java.util.List) form.getAttributes();
269
     int attributesSize = attributes.size(); %>
270
             
271
    <% if (!("--".equals(form.getSchemaBase())) ) { %>
272
    <tr>
273
      <td class="label">
274
		<span class="help" title="<bean:message key="help.type.schemaName"/>">
275
          <bean:message key="label.schemaName"/>:
276
        </span>
277
	  </td>
278
	  <td class="datum">
279
		<html:text property="schemaName" size="60"/>
280
	  </td>
281
	</tr>
282
    <% } %>    
283

    
284
<logic:iterate id="attribute" indexId="index" name="typesEditorForm" property="attributes">
285
	<tr>
286
      <td class="label">
287
		<bean:write name="attribute" property="name"/>:
288
	  </td>
289
	  <td class="datum">
290
        <table border=0 width="100%">
291
          <tr style="white-space: nowrap;">
292
            
293
		  <%
294
		     if (attribute instanceof org.vfny.geoserver.form.data.AttributeDisplay) { 
295
		  	     attributeDisplay = (org.vfny.geoserver.form.data.AttributeDisplay) attribute; %>
296
            <td width="70%"><bean:write name="attribute" property="type"/></td>
297
            <td>nillable:<bean:write name="attribute" property="nillable"/></td>
298
            <td>min:<bean:write name="attribute" property="minOccurs"/></td>
299
            <td>max:<bean:write name="attribute" property="maxOccurs"/></td>
300
          <% } else { 
301
                 attributeForm = (org.vfny.geoserver.form.data.AttributeForm) attribute; %>
302
            <td width="70%">
303
            	<html:select property='<%= "attributes[" + index + "].type"%>'>
304
          			<html:options property='<%= "attributes[" + index + "].types"%>'/>
305
        		</html:select>
306
				<html:submit property="action">
307
					<bean:message key="label.change"/>
308
				</html:submit>        		
309
            </td>
310
            <td><bean:message key="label.nillable"/>:<html:checkbox property='<%= "attributes[" + index + "].nillable" %>'/></td>
311
            <td><bean:message key="label.min"/>:<html:text size="2" property='<%= "attributes[" + index + "].minOccurs"%>'/></td>
312
            <td><bean:message key="label.max"/>:<html:text size="2" property='<%= "attributes[" + index + "].maxOccurs"%>'/></td>
313
            <td width=16>
314
              <% if (first == false) { %>
315
          	  <html:image src="/geoserver/WEB-INF/images/up.png" 
316
          	  	          titleKey="type.title.up" 
317
          	  	          property="action" 
318
          	  	          value="<%= "up_"+ index%>"/>
319
          	  <% } 
320
          	     first = false; %>
321
          	</td>
322
          	<td width=16>
323
          	  <% if (attributesSize-1 != index.intValue()) { %>
324
          	  <html:image src="/geoserver/WEB-INF/images/down.png" 
325
          	              titleKey="type.title.down" 
326
          	              property="action" 
327
          	              value="<%= "down_"+ index%>"/>
328
          	  <% } %>
329
          	</td> 
330
          	<td width=16>
331
          	  <html:image src="/geoserver/WEB-INF/images/delete.png" 
332
          	  	          titleKey="type.title.delete" 
333
          	  	          property="action" 
334
          	  	          value="<%= "delete_"+ index%>"/>
335
		    </td>
336
          <% } %>
337
          </tr>
338
          <%
339
            if (attributeForm != null && attributeForm.getType().equals(org.vfny.geoserver.config.AttributeTypeInfoConfig.TYPE_FRAGMENT)) {
340
  		  %>
341
          <tr>
342
            <td align="left" valign="top" colspan="7">
343
              		<html:textarea cols="80" rows="3" 
344
              		               property='<%= "attributes[" + index + "].fragment" %>'/>
345
            </td>
346
          </tr>
347
          <% } %>
348
        </table>		
349
      </td>
350
    </tr>
351
</logic:iterate>
352
    
353
    
354
    <% if (form.getCreateableAttributes().size() != 0) { %>
355
    <tr>
356
    	<td>
357
  			<html:select property="newAttribute">
358
				<html:options property="createableAttributes"/>
359
			</html:select>
360
		</td>
361
		<td>
362
			<html:submit property="action">
363
				<bean:message key="label.add"/>
364
			</html:submit>    	
365
		</td>
366
    </tr>
367
    <% } %>
368
    
369
    <tr>
370
      <td class="label">
371
        &nbsp;
372
      </td>
373
	  <td class="datum">
374

    
375
		<html:submit property="action">
376
			<bean:message key="label.submit"/>
377
		</html:submit>
378
		
379
		<html:reset>
380
			<bean:message key="label.reset"/>
381
		</html:reset>
382

    
383
	  </td>
384
    </tr>
385
  </table>
386
</html:form>
387

    
388
<% } catch (Throwable hate ){
389
   System.err.println( "FeatureType Editor problem:"+ hate );
390
   hate.printStackTrace();
391
   throw hate;
392
} %>
(1-1/4)