Skip to content

Commit

Permalink
better handle XPath extraction logging and remove MENDSIsoXMLSpatialT…
Browse files Browse the repository at this point in the history
…ypeConstant
  • Loading branch information
Yen, David (398B-Affiliate) committed Sep 13, 2023
1 parent 1121363 commit 872811e
Show file tree
Hide file tree
Showing 7 changed files with 1,398 additions and 23 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- **PODAAC-5594**
- Support BasinID
- **PODAAC-5708**
- Add capability in order to extract swot nc.iso.xml footprint and divide over IDL
- **PODAAC-5770**
- use meta.isoXMLSpatialType to configure the collection should process the combination of footprint, orbit and bbox
- **PODAAC-5717**
- Upgrade to UMMG 1.6.5
- support empty Pass in Cycle/Pass/Tile string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import java.util.Hashtable;
import java.util.List;

import gov.nasa.cumulus.metadata.aggregator.constant.MENDsIsoXMLSpatialTypeConstant;
import gov.nasa.cumulus.metadata.aggregator.processor.DMRPPProcessor;
import gov.nasa.cumulus.metadata.aggregator.processor.FootprintProcessor;
import gov.nasa.cumulus.metadata.aggregator.processor.ImageProcessor;
Expand Down Expand Up @@ -258,7 +257,7 @@ public String getIsoXMLSpatialTypeStr(String token) {
final String trimmedToken = StringUtils.trim(token);
String s;
try {
s = MENDsIsoXMLSpatialTypeConstant.isoXMLSpatialTypeList.stream()
s = MENDsIsoXMLSpatialTypeEnum.getEnumValuList().stream()
.filter(e -> StringUtils.equals(trimmedToken, e)).findFirst().get();
} catch (java.util.NoSuchElementException e) {
s = "";
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
package gov.nasa.cumulus.metadata.state;

import gov.nasa.cumulus.metadata.aggregator.constant.MENDsIsoXMLSpatialTypeConstant;
import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;
import java.util.List;

public enum MENDsIsoXMLSpatialTypeEnum {

FOOTPRINT("footprint"), ORBIT("orbit"), BBOX("bbox"), NONE("none");
private String Status;
private static String FOOTPRINT_STR="footprint";
private static String ORBIT_STR="orbit";
private static String BBOX_STR="bbox";
private MENDsIsoXMLSpatialTypeEnum(String type) {
this.Status = type;
}
Expand All @@ -15,14 +21,19 @@ public String toString()
return this.Status;
}

public static List<String> getEnumValuList() {
final List<String> isoXMLSpatialTypeList = Arrays.asList(FOOTPRINT_STR, BBOX_STR, ORBIT_STR);
return isoXMLSpatialTypeList;
}

public static MENDsIsoXMLSpatialTypeEnum getEnum(String val)
{
val= StringUtils.trim(val);
if(StringUtils.equals(val, MENDsIsoXMLSpatialTypeConstant.FOOTPRINT))
if(StringUtils.equals(val, FOOTPRINT_STR))
return FOOTPRINT;
else if (StringUtils.equals(val, MENDsIsoXMLSpatialTypeConstant.ORBIT))
else if (StringUtils.equals(val, ORBIT_STR))
return ORBIT;
else if (StringUtils.equals(val, MENDsIsoXMLSpatialTypeConstant.BBOX))
else if (StringUtils.equals(val, BBOX_STR))
return BBOX;
else
return NONE;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package gov.nasa.cumulus.metadata.util;

import com.google.gson.internal.bind.ReflectiveTypeAdapterFactory;
import cumulus_message_adapter.message_parser.AdapterLogger;
import gov.nasa.cumulus.metadata.aggregator.IsoMendsXPath;
import org.w3c.dom.Document;

import javax.xml.xpath.XPath;
Expand Down
Loading

0 comments on commit 872811e

Please sign in to comment.