Project

General

Profile

Revision 7877

Added by Jing Tao over 7 years ago

Besides the getArchvied() method, the getObsoletedBy method was added to determine if the object is archvied or not.

View differences:

metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/SolrIndex.java
456 456
                    XPathExpressionException, SolrServerException, JiBXException, EncoderException, NotImplemented, NotFound, UnsupportedType, ServiceFailure {
457 457
        checkParams(pid, systemMetadata, data);
458 458
        boolean isArchive = systemMetadata.getArchived();
459
        if(isArchive) {
459
        if(isArchive || systemMetadata.getObsoletedBy() != null) {
460 460
            //archive(delete)
461 461
            Identifier obsolete = systemMetadata.getObsoletes();
462 462
            if(obsolete != null) {
metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/SystemMetadataEventListener.java
215 215
	        action = Event.CREATE.xmlValue();
216 216
            event.setAction(Event.CREATE);
217 217
	    }
218
	    else if(systemMetadata.getArchived()) {
218
	    else if(systemMetadata.getArchived() || systemMetadata.getObsoletedBy() != null) {
219 219
            action = Event.DELETE.xmlValue();
220 220
            event.setAction(Event.DELETE);
221 221
        } else {
metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/IndexGenerator.java
624 624
        if(id != null)  {
625 625
                SystemMetadata sysmeta = getSystemMetadata(id);
626 626
                //only update none-archived id.
627
                if(sysmeta != null && !sysmeta.getArchived()) {
627
                if(sysmeta != null && !sysmeta.getArchived() && sysmeta.getObsoletedBy() == null) {
628 628
                        InputStream data = getDataObject(id);
629 629
                        Identifier obsolete = sysmeta.getObsoletes();
630 630
                        List<String> obsoleteChain = null;

Also available in: Unified diff