Skip to content

Commit

Permalink
Merge pull request #130 from aodn/features/platform-n-organisation-se…
Browse files Browse the repository at this point in the history
…arch

Features/platform n organisation search
  • Loading branch information
vietnguyengit authored Sep 6, 2024
2 parents 502aa98 + 5f97512 commit 115e38e
Show file tree
Hide file tree
Showing 1,595 changed files with 35,686 additions and 3,144 deletions.
16 changes: 16 additions & 0 deletions ardcvocabs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>org.skyscreamer</groupId>
<artifactId>jsonassert</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand All @@ -69,6 +74,17 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package au.org.aodn.ardcvocabs.configuration;

import au.org.aodn.ardcvocabs.service.ArdcVocabsService;
import au.org.aodn.ardcvocabs.service.ArdcVocabService;
import au.org.aodn.ardcvocabs.service.ArdcVocabServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;
Expand All @@ -9,13 +10,13 @@

@Slf4j
@AutoConfiguration // More expressive vs @Configuration
@ConditionalOnMissingBean(ArdcVocabsService.class)
@ConditionalOnMissingBean(ArdcVocabService.class)
public class ArdcAutoConfiguration {

@Bean
public ArdcVocabsService createArdcVocabsService() {
public ArdcVocabService createArdcVocabsService(RestTemplate restTemplate) {
log.info("Create ArdcVocabsService");
return new ArdcVocabsService();
return new ArdcVocabServiceImpl(restTemplate);
}
/**
* In case the one who use this lib have not created it.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package au.org.aodn.ardcvocabs.model;

import lombok.Getter;

@Getter
public enum VocabApiPaths {
PARAMETER_VOCAB(
"/aodn-parameter-category-vocabulary/version-2-1/concept.json",
"/aodn-parameter-category-vocabulary/version-2-1/resource.json?uri=%s",
"/aodn-discovery-parameter-vocabulary/version-1-6/concept.json",
"/aodn-discovery-parameter-vocabulary/version-1-6/resource.json?uri=%s"
),
PLATFORM_VOCAB(
"/aodn-platform-category-vocabulary/version-1-2/concept.json",
"/aodn-platform-category-vocabulary/version-1-2/resource.json?uri=%s",
"/aodn-platform-vocabulary/version-6-1/concept.json",
"/aodn-platform-vocabulary/version-6-1/resource.json?uri=%s"
),
ORGANISATION_VOCAB(
"/aodn-organisation-category-vocabulary/version-2-5/concept.json",
"/aodn-organisation-category-vocabulary/version-2-5/resource.json?uri=%s",
"/aodn-organisation-vocabulary/version-2-5/concept.json",
"/aodn-organisation-vocabulary/version-2-5/resource.json?uri=%s"
);

private final String vocabCategoryApiPath;
private final String vocabCategoryDetailsApiPath;
private final String vocabApiPath;
private final String vocabDetailsApiPath;

VocabApiPaths(String vocabCategoryApiPath, String vocabCategoryDetailsApiPath, String vocabApiPath, String vocabDetailsApiPath) {
this.vocabCategoryApiPath = vocabCategoryApiPath;
this.vocabCategoryDetailsApiPath = vocabCategoryDetailsApiPath;
this.vocabApiPath = vocabApiPath;
this.vocabDetailsApiPath = vocabDetailsApiPath;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
import lombok.Builder;
import lombok.Data;

import java.util.List;

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ArdcVocabModel {
public class VocabDto {
// properties are extendable (e.g platformVocabs, organisationVocabs etc.), currently just parameterVocabs.
@JsonProperty("parameter_vocab")
ParameterVocabModel parameterVocabModel;
VocabModel parameterVocabModel;

@JsonProperty("platform_vocab")
VocabModel platformVocabModel;

@JsonProperty("organisation_vocab")
VocabModel organisationVocabModel;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package au.org.aodn.ardcvocabs.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.*;

import java.util.List;

@Builder
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class VocabModel {
protected String label;
protected String definition;
protected String about;
protected List<VocabModel> broader;
protected List<VocabModel> narrower;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package au.org.aodn.ardcvocabs.service;

import au.org.aodn.ardcvocabs.model.VocabApiPaths;
import au.org.aodn.ardcvocabs.model.VocabModel;

import java.util.List;

public interface ArdcVocabService {
List<VocabModel> getVocabTreeFromArdcByType(VocabApiPaths vocabApiPaths);
}
Loading

0 comments on commit 115e38e

Please sign in to comment.