Project

General

Profile

Revision 6126

expose spatial cache regeneration option in the admin interface

View differences:

lib/admin/geoserver-configuration.jsp
70 70
	</div>
71 71
	<div class="form-row">
72 72
		<img class="question-mark" src="style/images/question-mark.gif" 
73
			onClick="helpWindow('<%= request.getContextPath() %>','metacat-configure.html#GEOSERVER_REGENERATE_CACHE')"/>
74
		<div class="textinput-label"><label for="spatial.regenerateCacheOnRestart" title="Regenerate spatial cache">Regenerate spatial cache</label></div>
75

  
76
		<%
77
		boolean regenerate = (Boolean) request.getAttribute("spatial.regenerateCacheOnRestart");
78
		if (regenerate) { 
79
		%>
80
		<input type="checkbox" class="textinput" id="spatial.regenerateCacheOnRestart" 
81
				name="spatial.regenerateCacheOnRestart" 	             		    	    	           		    	             			
82
				value="true"
83
				checked="checked"/>
84
		<% } else {%>
85
		<input type="checkbox" class="textinput" id="spatial.regenerateCacheOnRestart" 
86
				name="spatial.regenerateCacheOnRestart" 	             		    	    	           		    	             			
87
				value="true"/>
88
		<% } %>
89

  
90
	</div>
91
	<div class="form-row">
92
		<img class="question-mark" src="style/images/question-mark.gif" 
73 93
			onClick="helpWindow('<%= request.getContextPath() %>','metacat-configure.html#GeoserverContext')"/>
74 94
		<div class="textinput-label"><label for="geoserver.context" title="Geoserver context">Context</label></div>
75 95
		<input class="textinput" id="geoserver.context" 
src/edu/ucsb/nceas/metacat/admin/GeoserverAdmin.java
97 97
				String password = PropertyService.getProperty("geoserver.password");
98 98
				String context = PropertyService.getProperty("geoserver.context");
99 99
				String dataDir = PropertyService.getProperty("geoserver.GEOSERVER_DATA_DIR");
100
				String regenerateCache = PropertyService.getProperty("spatial.regenerateCacheOnRestart");
101
				boolean regenerate = false;
102
				if (regenerateCache != null) {
103
					regenerate = Boolean.parseBoolean(regenerateCache);
104
				}
105
				
100 106
				// provide a default based on the current installation
101 107
				if (dataDir == null || dataDir.length() == 0) {
102 108
					dataDir = 
......
113 119
				request.setAttribute("geoserver.password", password);
114 120
				request.setAttribute("geoserver.context", context);
115 121
				request.setAttribute("geoserver.GEOSERVER_DATA_DIR", dataDir);
122
				request.setAttribute("spatial.regenerateCacheOnRestart", regenerate);
116 123

  
117 124
				// Forward the request to the JSP page
118 125
				RequestUtil.forwardRequest(request, response,
......
180 187
				String password = (String)request.getParameter("geoserver.password");
181 188
				String context = (String)request.getParameter("geoserver.context");
182 189
				String dataDir = (String)request.getParameter("geoserver.GEOSERVER_DATA_DIR");
190
				String regenerateCache = (String)request.getParameter("spatial.regenerateCacheOnRestart");
191
				boolean regenerate = false;
192
				if (regenerateCache != null) {
193
					regenerate = Boolean.parseBoolean(regenerateCache);
194
				}
195

  
183 196
				
184 197
				// process the context/data dir
185 198
				if (context != null && dataDir != null) {
......
201 214
					GeoserverUtil.changePassword(username, password);
202 215
					PropertyService.setPropertyNoPersist("geoserver.username", username);
203 216
					PropertyService.setPropertyNoPersist("geoserver.password", password);
217
					PropertyService.setPropertyNoPersist("spatial.regenerateCacheOnRestart", Boolean.toString(regenerate));
204 218
					PropertyService.persistProperties();
205 219

  
206 220
					// write the backup properties to a location outside the

Also available in: Unified diff