Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,30 @@ Distributed Data Framework (DDF) is an open source, modular integration framewor
* Make sure that your JAVA\_HOME environment variable is set to the newly installed JDK location, and that your PATH includes %JAVA\_HOME%\bin (Windows) or $JAVA\_HOME$/bin (\*NIX).
* [Install Maven 3.9.0 \(or later\)](http://maven.apache.org/download.html). Make sure that your PATH includes the MVN\_HOME/bin directory.
* Set the MAVEN_OPTS variable with the appropriate memory settings
### Optional
#### Optional
* If you do not wish to run formatting from the commandline (see below) you may use an IDE to format the code for you with the google-java-format plugins.
- https://github.com/google/google-java-format
* IntelliJ: https://plugins.jetbrains.com/plugin/8527
* Eclipse: https://github.com/google/google-java-format/releases/download/google-java-format-1.3/google-java-format-eclipse-plugin-1.3.0.jar


### Configure Maven ###
This repository depends on Codice and Connexta artifacts available in their GitHub repository packages.
To pull these artifacts, you will need create a [Personal Access Token (PAT) in GitHub](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic)
with `packages:read` permissions, and configure maven's ~/.m2/settings.xml:
```
<servers>
<server>
<id>codice</id>
<username>$USERNAME</username>
<password>$TOKEN</password>
</server>
<server>
<id>connexta</id>
<username>$USERNAME</username>
<password>$TOKEN</password>
</server>
</servers>
```

### How to build ###
In order to run through a full build, be sure to have a clone for the ddf repository and optionally the ddf-support repository (NOTE: daily snapshots are deployed so downloading and building each repo may not be necessary since those artifacts will be retrieved.):
Expand Down
17 changes: 0 additions & 17 deletions catalog/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -375,23 +375,6 @@
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.ops4j.pax.web</groupId>
<artifactId>pax-web-spi</artifactId>
<version>${pax.web.version}</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.core</artifactId>
<version>${osgi.enterprise.version}</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.cmpn</artifactId>
<version>${osgi.compendium.version}</version>
</dependency>
</dependencies>
<modules>
<module>measure</module>
<module>common</module>
Expand Down
2 changes: 1 addition & 1 deletion catalog/solr/catalog-solr-solrclient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<limit implementation="org.codice.jacoco.LenientLimit">
<counter>BRANCH</counter>
<value>COVEREDRATIO</value>
<minimum>0.50</minimum>
<minimum>0.46</minimum>
</limit>
<limit implementation="org.codice.jacoco.LenientLimit">
<counter>COMPLEXITY</counter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.ws.rs.NotFoundException;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.StringUtils;
Expand Down Expand Up @@ -204,6 +205,7 @@ public void refresh(Map<String, Object> properties) {
}

private void setSimilarities() {
boolean updateMetacardCache = true;
if (CollectionUtils.isNotEmpty(fieldTypes)) {
LinkedTreeMap<String, Object> replaceField = new LinkedTreeMap<>();
for (Object fieldType : fieldTypes) {
Expand All @@ -229,11 +231,21 @@ private void setSimilarities() {
solrCatalogSchemaClientFactory.getClient().replaceField(gson.toJson(replaceField));
LOGGER.trace("Catalog Configuration update response: {}", response);

response =
solrMetacardCacheSchemaClientFactory
.getClient()
.replaceField(gson.toJson(replaceField));
LOGGER.trace("Metacard Cache Configuration update response: {}", response);
if (updateMetacardCache) {
try {
response =
solrMetacardCacheSchemaClientFactory
.getClient()
.replaceField(gson.toJson(replaceField));
LOGGER.trace("Metacard Cache Configuration update response: {}", response);
} catch (NotFoundException e) {
updateMetacardCache = false;
LOGGER.debug(
"Skipping metacard cache schema updates because {} failed.",
getSolrMetacardCacheSchemaUrl(),
e);
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import ddf.catalog.data.Metacard;
import ddf.catalog.data.types.Core;
import ddf.catalog.source.UnsupportedQueryException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
Expand Down Expand Up @@ -129,7 +129,7 @@ public class CswCqlFilterTest {
initDefaultCswFilterDelegate(
initCswSourceConfiguration(CswAxisOrder.LON_LAT, CswConstants.CSW_TYPE));

private final Date date = getDate();
private Date date;

private final String propertyName = DEFAULT_PROPERTY_NAME;

Expand Down Expand Up @@ -231,7 +231,7 @@ public class CswCqlFilterTest {

private final String propertyIsEqualToContentType = "type" + SPACE + EQUALS + SPACE + "'myType'";

private final String propertyIsEqualToWithDate = getPropertyIsEqualToWithDate(getDate());
private String propertyIsEqualToWithDate;

private final String propertyIsEqualToWithBoolean =
DEFAULT_PROPERTY_NAME + SPACE + EQUALS + SPACE + TRUE;
Expand Down Expand Up @@ -616,6 +616,8 @@ private static Operation getOperation() {

@Before
public void setup() {
date = getDate();
propertyIsEqualToWithDate = getPropertyIsEqualToWithDate(date);
Hints.putSystemDefault(
Hints.CRS_AUTHORITY_FACTORY,
"org.geotools.referencing.factory.epsg.hsql.ThreadedHsqlEpsgFactory");
Expand Down Expand Up @@ -1499,15 +1501,23 @@ public void testDisjointPropertyOwsBoundingBoxPolygon() throws UnsupportedQueryE
}

private Date getDate() {
String dateString = "Jun 11 2002";
SimpleDateFormat formatter = new SimpleDateFormat("MMM d yyyy");
Date aDate = null;
final String dateString = "Jun 11 2002";

// Define the formatter for the input pattern
java.time.format.DateTimeFormatter formatter =
java.time.format.DateTimeFormatter.ofPattern("MMM dd yyyy", java.util.Locale.ENGLISH);

Date date = null;
// Parse the input date-time with MST, then convert to America/Denver to ensure that
// region-specific rules are applied correctly when parsing
LocalDate localDate;
try {
aDate = formatter.parse(dateString);
} catch (ParseException e) {
localDate = LocalDate.parse(dateString, formatter);
date = Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
}
return aDate;
return date;
}

private String getPropertyIsEqualToWithDate(Date aDate) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@
import java.io.IOException;
import java.io.StringWriter;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
Expand Down Expand Up @@ -140,7 +142,7 @@ public class CswFilterDelegateTest {

private static final String DISTANCE_GEO_FILTER_PROP_MAP_KEY = "distance";

private static final Date SAMPLE_NON_ISO_8601_DATE;
private static Date sampleNonIso8601Date;

// NOTE: The contents of these maps ARE mutable
private static final Map<String, String> POS_LIST_GEO_FILTER_PROP_MAP = new HashMap<>();
Expand All @@ -167,15 +169,6 @@ public class CswFilterDelegateTest {

private static Marshaller marshaller = null;

static {
try {
SAMPLE_NON_ISO_8601_DATE = new SimpleDateFormat("MMM d yyyy").parse("Jun 11 2003");
} catch (ParseException pe) {
LOGGER.error("Unable to instantiate SAMPLE_NON_ISO_8601_DATE", pe);
throw new RuntimeException();
}
}

private final CswFilterDelegate cswFilterDelegateLatLon =
createCswFilterDelegate(
initCswSourceConfiguration(CswAxisOrder.LAT_LON, false, CswConstants.CSW_TYPE));
Expand Down Expand Up @@ -309,7 +302,7 @@ public class CswFilterDelegateTest {
createComparisonFilterString(
ComparisonOperator.PROPERTY_IS_EQUAL_TO,
DEFAULT_PROPERTY_NAME,
convertDateToIso8601Format(SAMPLE_NON_ISO_8601_DATE).toString());
convertDateToIso8601Format(sampleNonIso8601Date).toString());

private final String propertyIsEqualToXmlWithBoolean =
createComparisonFilterString(
Expand Down Expand Up @@ -778,6 +771,27 @@ public static void setupTestClass() throws JAXBException, ParseException {
map.put("ogc", "http://www.opengis.net/ogc");
NamespaceContext ctx = new SimpleNamespaceContext(map);
XMLUnit.setXpathNamespaceContext(ctx);

sampleNonIso8601Date = getNonIso8601Date();
}

private static Date getNonIso8601Date() {
final String dateString = "Jun 11 2003";

java.time.format.DateTimeFormatter formatter =
java.time.format.DateTimeFormatter.ofPattern("MMM dd yyyy", Locale.ENGLISH);

Date date = null;
// Parse the input date-time with MST, then convert to America/Denver to ensure that
// region-specific rules are applied correctly when parsing
LocalDate localDate;
try {
localDate = LocalDate.parse(dateString, formatter);
date = Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
}
return date;
}

private static FilterCapabilities getMockFilterCapabilities() {
Expand Down Expand Up @@ -1518,11 +1532,10 @@ public void testConfigurableMetacardMappingApiso()
public void testPropertyIsEqualToDateLiteral()
throws JAXBException, ParseException, SAXException, IOException {

LOGGER.debug("Input date: {}", SAMPLE_NON_ISO_8601_DATE);
LOGGER.debug(
"ISO 8601 formatted date: {}", convertDateToIso8601Format(SAMPLE_NON_ISO_8601_DATE));
LOGGER.debug("Input date: {}", sampleNonIso8601Date);
LOGGER.debug("ISO 8601 formatted date: {}", convertDateToIso8601Format(sampleNonIso8601Date));
FilterType filterType =
cswFilterDelegateLatLon.propertyIsEqualTo(propertyName, SAMPLE_NON_ISO_8601_DATE);
cswFilterDelegateLatLon.propertyIsEqualTo(propertyName, sampleNonIso8601Date);
assertXMLEqual(propertyIsEqualToXmlWithNonIso8601Date, getXmlFromMarshaller(filterType));
}

Expand Down
5 changes: 3 additions & 2 deletions catalog/spatial/kml/spatial-kml-networklinkendpoint/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
</dependency>
<dependency>
<groupId>de.micromata.jak</groupId>
<artifactId>JavaAPIforKml</artifactId>
<artifactId>javaapiforkml</artifactId>
<version>${JavaAPIforKml.version}</version>
</dependency>
<dependency>
<groupId>ddf.platform</groupId>
Expand Down Expand Up @@ -79,7 +80,7 @@
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Embed-Dependency>
JavaAPIforKml,
javaapiforkml,
catalog-core-api-impl,
handlebars,
antlr4-runtime,
Expand Down
4 changes: 2 additions & 2 deletions catalog/spatial/kml/spatial-kml-transformer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</dependency>
<dependency>
<groupId>de.micromata.jak</groupId>
<artifactId>JavaAPIforKml</artifactId>
<artifactId>javaapiforkml</artifactId>
<version>${JavaAPIforKml.version}</version>
</dependency>
<dependency>
Expand Down Expand Up @@ -128,7 +128,7 @@
commons-lang3,
antlr4-runtime,
catalog-core-api-impl,
JavaAPIforKml,
javaapiforkml,
catalog-core-actions,
spatial-kml-util
</Embed-Dependency>
Expand Down
2 changes: 1 addition & 1 deletion catalog/spatial/kml/spatial-kml-util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<dependencies>
<dependency>
<groupId>de.micromata.jak</groupId>
<artifactId>JavaAPIforKml</artifactId>
<artifactId>javaapiforkml</artifactId>
<version>${JavaAPIforKml.version}</version>
</dependency>
<dependency>
Expand Down
Loading
Loading