Project

General

Profile

« Previous | Next » 

Revision 9275

Added by Jing Tao over 9 years ago

Add the identifier in the message of the exception when a client tries to reset the obsoletes or obsoletedBy fields.

View differences:

src/edu/ucsb/nceas/metacat/dataone/D1NodeService.java
1725 1725
	private void checkOneTimeSettableSysmMetaFields(SystemMetadata orgMeta, SystemMetadata newMeta) throws InvalidRequest {
1726 1726
	    if(orgMeta.getObsoletedBy() != null ) {
1727 1727
	        if(newMeta.getObsoletedBy() == null || !orgMeta.getObsoletedBy().equals(newMeta.getObsoletedBy())) {
1728
	            throw new InvalidRequest("4869", "The request is trying to reset the obsoletedBy field in the SystemMeta. Once the obsoletedBy filed is set, you can't change it again.");
1728
	            throw new InvalidRequest("4869", "The request is trying to reset the obsoletedBy field in the system metadata of the object "
1729
	                    + orgMeta.getIdentifier().getValue() +". This is illegal since the obsoletedBy filed is set, you can't change it again.");
1729 1730
	        }
1730 1731
        }
1731 1732
	    if(orgMeta.getObsoletes() != null) {
1732 1733
	        if(newMeta.getObsoletes() == null || !orgMeta.getObsoletes().equals(newMeta.getObsoletes())) {
1733
	            throw new InvalidRequest("4869", "The request is trying to reset the obsoletes field in the SystemMeta. Once the obsoletedBy filed is set, you can't change it again.");
1734
	            throw new InvalidRequest("4869", "The request is trying to reset the obsoletes field in the system metadata of the object"+
1735
	               orgMeta.getIdentifier().getValue()+". This is illegal since the obsoletedBy filed is set, you can't change it again.");
1734 1736
	        }
1735 1737
	    }
1736 1738
	}

Also available in: Unified diff