Project

General

Profile

Revision 6690

configure synch schedule in the admin screen
https://redmine.dataone.org/issues/1933

View differences:

lib/admin/dataone-configuration.jsp
162 162

  
163 163
	</div>
164 164

  
165
	<h3>Synchronization Schedule</h3>
166
	<hr class="config-line">
167
	<div class="form-row">
168
		<img class="question-mark" src="style/images/question-mark.gif" 
169
			onClick="helpWindow('<%= request.getContextPath() %>','metacat-configure.html#dataone')"/>
170
		<div class="textinput-label">
171
			<label for="dataone.nodeSynchronization.schedule.year" title="Year">Year</label>
172
		</div>
173
		<input class="textinput" 
174
			id="dataone.nodeSynchronization.schedule.year" 
175
			name="dataone.nodeSynchronization.schedule.year" 	             		    	    	           		    	             			
176
			value="<%= request.getAttribute("dataone.nodeSynchronization.schedule.year") %>"/> 
177
	</div>
178
	<div class="form-row">
179
		<img class="question-mark" src="style/images/question-mark.gif" 
180
			onClick="helpWindow('<%= request.getContextPath() %>','metacat-configure.html#dataone')"/>
181
		<div class="textinput-label">
182
			<label for="dataone.nodeSynchronization.schedule.mon" title="Month">Month</label>
183
		</div>
184
		<input class="textinput" 
185
			id="dataone.nodeSynchronization.schedule.mon" 
186
			name="dataone.nodeSynchronization.schedule.mon" 	             		    	    	           		    	             			
187
			value="<%= request.getAttribute("dataone.nodeSynchronization.schedule.mon") %>"/> 
188
	</div>
189
	<div class="form-row">
190
		<img class="question-mark" src="style/images/question-mark.gif" 
191
			onClick="helpWindow('<%= request.getContextPath() %>','metacat-configure.html#dataone')"/>
192
		<div class="textinput-label">
193
			<label for="dataone.nodeSynchronization.schedule.mday" title="Day of Month">Day of Month</label>
194
		</div>
195
		<input class="textinput" 
196
			id="dataone.nodeSynchronization.schedule.mday" 
197
			name="dataone.nodeSynchronization.schedule.mday" 	             		    	    	           		    	             			
198
			value="<%= request.getAttribute("dataone.nodeSynchronization.schedule.mday") %>"/> 
199
	</div>
200
	<div class="form-row">
201
		<img class="question-mark" src="style/images/question-mark.gif" 
202
			onClick="helpWindow('<%= request.getContextPath() %>','metacat-configure.html#dataone')"/>
203
		<div class="textinput-label">
204
			<label for="dataone.nodeSynchronization.schedule.wday" title="Day of Week">Day of Week</label>
205
		</div>
206
		<input class="textinput" 
207
			id="dataone.nodeSynchronization.schedule.wday" 
208
			name="dataone.nodeSynchronization.schedule.wday" 	             		    	    	           		    	             			
209
			value="<%= request.getAttribute("dataone.nodeSynchronization.schedule.wday") %>"/> 
210
	</div>
211
	<div class="form-row">
212
		<img class="question-mark" src="style/images/question-mark.gif" 
213
			onClick="helpWindow('<%= request.getContextPath() %>','metacat-configure.html#dataone')"/>
214
		<div class="textinput-label">
215
			<label for="dataone.nodeSynchronization.schedule.hour" title="Hours">Hours</label>
216
		</div>
217
		<input class="textinput" 
218
			id="dataone.nodeSynchronization.schedule.hour" 
219
			name="dataone.nodeSynchronization.schedule.hour" 	             		    	    	           		    	             			
220
			value="<%= request.getAttribute("dataone.nodeSynchronization.schedule.hour") %>"/> 
221
	</div>
222
	<div class="form-row">
223
		<img class="question-mark" src="style/images/question-mark.gif" 
224
			onClick="helpWindow('<%= request.getContextPath() %>','metacat-configure.html#dataone')"/>
225
		<div class="textinput-label">
226
			<label for="dataone.nodeSynchronization.schedule.min" title="Minutes">Minutes</label>
227
		</div>
228
		<input class="textinput" 
229
			id="dataone.nodeSynchronization.schedule.min" 
230
			name="dataone.nodeSynchronization.schedule.min" 	             		    	    	           		    	             			
231
			value="<%= request.getAttribute("dataone.nodeSynchronization.schedule.min") %>"/> 
232
	</div>
233
	<div class="form-row">
234
		<img class="question-mark" src="style/images/question-mark.gif" 
235
			onClick="helpWindow('<%= request.getContextPath() %>','metacat-configure.html#dataone')"/>
236
		<div class="textinput-label">
237
			<label for="dataone.nodeSynchronization.schedule.sec" title="Seconds">Seconds</label>
238
		</div>
239
		<input class="textinput" 
240
			id="dataone.nodeSynchronization.schedule.sec" 
241
			name="dataone.nodeSynchronization.schedule.sec" 	             		    	    	           		    	             			
242
			value="<%= request.getAttribute("dataone.nodeSynchronization.schedule.sec") %>"/> 
243
	</div>
244

  
165 245
	<input type="hidden" name="configureType" value="dataone"/>
166 246
	<input type="hidden" name="processForm" value="true"/>
167 247
	<input class=button type="submit" value="Update"/>
src/edu/ucsb/nceas/metacat/admin/D1Admin.java
117 117
				String subject = PropertyService.getProperty("dataone.subject");
118 118
				String certpath = PropertyService.getProperty("D1Client.certificate.file");
119 119
				
120
				//the synch schedule
121
				String year = PropertyService.getProperty("dataone.nodeSynchronization.schedule.year");
122
				String mon = PropertyService.getProperty("dataone.nodeSynchronization.schedule.mon");
123
				String mday = PropertyService.getProperty("dataone.nodeSynchronization.schedule.mday");
124
				String wday = PropertyService.getProperty("dataone.nodeSynchronization.schedule.wday");
125
				String hour = PropertyService.getProperty("dataone.nodeSynchronization.schedule.hour");
126
				String min = PropertyService.getProperty("dataone.nodeSynchronization.schedule.min");
127
				String sec = PropertyService.getProperty("dataone.nodeSynchronization.schedule.sec");
128
				
129
				/**
130
				dataone.nodeSynchronization.schedule.year=*
131
				dataone.nodeSynchronization.schedule.mon=*
132
				dataone.nodeSynchronization.schedule.mday=*
133
				dataone.nodeSynchronization.schedule.wday=?
134
				dataone.nodeSynchronization.schedule.hour=*
135
				dataone.nodeSynchronization.schedule.min=0/3
136
				dataone.nodeSynchronization.schedule.sec=10
137
				**/
138
				
120 139
				boolean synchronize = false;
121 140
				if (nodeSynchronize != null) {
122 141
					synchronize = Boolean.parseBoolean(nodeSynchronize);
......
133 152
				request.setAttribute("dataone.nodeReplicate", replicate);
134 153
				request.setAttribute("dataone.subject", subject);
135 154
				request.setAttribute("D1Client.certificate.file", certpath);
155
				
156
				// synch schedule
157
				request.setAttribute("dataone.nodeSynchronization.schedule.year", year);
158
				request.setAttribute("dataone.nodeSynchronization.schedule.mon", mon);
159
				request.setAttribute("dataone.nodeSynchronization.schedule.mday", mday);
160
				request.setAttribute("dataone.nodeSynchronization.schedule.wday", wday);
161
				request.setAttribute("dataone.nodeSynchronization.schedule.hour", hour);
162
				request.setAttribute("dataone.nodeSynchronization.schedule.min", min);
163
				request.setAttribute("dataone.nodeSynchronization.schedule.sec", sec);
136 164

  
137 165
				// Forward the request to the JSP page
138 166
				RequestUtil.forwardRequest(request, response, "/admin/dataone-configuration.jsp", null);
......
202 230
				String subject = (String)request.getParameter("dataone.subject");
203 231
				String certpath = (String)request.getParameter("D1Client.certificate.file");
204 232
				
233
				// the synch schedule
234
				String year = (String) request.getParameter("dataone.nodeSynchronization.schedule.year");
235
				String mon = (String) request.getParameter("dataone.nodeSynchronization.schedule.mon");
236
				String mday = (String) request.getParameter("dataone.nodeSynchronization.schedule.mday");
237
				String wday = (String) request.getParameter("dataone.nodeSynchronization.schedule.wday");
238
				String hour = (String) request.getParameter("dataone.nodeSynchronization.schedule.hour");
239
				String min = (String) request.getParameter("dataone.nodeSynchronization.schedule.min");
240
				String sec = (String) request.getParameter("dataone.nodeSynchronization.schedule.sec");
241
				
205 242
				boolean synchronize = false;
206 243
				if (nodeSynchronize != null) {
207 244
					synchronize = Boolean.parseBoolean(nodeSynchronize);
......
224 261
					PropertyService.setPropertyNoPersist("dataone.subject", subject);
225 262
					PropertyService.setPropertyNoPersist("D1Client.certificate.file", certpath);
226 263
					
264
					// the synch schedule
265
					PropertyService.setPropertyNoPersist("dataone.nodeSynchronization.schedule.year", year);
266
					PropertyService.setPropertyNoPersist("dataone.nodeSynchronization.schedule.mon", mon);
267
					PropertyService.setPropertyNoPersist("dataone.nodeSynchronization.schedule.mday", mday);
268
					PropertyService.setPropertyNoPersist("dataone.nodeSynchronization.schedule.wday", wday);
269
					PropertyService.setPropertyNoPersist("dataone.nodeSynchronization.schedule.hour", hour);
270
					PropertyService.setPropertyNoPersist("dataone.nodeSynchronization.schedule.min", min);
271
					PropertyService.setPropertyNoPersist("dataone.nodeSynchronization.schedule.sec", sec);
272
					
227 273
					PropertyService.persistProperties();
228 274

  
229 275
					// write the backup properties to a location outside the

Also available in: Unified diff