Skip to content

Commit

Permalink
Merge pull request #68 from podaac/release/8.5.0
Browse files Browse the repository at this point in the history
Release/8.5.0
  • Loading branch information
skorper authored Oct 25, 2023
2 parents 047f561 + 59fb8b5 commit f1fe7e6
Show file tree
Hide file tree
Showing 41 changed files with 4,415 additions and 592 deletions.
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,26 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [8.5.0]
### Added
- **PODAAC-5594**
- Support BasinID
- **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
### Deprecated
### Removed
### Fixed
- **PODAAC-5708**
- .nc.iso.xml Polygon divided over IDL
### Security

-
## [8.4.0]
### Added
- Update metadata aggregator to add description to image variables from image processor and test tig forge processor
### Deprecated
### Removed
### Fixed
Expand Down Expand Up @@ -526,4 +544,4 @@ Note: This is the first release where we are consolidating DMAS changes with Cum

### Fixed

### Security
### Security
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ gradle -x test build
** -r --constructors-required-only : generate constructor for required field only
** -R remove old output
```aidl
jsonschema2pojo -s ./UMM-G1.6.3.json --target java-gen -p gov.nasa.cumulus.metadata.umm.model -a GSON -r -fdt true -R
jsonschema2pojo -s ./UMM-G1.6.3.json --target java-gen -p gov.nasa.cumulus.metadata.umm.model -a GSON -fdt
jsonschema2pojo -s ./ummg165.json --target java-gen -p gov.nasa.cumulus.metadata.umm.generated -a GSON -fdt -r -R
jsonschema2pojo -s ./ummg165.json --target java-gen -p gov.nasa.cumulus.metadata.umm.generated -a GSON -fdt
jsonshcema2pojo maven plugin is also configured within the pom.xml file
mvn compile // call plugin goal to generate pojo classes
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.4.0
8.5.0
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>gov.nasa.podaac</groupId>
<artifactId>cumulus-metadata-aggregator</artifactId>
<version>8.4.0</version>
<version>8.5.0-rc.3</version>
<packaging>jar</packaging>

<name>Metadata-Aggregator</name>
Expand Down Expand Up @@ -44,13 +44,13 @@
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
<version>1.12.440</version>
<version>1.12.544</version>
</dependency>
<!-- For AWS Secret Manager -->
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-secretsmanager</artifactId>
<version>1.12.440</version>
<version>1.12.544</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ public HttpResponse validateUMMG(String provider, String granuleId, String strU
*/
public boolean isUMMGSpatialValid(String provider, String granuleId, String strUMMG)
throws URISyntaxException, IOException, ParseException {
AdapterLogger.LogInfo(this.className + " UMMG validation provider: "+ provider + " granuleId: " + granuleId +
" ummg: " + strUMMG);
HttpResponse httpResponse = validateUMMG(provider, granuleId, strUMMG);
int statusCode = httpResponse.getStatusLine().getStatusCode();
InputStream inputStream = httpResponse.getEntity().getContent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ public static class Metadata{
public static final String START_ORBIT = "startorbit";
public static final String END_ORBIT = "endorbit";
}
public static final String UMMG_VERSION = "1.6.3";
public static final String UMMG_VERSION = "1.6.5";
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public final class IsoMendsXPath extends IsoXPath {
// AscendingCrossing, StartLatitude, StartDirection, EndLatitude, EndDirection
public static final String ORBIT = "/gmi:MI_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicDescription[@id=\"Orbit\"]/gmd:geographicIdentifier/gmd:MD_Identifier/gmd:code/gco:CharacterString";

/** list of coordinates representing footprint */
public static final String GRANULE_INPUT = "/gmi:MI_Metadata/gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:lineage/gmd:LI_Lineage/gmd:source/gmi:LE_Source[gmd:description/gco:CharacterString[text()=\"GranuleInput\"]]/gmd:sourceCitation/gmd:CI_Citation/gmd:title/gmx:FileName";
public static final String CYCLE_PASS_TILE_SCENE = "/gmi:MI_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicDescription[@id=\"SWOTTrack\"]/gmd:geographicIdentifier/gmd:MD_Identifier/gmd:code/gco:CharacterString";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.List;

import gov.nasa.cumulus.metadata.aggregator.processor.DMRPPProcessor;
import gov.nasa.cumulus.metadata.aggregator.processor.FootprintProcessor;
import gov.nasa.cumulus.metadata.aggregator.processor.ImageProcessor;
import gov.nasa.cumulus.metadata.state.MENDsIsoXMLSpatialTypeEnum;
import gov.nasa.cumulus.metadata.state.WorkflowTypeEnum;
import gov.nasa.cumulus.metadata.util.S3Utils;
import org.apache.commons.io.FileUtils;
Expand Down Expand Up @@ -55,6 +57,10 @@ public String PerformFunction(String input, Context context) throws Exception {
* this will help the logic in postIngestProcess function.
*/
this.setWorkFlowType((String) config.get("stateMachine"));
// This is a switch to determine, shall footprint, orbit or boundingbox shall be processed from iso.xml
// while ingesting swot collections
JSONArray isoXMLSpatialTypeJsonArray = (JSONArray) config.get("isoXMLSpatialType");
HashSet isoXMLSpatialTypeHashSet = createIsoXMLSpatialTypeSet(isoXMLSpatialTypeJsonArray);


String isoRegex = (String) config.get("isoRegex");
Expand Down Expand Up @@ -149,7 +155,9 @@ public String PerformFunction(String input, Context context) throws Exception {
MetadataFilesToEcho mtfe;
boolean isIsoFile = (iso != null);

mtfe = new MetadataFilesToEcho(isIsoFile);
mtfe = new MetadataFilesToEcho(isIsoFile, isoXMLSpatialTypeHashSet);
//set the name/granuleId
mtfe.getGranule().setName(granuleId);
mtfe.setDatasetValues(collectionName, collectionVersion, rangeIs360, boundingBox, additionalAttributes);
if (granules != null && granules.size() > 0) {
mtfe.setGranuleFileSizeAndChecksum(granules);
Expand Down Expand Up @@ -182,10 +190,6 @@ public String PerformFunction(String input, Context context) throws Exception {
}
}

//set the name
mtfe.getGranule().setName(granuleId);


//write UMM-G to file
try {
mtfe.writeJson("/tmp/" + granuleId + ".cmr.json");
Expand Down Expand Up @@ -234,6 +238,33 @@ public String PerformFunction(String input, Context context) throws Exception {
return returnable.toJSONString();
}

public HashSet<MENDsIsoXMLSpatialTypeEnum> createIsoXMLSpatialTypeSet(JSONArray isoXMLSpatialTypeConfigJSONArray) throws IllegalArgumentException{
HashSet<MENDsIsoXMLSpatialTypeEnum> isoSpatialTypes = new HashSet<>();
// if not containing isoXMLTypes, then return an empty HashSet
if(isoXMLSpatialTypeConfigJSONArray == null || isoXMLSpatialTypeConfigJSONArray.size()==0) {
return isoSpatialTypes;
}
isoXMLSpatialTypeConfigJSONArray.forEach(item -> {
String t = (String) item;
MENDsIsoXMLSpatialTypeEnum en = MENDsIsoXMLSpatialTypeEnum.getEnum(getIsoXMLSpatialTypeStr(t));
isoSpatialTypes.add(en);
});
AdapterLogger.LogDebug(this.className + " isoSpatialTypes HashSet: " + isoSpatialTypes);
return isoSpatialTypes;
}

public String getIsoXMLSpatialTypeStr(String token) {
final String trimmedToken = StringUtils.trim(token);
String s;
try {
s = MENDsIsoXMLSpatialTypeEnum.getEnumValuList().stream()
.filter(e -> StringUtils.equals(trimmedToken, e)).findFirst().get();
} catch (java.util.NoSuchElementException e) {
s = "";
}
return s;
}

/**
* get S3 fileStaging direction from S3 full key
*
Expand Down
Loading

0 comments on commit f1fe7e6

Please sign in to comment.