Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterWarren authored Dec 7, 2023
2 parents a66e965 + e8dab77 commit 5bb84b5
Show file tree
Hide file tree
Showing 26 changed files with 108 additions and 94 deletions.
2 changes: 1 addition & 1 deletion .github/badges/jacoco.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions .github/coverage/jacoco.csv
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Portal-Core,org.auscope.portal.core.services.responses.opendap,SimpleBounds,6,15
Portal-Core,org.auscope.portal.core.services.responses.opendap,SimpleAxis,0,35,0,0,0,14,0,5,0,5
Portal-Core,org.auscope.portal.core.services.responses.opendap,ViewVariableFactory,56,407,14,38,11,78,15,19,1,7
Portal-Core,org.auscope.portal.core.services.responses.opendap,SimpleGrid,13,25,0,0,1,10,1,3,1,3
Portal-Core,org.auscope.portal.core.view.knownlayer,CSWRecordSelector,9,58,0,12,3,18,3,11,3,5
Portal-Core,org.auscope.portal.core.view.knownlayer,CSWRecordSelector,9,100,0,12,3,21,3,11,3,5
Portal-Core,org.auscope.portal.core.view.knownlayer,KMLSelector,11,44,0,6,4,9,3,5,3,2
Portal-Core,org.auscope.portal.core.view.knownlayer,WMSSelectors,34,51,4,2,9,12,5,3,3,2
Portal-Core,org.auscope.portal.core.view.knownlayer,KnownLayerGrouping,8,21,0,0,1,8,1,4,1,4
Expand Down Expand Up @@ -224,8 +224,8 @@ Portal-Core,org.auscope.portal.core.services,SISSVoc3Service,6,203,1,9,2,57,3,11
Portal-Core,org.auscope.portal.core.services,GoogleCloudMonitoringService,190,127,3,7,52,32,10,7,8,4
Portal-Core,org.auscope.portal.core.services,CSWFilterService,211,360,10,18,41,66,12,17,6,9
Portal-Core,org.auscope.portal.core.services,CSWCacheService.CSWCacheUpdateThread,114,901,13,65,24,181,13,34,0,8
Portal-Core,org.auscope.portal.core.services,VocabularyCacheService.VocabularyCacheUpdateThread,0,121,0,6,0,33,0,8,0,5
Portal-Core,org.auscope.portal.core.services,SISSVoc2Service,0,151,2,4,0,35,2,4,0,3
Portal-Core,org.auscope.portal.core.services,VocabularyCacheService.VocabularyCacheUpdateThread,0,121,0,6,0,33,0,8,0,5
Portal-Core,org.auscope.portal.core.services,SearchService,796,0,95,0,137,0,57,0,9,0
Portal-Core,org.auscope.portal.core.services,GoogleCloudMonitoringCachedService.CacheEntry,51,0,0,0,21,0,8,0,8,0
Portal-Core,org.auscope.portal.core.services,VocabularyFilterService,8,345,8,24,2,85,8,21,0,13
Expand Down
2 changes: 1 addition & 1 deletion .github/coverage/percentage.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
63.9316

26 changes: 11 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>org.auscope.portal</groupId>
<artifactId>portal-core</artifactId>
<packaging>jar</packaging>
<version>2.5.0-SNAPSHOT</version>
<version>2.6.0-SNAPSHOT</version>
<name>Portal-Core</name>
<description>Core functionality common to various AuScope portals.</description>
<url>http://portal.auscope.org</url>
Expand Down Expand Up @@ -48,7 +48,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.15</version>
<version>3.1.5</version>
</parent>

<!-- Repositories section -->
Expand Down Expand Up @@ -323,7 +323,7 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20230227</version>
<version>20231013</version>
</dependency>
<dependency>
<!-- Saxon needed for XPath 2 functionality. Java default is only XPath 1 -->
Expand Down Expand Up @@ -403,6 +403,7 @@
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
Expand All @@ -414,18 +415,13 @@
<artifactId>joda-time</artifactId>
<version>2.12.5</version>
</dependency>
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>jena-arq</artifactId>
<version>4.2.0</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>apache-jena-libs</artifactId>
<version>4.10.0</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.github.openstack4j.core</groupId>
<artifactId>openstack4j-core</artifactId>
<version>3.9</version>
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/auscope/portal/core/cloud/CloudJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import java.util.HashMap;
import java.util.Map;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.MappedSuperclass;

/**
* Base class representing the base state of a job that is sent to the cloud for processing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import java.io.OutputStream;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.activation.MimetypesFileTypeMap;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.activation.MimetypesFileTypeMap;
import javax.naming.OperationNotSupportedException;

import org.apache.commons.io.FilenameUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletOutputStream;
import jakarta.servlet.http.HttpServletResponse;

import org.json.JSONObject;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.io.IOException;

import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponse;

import org.auscope.portal.core.configuration.ServiceConfiguration;
import org.auscope.portal.core.configuration.ServiceConfigurationItem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletOutputStream;
import jakarta.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;
import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.ServletOutputStream;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponseWrapper;
import jakarta.servlet.http.HttpServletRequest;

import org.apache.http.HttpStatus;
import org.auscope.portal.core.services.WFSGml32Service;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import java.util.List;

import javax.naming.OperationNotSupportedException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package org.auscope.portal.core.server.http.download;

import org.springframework.web.multipart.commons.CommonsMultipartFile;
import org.springframework.web.multipart.MultipartFile;


public class FileUploadBean {

private CommonsMultipartFile file;
private MultipartFile file;

public CommonsMultipartFile getFile() {
public MultipartFile getFile() {
return file;
}

public void setFile(CommonsMultipartFile file) {
public void setFile(MultipartFile file) {
this.file = file;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import org.auscope.portal.core.services.responses.csw.CSWRecordTransformerFactory;
import org.auscope.portal.core.util.FileIOUtil;
import org.objenesis.strategy.StdInstantiatorStrategy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;

import com.esotericsoftware.kryo.Kryo;

Expand Down Expand Up @@ -84,6 +86,11 @@ public class CSWCacheService {
/** If true, this class will force the usage of HTTP GetMethods instead of POST methods (where possible). Useful workaround for some CSW services */
protected boolean forceGetMethods = false;
protected Date lastCacheUpdate;

// KnownLayerService needs to be informed when indexing is finished, must be @Lazy loaded to avoid circular dependencies
@Autowired
@Lazy
private KnownLayerService knownLayerService;

/**
* Creates a new instance of a CSWKeywordCacheService. This constructor is normally autowired by the spring framework.
Expand Down Expand Up @@ -257,6 +264,10 @@ private synchronized void updateFinished(Map<String, Set<CSWRecord>> newKeywordC
this.keywordsByRegistry = newKeywordByEndpointCache;
}
saveCacheToFile();

// Inform KnownLayerService that there are potentially new CSWRecords
knownLayerService.updateKnownLayersCache();

this.updateRunning = false;
this.lastCacheUpdate = new Date();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import java.util.stream.Stream;

import javax.naming.OperationNotSupportedException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.Arrays;
import java.util.Collection;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;

import org.auscope.portal.core.server.OgcServiceProviderType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@
*/
public class CSWRecordSelector implements KnownLayerSelector {

private String recordId;
private String descriptiveKeyword;
private String serviceName;
private String[] recordIds;
private String[] descriptiveKeywords;
private String[] serviceNames;

/**
* @param descriptiveKeyword
* the descriptive keyword used to identify CSW records
*/
public CSWRecordSelector() {
this.descriptiveKeyword = null;
this.recordId = null;
this.serviceName = null;
this.descriptiveKeywords = new String[0];
this.recordIds = new String[0];
this.serviceNames = new String[0];
}

/**
* Matches a CSWRecord by an exact matching record id
*
* @return record id string
*/
public String getRecordId() {
return recordId;
public String[] getRecordIds() {
return recordIds;
}

/**
Expand All @@ -39,17 +39,17 @@ public String getRecordId() {
* @param recordId record id string
* @return
*/
public void setRecordId(String recordId) {
this.recordId = recordId;
public void setRecordIds(String[] recordIds) {
this.recordIds = recordIds;
}

/**
* Gets the descriptive keyword used to identify CSW records
*
* @return the descriptiveKeyword
*/
public String getDescriptiveKeyword() {
return descriptiveKeyword;
public String[] getDescriptiveKeywords() {
return descriptiveKeywords;
}

/**
Expand All @@ -58,17 +58,17 @@ public String getDescriptiveKeyword() {
* @param descriptiveKeyword
* the descriptiveKeyword to set
*/
public void setDescriptiveKeyword(String descriptiveKeyword) {
this.descriptiveKeyword = descriptiveKeyword;
public void setDescriptiveKeywords(String[] descriptiveKeywords) {
this.descriptiveKeywords = descriptiveKeywords;
}

/**
* Gets the service name (title) used to identify CSW records
*
* @return the service name
*/
public String getServiceName() {
return serviceName;
public String[] getServiceNames() {
return serviceNames;
}

/**
Expand All @@ -77,8 +77,8 @@ public String getServiceName() {
* @param serviceName the service name string to search for in CSW records
*
*/
public void setServiceName(String serviceName) {
this.serviceName = serviceName;
public void setServiceNames(String[] serviceNames) {
this.serviceNames = serviceNames;
}

/**
Expand All @@ -87,18 +87,21 @@ public void setServiceName(String serviceName) {
*/
@Override
public RelationType isRelatedRecord(CSWRecord record) {
if (recordId != null && recordId.equals(record.getFileIdentifier())) {
return RelationType.Belongs;
for (String recordId: recordIds) {
if (recordId.equals(record.getFileIdentifier())) {
return RelationType.Belongs;
}
}

if (descriptiveKeyword != null && record.containsKeyword(descriptiveKeyword)) {
return RelationType.Belongs;
for (String descriptiveKeyword: descriptiveKeywords) {
if (record.containsKeyword(descriptiveKeyword)) {
return RelationType.Belongs;
}
}
for (String serviceName: serviceNames) {
if (serviceName.equals(record.getServiceName())) {
return RelationType.Belongs;
}
}

if (serviceName != null && serviceName.equals(record.getServiceName())) {
return RelationType.Belongs;
}

return RelationType.NotRelated;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import java.util.Map;
import java.util.Set;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.json.JSONArray;
import org.json.JSONObject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponse;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
Expand Down
Loading

0 comments on commit 5bb84b5

Please sign in to comment.