Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into cloud-deployment
  • Loading branch information
florislangeraert committed Dec 5, 2024
2 parents 27fd7ae + 1acfe16 commit cc0efa9
Show file tree
Hide file tree
Showing 31 changed files with 1,059 additions and 34 deletions.
9 changes: 6 additions & 3 deletions frontend/components/GeometryDraw.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ import { Circle, MapPin, Pentagon, Spline, Trash2 } from "lucide-vue-next"
let geoJson = new GeoJSON()
let projection = ref("EPSG:3857")
let projection = ref("EPSG:4326")
let { onValueChange, initialValue } = defineProps<{
onValueChange?: (newValue: FeatureCollection) => void
initialValue?: FeatureCollection
readOnly: Boolean
}>()
let initialFeatures = geoJson.readFeatures(initialValue, {
featureProjection: "EPSG:4326",
dataProjection: "EPSG:3857",
dataProjection: "EPSG:4326",
})
let center = ref([0, 0])
Expand Down Expand Up @@ -47,7 +48,7 @@ function onChange(event) {
let features = event.target.getFeatures()
let featureCollection = geoJson.writeFeaturesObject(features, {
dataProjection: "EPSG:4326",
featureProjection: "EPSG:3857",
featureProjection: "EPSG:4326",
})
onValueChange?.(featureCollection)
}
Expand Down Expand Up @@ -76,6 +77,7 @@ function selectDrawType(type: "Point" | "Polygon" | "Circle") {
<div class="absolute top-0 right-0 z-10 p-3 flex flex-col gap-2">
<div class="flex flex-col">
<Button
v-if="!readOnly"
variant="outline"
size="icon"
type="button"
Expand All @@ -101,6 +103,7 @@ function selectDrawType(type: "Point" | "Polygon" | "Circle") {
<!-- <Circle class="w-4 h-4" />-->
<!-- </Button>-->
<Button
v-if="!readOnly"
variant="outline"
size="icon"
type="button"
Expand Down
13 changes: 2 additions & 11 deletions frontend/pages/admin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,9 @@
Admin
</h3>
<p class="text-sm text-muted-foreground">
Administration of catalogues, collections and permissions.
Administration of collections and permissions.
</p>
<div class="grid grid-cols-3 gap-4 pt-8">
<Card class="flex flex-col">
<CardHeader>
<CardTitle>Catalogue</CardTitle>
<CardDescription>Administration of catalogues</CardDescription>
</CardHeader>
<CardFooter class="mt-auto">
<Button>Admin catalogue</Button>
</CardFooter>
</Card>
<div class="grid grid-cols-2 gap-4 pt-8">
<Card class="flex flex-col">
<CardHeader>
<CardTitle>Collections</CardTitle>
Expand Down
47 changes: 27 additions & 20 deletions frontend/pages/items/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -184,34 +184,39 @@ let formSchema = toTypedSchema(
.transform((v) => {
return new Date(v).toISOString()
}),
spatialReferenceSystem: z.string(),
dataQualityInfoStatement: z.string(),
dataQualitInfoScore: z.string().default("dataSet"),
spatialReferenceSystem: z
.string()
.default(feature?.properties.spatialReferenceSystem),
dataQualityInfoStatement: z
.string()
.default(feature?.properties.dataQualityInfoStatement),
dataQualityInfoScore: z.string().default("dataSet"),
dateType: z.string().optional().default("publication"),
legalRestrictions: z.string().default("license"),
restrictionsOfUse: z.string().default(""),
legalRestrictions: z
.string()
.default(
feature ? feature.properties.legalRestrictions : "license",
),
restrictionsOfUse: z
.string()
.default(feature?.properties.restrictionsOfUse),
metadataStandardName: z.string().default("ISO 19115"),
metadataStandardVersion: z.string().default("2.1.0"),
progressCode: z.string().optional().default("completed"),
language: z.string().default("eng"),
progressCode: z.string().default("completed"),
language: z
.string()
.default(feature ? feature.properties.language : "eng"),
hierarchyLevel: z.string().default("dataSet"),
originatorDataEmail: z.string(),
originatorDataEmail: z
.string()
.default(feature?.properties.originatorDataEmail),
originatorDataRoleCode: z.string().default("originator"),
originatorDataOrganisation: z.string().default("Deltares"),
originatorMetaDataOrganisation: z
.string()
.optional()
.default("Deltares"),
originatorMetaDataOrganisation: z.string().default("Deltares"),
originatorMetaDataEmail: z.string().default(userData.value.email),
originatorMetaDataRoleCode: z
.string()
.optional()
.default("originator"),
originatorMetaDataRoleCode: z.string().default("originator"),
metaDataLanguage: z.string().default("eng"),
metaDataDateTime: z.date().default(new Date()),
storagelocation: z
.string()
.default(feature?.properties.storagelocation),
created: z.string().nullable().optional(),
updated: z.string().nullable().optional(),
start_datetime: z.string().nullable().optional(),
Expand Down Expand Up @@ -328,7 +333,6 @@ let onSubmit = form.handleSubmit(async (values) => {
newItem.bbox = newItem.geometry ? bbox(newItem.geometry) : undefined
}
console.log(newItem)
let data = await $api(url, {
method: update ? "put" : "post",
body: newItem,
Expand Down Expand Up @@ -718,6 +722,7 @@ function getDisplayTime() {
<div class="container mx-auto">
<ClientOnly>
<GeometryDraw
:read-only="readOnly != ''"
:initialValue="geometry"
@valueChange="setValue"
/>
Expand Down Expand Up @@ -821,6 +826,7 @@ function getDisplayTime() {
</FormField>

<Button
v-if="!readOnly"
type="button"
@click="removeAsset(id)"
variant="outline"
Expand All @@ -832,6 +838,7 @@ function getDisplayTime() {
</div>
<div>
<Button
v-if="!readOnly"
@click="addAsset"
variant="outline"
class="mt-5"
Expand Down
3 changes: 3 additions & 0 deletions migrationtool/migrate.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set PATH=%PATH%;%CD%/jdk17/bin
set JAVA_HOME=%CD%/jdk17
java -jar migrate.jar
26 changes: 26 additions & 0 deletions migrationtool/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>migratieFDF</artifactId>

<version>1.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>

<name>Archetype - migratieFDF</name>

<url>http://maven.apache.org</url>

<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.15.3</version>
</dependency>
</dependencies>

</project>
2 changes: 2 additions & 0 deletions migrationtool/src/main/java/Assets.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
public class Assets {
}
11 changes: 11 additions & 0 deletions migrationtool/src/main/java/Coordinates.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
public class Coordinates {
private double[][] values;

public Coordinates(double[][] values) {
this.values = values;
}

public double[][] getValues() {
return values;
}
}
114 changes: 114 additions & 0 deletions migrationtool/src/main/java/DataSet.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
import java.util.ArrayList;

public class DataSet {
private ArrayList<String> subjects = new ArrayList<>();//done
private String title;//done
private String creator;
private String description;//done
private String publisher;
private String date;
private String modified;
private String type;
private String format;
private String source;
private String language;
private String rights;
private String coverage;//done

public ArrayList<String> getSubjects() {
return subjects;
}

public String getTitle() {
return title;
}

public String getCreator() {
return creator;
}

public void setSubjects(ArrayList<String> subjects) {
this.subjects = subjects;
}

public String getModified() {
return modified;
}

public void setModified(String modified) {
this.modified = modified;
}

public String getDescription() {
return description;
}

public String getPublisher() {
return publisher;
}

public String getDate() {
return date;
}

public String getType() {
return type;
}

public String getFormat() {
return format;
}

public String getSource() {
return source;
}

public String getLanguage() {
return language;
}

public String getRights() {
return rights;
}

public String getCoverage() {
return coverage;
}

public void addSubject(String subject) {
subjects.add(subject);
}
public void setTitle(String title){
this.title = title;
}
public void setCreator(String creator){
this.creator = creator;
}
public void setDescription(String description){
this.description = description;
}
public void setPublisher(String publisher){
this.publisher = publisher;
}
public void setDate(String date){
this.date = date;
}
public void setType(String type){
this.type = type;
}
public void setFormat(String format){
this.format = format;
}
public void setSource(String source){
this.source = source;
}
public void setLanguage(String language){
this.language = language;
}
public void setRights(String rights){
this.rights = rights;
}
public void setCoverage(String coverage){
this.coverage = coverage;
}
}
70 changes: 70 additions & 0 deletions migrationtool/src/main/java/DataSetCollector.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import java.util.ArrayList;
import java.util.List;

public class DataSetCollector {
private ArrayList<DataSet> dataSets = new ArrayList<>();
private DataSet dataSet;

public ArrayList<DataSet> getDataSets() {
return dataSets;
}

public DataSet createNewDataSet() {
if (dataSet != null) {
dataSets.add(dataSet);
}
dataSet = new DataSet();
return dataSet;
}

public void addSubject(String subject) {
dataSet.addSubject(subject);
}

public void setTitle(String title) {
dataSet.setTitle(title);
}

public void setCreator(String creator) {
dataSet.setCreator(creator);
}

public void setDescription(String description) {
dataSet.setDescription(description);
}

public void setPublisher(String publisher) {
dataSet.setPublisher(publisher);
}

public void setDate(String date) {
dataSet.setDate(date);
}
public void setModified(String date){
dataSet.setModified(date);
}

public void setType(String type) {
dataSet.setType(type);
}

public void setFormat(String format) {
dataSet.setFormat(format);
}

public void setSource(String source) {
dataSet.setSource(source);
}

public void setLanguage(String language) {
dataSet.setLanguage(language);
}

public void setRights(String rights) {
dataSet.setRights(rights);
}

public void setCoverage(String coverage) {
dataSet.setCoverage(coverage);
}
}
Loading

0 comments on commit cc0efa9

Please sign in to comment.