42 |
42 |
import org.dataone.service.types.v1.Session;
|
43 |
43 |
|
44 |
44 |
import edu.ucsb.nceas.metacat.IdentifierManager;
|
|
45 |
import edu.ucsb.nceas.metacat.admin.upgrade.GenerateORE;
|
45 |
46 |
import edu.ucsb.nceas.metacat.dataone.MNodeService;
|
46 |
47 |
import edu.ucsb.nceas.metacat.properties.PropertyService;
|
47 |
48 |
import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
|
... | ... | |
287 |
288 |
PropertyService.setPropertyNoPersist("dataone.nodeSynchronization.schedule.sec", sec);
|
288 |
289 |
|
289 |
290 |
PropertyService.persistProperties();
|
|
291 |
|
|
292 |
// Register/update as a DataONE Member Node
|
|
293 |
registerDataONEMemberNode();
|
290 |
294 |
|
|
295 |
// Generate ORE, if we haven't
|
|
296 |
boolean oreGenerated = Boolean.parseBoolean(PropertyService.getProperty("configutil.dataone.ore.generated"));
|
|
297 |
if (!oreGenerated) {
|
|
298 |
GenerateORE gore = new GenerateORE();
|
|
299 |
gore.upgrade();
|
|
300 |
PropertyService.setProperty("dataone.ore.generated", Boolean.TRUE.toString());
|
|
301 |
|
|
302 |
}
|
|
303 |
|
291 |
304 |
// write the backup properties to a location outside the
|
292 |
305 |
// application directories so they will be available after
|
293 |
306 |
// the next upgrade
|
294 |
307 |
PropertyService.persistMainBackupProperties();
|
295 |
308 |
|
296 |
|
// Register as a DataONE Member Node
|
297 |
|
if (replicate) {
|
298 |
|
registerDataONEMemberNode();
|
299 |
|
}
|
300 |
309 |
}
|
301 |
310 |
} catch (GeneralPropertyException gpe) {
|
302 |
311 |
String errorMessage = "D1Admin.configureDataONE - Problem getting or setting property while "
|
... | ... | |
325 |
334 |
"/admin?configureType=configure&processForm=false", null);
|
326 |
335 |
}
|
327 |
336 |
} catch (MetacatUtilException mue) {
|
328 |
|
throw new AdminException("D1Admin.configureDataONE - utility problem while processing geoservices "
|
329 |
|
+ "geoservices page: " + mue.getMessage());
|
|
337 |
throw new AdminException("D1Admin.configureDataONE - utility problem while processing dataone configuration: "
|
|
338 |
+ mue.getMessage());
|
330 |
339 |
} catch (GeneralPropertyException gpe) {
|
331 |
340 |
throw new AdminException("D1Admin.configureDataONE - problem with properties while "
|
332 |
341 |
+ "processing geoservices configuration page: " + gpe.getMessage());
|
generate ORE maps only once -- and persist the flag to the main backup properties so that subsequent Metacat upgrades remember this value.