Project

General

Profile

« Previous | Next » 

Revision 6503

use Settings augmentation to customize the D1Client.CN_URL when used in a Metacat deployment.

View differences:

lib/metacat.properties
464 464
test.metacatUrl=http://localhost:8080/knb/metacat
465 465
test.contextUrl=http://localhost:8080/knb
466 466
test.workflowSchedulerUrl=http://localhost:8080/workflowscheduler/scheduler
467
test.metacatDeployDir=/usr/local/tomcat/webapps/knb
467
test.metacatDeployDir=/Users/leinfelder/tools/apache-tomcat-6/webapps/knb
468 468
test.mcUser=uid=kepler,o=unaffiliated,dc=ecoinformatics,dc=org
469 469
test.mcPassword=kepler
470 470
test.mcAnotherUser=uid=test,o=NCEAS,dc=ecoinformatics,dc=org
......
486 486

  
487 487

  
488 488
############# DataONE Section #######################################
489
dataone.coordinatingNodeBaseURL=https://cn-dev.dataone.org/cn
489
D1Client.CN_URL=https://cn-dev.dataone.org
490
#dataone.coordinatingNodeBaseURL=https://cn-dev.dataone.org/cn
490 491
dataone.memberNodeId=METACAT1
491 492
dataone.subject=CN=METACAT1, DC=dataone, DC=org
492 493
dataone.certpath=/etc/dataone/client/certs
src/edu/ucsb/nceas/metacat/admin/PropertiesAdmin.java
36 36
import org.dataone.client.CNode;
37 37
import org.dataone.client.D1Client;
38 38
import org.dataone.client.auth.CertificateManager;
39
import org.dataone.configuration.Settings;
40 39
import org.dataone.service.exceptions.IdentifierNotUnique;
41 40
import org.dataone.service.exceptions.InvalidRequest;
42 41
import org.dataone.service.exceptions.NotAuthorized;
......
366 365
            }
367 366
            String mnCertificatePath = certificatePath + node.getIdentifier().getValue() + ".pem";
368 367
            CertificateManager.getInstance().setCertificateLocation(mnCertificatePath);
369
            Settings.getConfiguration().setProperty("D1Client.CN_URL", PropertyService.getProperty("dataone.coordinatingNodeBaseURL"));
370 368
            cn = D1Client.getCN();
371
            logMetacat.debug("Registering node with DataONE.");
369
            logMetacat.debug("Registering node with DataONE. " + cn.getNodeBaseServiceUrl());
372 370
            // Session is null, because the libclient code automatically sets up an
373 371
            // SSL session for us using the client certificate provided
374 372
            Session session = null;
src/edu/ucsb/nceas/metacat/properties/ConfigurableProperties.java
35 35
import javax.servlet.http.HttpServletRequest;
36 36
import javax.xml.transform.TransformerException;
37 37

  
38
import org.apache.commons.configuration.ConfigurationException;
38 39
import org.apache.log4j.Logger;
40
import org.dataone.configuration.Settings;
39 41

  
40 42
import edu.ucsb.nceas.metacat.service.ServiceService;
41 43
import edu.ucsb.nceas.metacat.shared.BaseService;
......
127 129
			// metacat.
128 130
			mainProperties = new SortedProperties(mainConfigFilePath);
129 131
			mainProperties.load();
132
			
133
			// include main metacat properties in d1 properties as overrides
134
			try {
135
				Settings.augmentConfiguration(mainConfigFilePath);
136
			} catch (ConfigurationException e) {
137
				logMetacat.error("Could not augment DataONE properties. " + e.getMessage(), e);
138
			}
130 139

  
131 140
			// mainMetaData holds configuration information about main
132 141
			// properties. This is primarily used to display input fields on 

Also available in: Unified diff