Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AUS 4238: Remove unused APIs #172

Merged
merged 16 commits into from
Oct 18, 2024
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
7 changes: 0 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,6 @@
</exclusions>
</dependency>

<dependency>
<groupId>com.jhlabs</groupId>
<artifactId>javaproj</artifactId>
<version>1.0</version>
</dependency>

<!-- This is a dummy database used for development only -->
<dependency>
<groupId>org.hsqldb</groupId>
Expand Down Expand Up @@ -270,7 +264,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>false</fork>
<image>
<env>
<BP_JVM_VERSION>17.*</BP_JVM_VERSION>
Expand Down
20 changes: 0 additions & 20 deletions src/main/java/org/auscope/portal/server/config/AppContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import org.auscope.portal.core.services.VocabularyCacheService;
import org.auscope.portal.core.services.VocabularyFilterService;
import org.auscope.portal.core.services.WCSService;
import org.auscope.portal.core.services.WFSGml32Service;
import org.auscope.portal.core.services.WFSService;
import org.auscope.portal.core.services.WMSService;
import org.auscope.portal.core.services.csw.CSWServiceItem;
Expand All @@ -54,7 +53,6 @@
import org.auscope.portal.mscl.MSCLWFSService;
import org.auscope.portal.server.web.CatalogServicesHealthIndicator;
import org.auscope.portal.server.web.SearchHttpServiceCaller;
import org.auscope.portal.server.web.service.SimpleWfsService;
import org.auscope.portal.server.web.service.monitor.KnownLayerStatusMonitor;
import org.quartz.Trigger;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -139,19 +137,6 @@ public WFSService wfsService() {
return new WFSService(httpServiceCallerApp(), methodMaker(), new GmlToHtml());
}

@Bean
public WFSGml32Service wfsGml32Service() {
WFSGetFeatureMethodMaker methodMaker = new WFSGetFeatureMethodMaker();
// give it a ERML 2.0 namespace context
methodMaker.setNamespaces(new ErmlNamespaceContext("2.0"));
// HttpServiceCaller will ignore SSL errors if the test profile is active (locally signed SSL certs)
return new WFSGml32Service(new HttpServiceCaller(900000, activeProfile.contains("test")),
methodMaker,
// can instantiate with a different XSLT for GML 32 mapping?
new GmlToHtml()
);
}

/***
* Returns a factory to create jobs that update the OpenStack service status
* for known layer services
Expand Down Expand Up @@ -309,11 +294,6 @@ public WFSGetFeatureMethodMaker wfsMethodMaker() {
@Autowired
VocabularyServiceItem vocabularyGeologicTimescales;

@Bean
public SimpleWfsService simpleWfsService() {
return new SimpleWfsService(httpServiceCallerApp(), wfsMethodMaker());
}

@Autowired
VocabularyServiceItem vocabularyCommodities;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ KnownLayer annotateLayer(String id) {
case "initialBBox": {
JSONArray bboxGeoJson = new JSONArray();

ArrayList x2 = (ArrayList) v1;
ArrayList x3 = (ArrayList) ((ArrayList) v1).get(0);
int len = x3.size();
if (len == 4) {
Expand Down Expand Up @@ -564,9 +563,6 @@ else if (cswKey.startsWith("serviceNames")) {
if (sk2.startsWith("options")) {
ArrayList x2 = (ArrayList) sv2;
x2.forEach((item) -> {
ArrayList x3 = (ArrayList) item;
String i1 = (String) x3.get(0);
String i2 = (String) x3.get(1);
filter.selectlist.options.add(item);
});
}
Expand All @@ -585,9 +581,6 @@ else if (cswKey.startsWith("serviceNames")) {
if (sk2.startsWith("options")) {
ArrayList x2 = (ArrayList) sv2;
x2.forEach((item) -> {
ArrayList x3 = (ArrayList) item;
String i1 = (String) x3.get(0);
String i2 = (String) x3.get(1);
filter.mandatorylist.options.add(item);
});
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,41 +26,7 @@ public class GenericController extends BasePortalController {
public GenericController(GenericService genericService) {
this.genericService = genericService;
}
/**
* Handles getting the filter of the generic borehole queries. (If the bbox elements are specified, they will limit the output response to 200 records
* implicitly)
*
* @param bbox
* @param optionalFilters
* @throws Exception
*/
@RequestMapping("/doGenericFilter.do")
public void doGenericFilter(
HttpServletResponse response,
@RequestParam(required = false, value = "bbox") String bboxJson,
@RequestParam(required = true, value = "optionalFilters") String optionalFilters)

throws Exception {

FilterBoundingBox bbox = FilterBoundingBox.attemptParseFromJSON(bboxJson);
response.setContentType("text/xml");
String filter = "";
if (optionalFilters != null) {
filter = this.genericService.getFilter(bbox,optionalFilters);
filter = filter.replace("<ogc:Filter>","<ogc:Filter xmlns:ogc=\"http://www.opengis.net/ogc\" xmlns:gml=\"http://www.opengis.net/gml\">");

//<ogc:PropertyIsLike escapeChar="!" singleChar="#" matchCase="false" wildCard="*" ><ogc:PropertyName>DOCUMENT_SPEC_ID</ogc:PropertyName><ogc:Literal>*PR4535*</ogc:Literal></ogc:PropertyIsLike>
// remove matchCase from propertyIsLike because getFeature don't like it.
filter = filter.replace("PropertyIsLike escapeChar=\"!\" singleChar=\"#\" matchCase=\"false\"","PropertyIsLike escapeChar=\"!\" singleChar=\"#\" ");
}
ByteArrayInputStream styleStream = new ByteArrayInputStream(filter.getBytes());
OutputStream outputStream = response.getOutputStream();

FileIOUtil.writeInputToOutputStream(styleStream, outputStream, 1024, false);

styleStream.close();
outputStream.close();
}
/**
* Handles getting the style of the generic borehole filter queries. (If the bbox elements are specified, they will limit the output response to 200 records
* implicitly)
Expand Down Expand Up @@ -118,7 +84,7 @@ public void doGenericFilterStyle(
* @param styleColor 1-1 correspondance with filters - The CSS color for each filter to be symbolised with
* @return
*/
public String getStyle(String filter, String layerName, String spatialPropertyName, String styleType, String styleColor) {
private String getStyle(String filter, String layerName, String spatialPropertyName, String styleType, String styleColor) {
String header = "<sld:StyledLayerDescriptor version=\"1.0.0\" xmlns:gsmlp=\"http://xmlns.geosciml.org/geosciml-portrayal/4.0\" xsi:schemaLocation=\"http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd\" xmlns:ogc=\"http://www.opengis.net/ogc\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:gml=\"http://www.opengis.net/gml\" xmlns:gsml=\"urn:cgi:xmlns:CGI:GeoSciML:2.0\" xmlns:sld=\"http://www.opengis.net/sld\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">"
+ "<sld:NamedLayer>" + "<sld:Name>" + layerName + "</sld:Name>" + "<sld:UserStyle>" + "<sld:Name>portal-style</sld:Name>"
+ "<sld:FeatureTypeStyle>";
Expand Down Expand Up @@ -158,7 +124,7 @@ public String getStyle(String filter, String layerName, String spatialPropertyNa
* @param styleColor 1-1 correspondance with filters - The CSS color for each filter to be symbolised with
* @return
*/
public String getStyleWithLabel(String filter, String layerName, String spatialPropertyName, String styleType, String styleColor, String labelProperty) {
private String getStyleWithLabel(String filter, String layerName, String spatialPropertyName, String styleType, String styleColor, String labelProperty) {
String header = "<sld:StyledLayerDescriptor version=\"1.0.0\" xmlns:gsmlp=\"http://xmlns.geosciml.org/geosciml-portrayal/4.0\" xsi:schemaLocation=\"http://www.opengis.net/sld StyledLayerDescriptor.xsd\" xmlns:ogc=\"http://www.opengis.net/ogc\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:gml=\"http://www.opengis.net/gml\" xmlns:gsml=\"urn:cgi:xmlns:CGI:GeoSciML:2.0\" xmlns:sld=\"http://www.opengis.net/sld\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">"
+ "<sld:NamedLayer>" + "<sld:Name>" + layerName + "</sld:Name>" + "<sld:UserStyle>" + "<sld:Name>portal-style</sld:Name>"
+ "<sld:FeatureTypeStyle>";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,38 +57,6 @@ public class MSCLController extends BasePortalController {
public MSCLController(MSCLWFSService msclWfsService) {
this.msclWfsService = msclWfsService;
}

/**
* Retrieves MCSL observations in JSON format
*
* @param serviceUrl
* The URL of the WFS's endpoint. It should be of the form: http://{domain}:{port}/{path}/wfs
* @param featureType
* The name of the feature type you wish to request (including its prefix if necessary).
* @param featureId
* The ID of the feature you want to return.
* @return A ModelAndView object encapsulating the WFS response along with an indicator of success or failure.
* @throws Exception
*/
@RequestMapping("/getMsclObservations.do")
public ModelAndView getMsclObservations(
@RequestParam("serviceUrl") final String serviceUrl,
@RequestParam("typeName") final String featureType,
@RequestParam("featureId") final String featureId) {

try {
String wfsResponse = msclWfsService.getWFSReponse(serviceUrl,
featureType, featureId);

// I have to wrap this response in a 'gml' JSON tag in order
// to keep the "Download Feature" part happy.
ModelMap data = new ModelMap();
data.put("gml", wfsResponse);
return generateJSONResponseMAV(true, data, null);
} catch (Exception e) {
return generateJSONResponseMAV(false, null, e.getMessage());
}
}

/**
* Retrieves MCSL observations in JSON format for use in a graph
Expand Down
Loading
Loading