Project

General

Profile

« Previous | Next » 

Revision 9187

Added by Jing Tao over 9 years ago

Get the node id from the metacat.properties instead of the hard coded one.

View differences:

test/edu/ucsb/nceas/metacat/dataone/D1NodeServiceTest.java
43 43
import org.dataone.client.v2.CNode;
44 44
import org.dataone.client.v2.itk.D1Client;
45 45
import org.dataone.client.v2.formats.ObjectFormatCache;
46
import org.dataone.configuration.Settings;
46 47
import org.dataone.service.types.v1.AccessPolicy;
47 48
import org.dataone.service.types.v1.AccessRule;
48 49
import org.dataone.service.types.v1.Checksum;
......
194 195
        sm.setRightsHolder(owner);
195 196
        sm.setDateUploaded(new Date());
196 197
        sm.setDateSysMetadataModified(new Date());
198
        String currentNodeId = Settings.getConfiguration().getString("dataone.nodeId");
199
        if(currentNodeId == null || currentNodeId.trim().equals("")) {
200
            throw new Exception("there should be value in the dataone.nodeId in the metacat.properties file.");
201
        }
197 202
        NodeReference nr = new NodeReference();
198
        nr.setValue("metacat");
203
        nr.setValue(currentNodeId);
199 204
        sm.setOriginMemberNode(nr);
200 205
        sm.setAuthoritativeMemberNode(nr);
201 206
		// set the access to public read

Also available in: Unified diff