diff --git a/back/pom.xml b/back/pom.xml
index e1e15b9..c3625f2 100644
--- a/back/pom.xml
+++ b/back/pom.xml
@@ -20,12 +20,12 @@
kangaroo-and-rabbit
archidata
- 0.15.0
+ 0.19.1-SNAPSHOT
- org.slf4j
- slf4j-simple
- 2.1.0-alpha1
+ ch.qos.logback
+ logback-classic
+ 1.4.11
com.fasterxml.jackson.datatype
diff --git a/back/pom.xml.versionsBackup b/back/pom.xml.versionsBackup
new file mode 100644
index 0000000..5bc7b55
--- /dev/null
+++ b/back/pom.xml.versionsBackup
@@ -0,0 +1,258 @@
+
+
+ 4.0.0
+ org.kar
+ karusic
+ 0.1.0
+
+ 3.1
+ 21
+ 21
+ 3.1.1
+
+
+
+ gitea
+ https://gitea.atria-soft.org/api/packages/kangaroo-and-rabbit/maven
+
+
+
+
+ kangaroo-and-rabbit
+ archidata
+ 0.14.3-SNAPSHOT
+
+
+ org.slf4j
+ slf4j-simple
+ 2.1.0-alpha1
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+ 2.18.0-rc1
+
+
+
+ org.junit.jupiter
+ junit-jupiter-api
+ 5.11.0
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter-engine
+ 5.11.0
+ test
+
+
+ net.revelc.code.formatter
+ formatter-maven-plugin
+ 2.24.1
+
+
+ org.apache.maven.plugins
+ maven-checkstyle-plugin
+ 3.5.0
+
+
+
+ src
+ test/src
+ ${project.basedir}/out/maven/
+
+
+ src/resources
+
+
+
+
+ ${basedir}/test/resources
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ ${maven.compiler.version}
+
+
+ ${maven.compiler.target}
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+ 1.4.0
+
+ org.kar.karusic.WebLauncher
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 3.2.1
+
+
+ attach-sources
+
+ jar
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 3.0.0-M5
+
+
+ maven-assembly-plugin
+
+
+
+ fully.qualified.MainClass
+
+
+
+ jar-with-dependencies
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 3.2.0
+
+ private
+ true
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+ 3.1.0
+
+
+ exec-application
+ package
+
+ java
+
+
+
+
+ org.kar.karusic.WebLauncher
+
+
+
+
+ net.revelc.code.formatter
+ formatter-maven-plugin
+ 2.23.0
+
+ UTF-8
+ LF
+ Formatter.xml
+
+ src/
+ test/src
+
+
+ **/*.java
+
+
+ module-info.java
+
+
+
+
+
+ validate
+
+
+
+
+
+ com.github.spotbugs
+ spotbugs-maven-plugin
+ 4.8.5.0
+
+ spotbugs-security-include.xml
+ spotbugs-security-exclude.xml
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 3.2.0
+
+ public
+
+
+
+
+
diff --git a/back/src/org/kar/karusic/CodecBson/UUIDCodec.java b/back/src/org/kar/karusic/CodecBson/UUIDCodec.java
new file mode 100644
index 0000000..43fb5fb
--- /dev/null
+++ b/back/src/org/kar/karusic/CodecBson/UUIDCodec.java
@@ -0,0 +1,27 @@
+package org.kar.karusic.CodecBson;
+
+import java.util.UUID;
+
+import org.bson.BsonReader;
+import org.bson.BsonWriter;
+import org.bson.codecs.Codec;
+import org.bson.codecs.DecoderContext;
+import org.bson.codecs.EncoderContext;
+
+public class UUIDCodec implements Codec {
+
+ @Override
+ public UUID decode(final BsonReader reader, final DecoderContext decoderContext) {
+ return UUID.fromString(reader.readString());
+ }
+
+ @Override
+ public void encode(final BsonWriter writer, final UUID value, final EncoderContext encoderContext) {
+ writer.writeString(value.toString());
+ }
+
+ @Override
+ public Class getEncoderClass() {
+ return UUID.class;
+ }
+}
\ No newline at end of file
diff --git a/back/src/org/kar/karusic/WebLauncher.java b/back/src/org/kar/karusic/WebLauncher.java
index 25f33f8..71ad576 100755
--- a/back/src/org/kar/karusic/WebLauncher.java
+++ b/back/src/org/kar/karusic/WebLauncher.java
@@ -12,15 +12,17 @@ import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory;
import org.glassfish.jersey.jackson.JacksonFeature;
import org.glassfish.jersey.media.multipart.MultiPartFeature;
import org.glassfish.jersey.server.ResourceConfig;
-import org.kar.archidata.GlobalConfiguration;
import org.kar.archidata.UpdateJwtPublicKey;
import org.kar.archidata.api.DataResource;
import org.kar.archidata.api.ProxyResource;
import org.kar.archidata.catcher.GenericCatcher;
+import org.kar.archidata.db.DbConfig;
+import org.kar.archidata.exception.DataAccessException;
import org.kar.archidata.filter.CORSFilter;
import org.kar.archidata.filter.OptionFilter;
import org.kar.archidata.migration.MigrationEngine;
import org.kar.archidata.tools.ConfigBaseVariable;
+import org.kar.archidata.tools.ContextGenericTools;
import org.kar.karusic.api.AlbumResource;
import org.kar.karusic.api.ArtistResource;
import org.kar.karusic.api.Front;
@@ -35,6 +37,8 @@ import org.kar.karusic.migration.Migration20231126;
import org.kar.karusic.migration.Migration20240225;
import org.kar.karusic.migration.Migration20240226;
import org.kar.karusic.migration.Migration20240907;
+import org.kar.karusic.migration.Migration20250104;
+import org.kar.karusic.migration.Migration20250105;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -63,8 +67,10 @@ public class WebLauncher {
migrationEngine.add(new Migration20240225());
migrationEngine.add(new Migration20240226());
migrationEngine.add(new Migration20240907());
+ migrationEngine.add(new Migration20250104());
+ migrationEngine.add(new Migration20250105());
WebLauncher.LOGGER.info("Migrate the DB [START]");
- migrationEngine.migrateWaitAdmin(GlobalConfiguration.dbConfig);
+ migrationEngine.migrateWaitAdmin(new DbConfig());
WebLauncher.LOGGER.info("Migrate the DB [STOP]");
}
@@ -83,26 +89,26 @@ public class WebLauncher {
public void plop(final String aaa) {
// List available Image Readers
- System.out.println("Available Image Readers:");
+ WebLauncher.LOGGER.trace("Available Image Readers:");
final Iterator readers = ImageIO.getImageReadersByFormatName(aaa);
while (readers.hasNext()) {
final ImageReader reader = readers.next();
- System.out.println("Reader: " + reader.getOriginatingProvider().getDescription(null));
- System.out.println("Reader CN: " + reader.getOriginatingProvider().getPluginClassName());
+ WebLauncher.LOGGER.trace("Reader: " + reader.getOriginatingProvider().getDescription(null));
+ WebLauncher.LOGGER.trace("Reader CN: " + reader.getOriginatingProvider().getPluginClassName());
// ImageIO.deregisterServiceProvider(reader.getOriginatingProvider());
}
// List available Image Writers
- System.out.println("\nAvailable Image Writers:");
+ WebLauncher.LOGGER.trace("\nAvailable Image Writers:");
final Iterator writers = ImageIO.getImageWritersByFormatName(aaa);
while (writers.hasNext()) {
final ImageWriter writer = writers.next();
- System.out.println("Writer: " + writer.getOriginatingProvider().getDescription(null));
- System.out.println("Writer CN: " + writer.getOriginatingProvider().getPluginClassName());
+ WebLauncher.LOGGER.trace("Writer: " + writer.getOriginatingProvider().getDescription(null));
+ WebLauncher.LOGGER.trace("Writer CN: " + writer.getOriginatingProvider().getPluginClassName());
}
}
- public void process() throws InterruptedException {
+ public void process() throws InterruptedException, DataAccessException {
ImageIO.scanForPlugins();
plop("jpeg");
@@ -137,6 +143,8 @@ public class WebLauncher {
rc.register(HealthCheck.class);
rc.register(Front.class);
+ ContextGenericTools.addJsr310(rc);
+
// add jackson to be discover when we are ins standalone server
rc.register(JacksonFeature.class);
// enable this to show low level request
@@ -148,7 +156,7 @@ public class WebLauncher {
// System.out.println(" getDBLogin: '" + ConfigVariable.getDBLogin() + "'");
// System.out.println(" getDBPassword: '" + ConfigVariable.getDBPassword() + "'");
// System.out.println(" getDBName: '" + ConfigVariable.getDBName() + "'");
- System.out.println(" ==> " + GlobalConfiguration.dbConfig);
+ System.out.println(" ==> " + new DbConfig());
System.out.println("OAuth service " + getBaseURI());
this.server = GrizzlyHttpServerFactory.createHttpServer(getBaseURI(), rc);
final HttpServer serverLink = this.server;
diff --git a/back/src/org/kar/karusic/WebLauncherLocal.java b/back/src/org/kar/karusic/WebLauncherLocal.java
index f6ddc5d..7582acb 100755
--- a/back/src/org/kar/karusic/WebLauncherLocal.java
+++ b/back/src/org/kar/karusic/WebLauncherLocal.java
@@ -4,6 +4,7 @@ import java.util.List;
import org.kar.archidata.api.DataResource;
import org.kar.archidata.api.ProxyResource;
+import org.kar.archidata.exception.DataAccessException;
import org.kar.archidata.externalRestApi.AnalyzeApi;
import org.kar.archidata.externalRestApi.TsGenerateApi;
import org.kar.archidata.tools.ConfigBaseVariable;
@@ -43,7 +44,7 @@ public class WebLauncherLocal extends WebLauncher {
}
@Override
- public void process() throws InterruptedException {
+ public void process() throws InterruptedException, DataAccessException {
if (true) {
// for local test:
ConfigBaseVariable.apiAdress = "http://0.0.0.0:19080/karusic/api/";
diff --git a/back/src/org/kar/karusic/api/AlbumResource.java b/back/src/org/kar/karusic/api/AlbumResource.java
index 237dfa3..db3c251 100644
--- a/back/src/org/kar/karusic/api/AlbumResource.java
+++ b/back/src/org/kar/karusic/api/AlbumResource.java
@@ -9,9 +9,9 @@ import org.glassfish.jersey.media.multipart.FormDataParam;
import org.kar.archidata.annotation.AsyncType;
import org.kar.archidata.annotation.FormDataOptional;
import org.kar.archidata.annotation.TypeScriptProgress;
+import org.kar.archidata.dataAccess.DBAccess;
import org.kar.archidata.dataAccess.DataAccess;
-import org.kar.archidata.dataAccess.addOn.AddOnDataJson;
-import org.kar.archidata.dataAccess.addOn.AddOnManyToMany;
+import org.kar.archidata.dataAccess.addOnSQL.AddOnDataJson;
import org.kar.archidata.dataAccess.options.CheckFunction;
import org.kar.archidata.tools.DataTools;
import org.kar.karusic.model.Album;
@@ -41,8 +41,9 @@ public class AlbumResource {
@Path("{id}")
@RolesAllowed("USER")
@Operation(description = "Get a specific Album with his ID")
- public static Album get(@PathParam("id") final Long id) throws Exception {
+ public Album get(@PathParam("id") final Long id) throws Exception {
return DataAccess.get(Album.class, id);
+ // return this.morphiaService.getDatastore().find(Album.class).filter(Filters.eq("id", id)).first();
}
@GET
@@ -50,6 +51,8 @@ public class AlbumResource {
@Operation(description = "Get all the available Albums")
public List gets() throws Exception {
return DataAccess.gets(Album.class);
+ // final Query query = this.morphiaService.getDatastore().find(Album.class);
+ // return query.stream().toList();
}
@POST
@@ -57,6 +60,12 @@ public class AlbumResource {
@Consumes(MediaType.APPLICATION_JSON)
@Operation(description = "Add an album (when all the data already exist)")
public Album post(final Album data) throws Exception {
+ // TODO: how to manage the checker ???
+ // final Album ret = this.morphiaService.getDatastore().save(data);
+ // return ret;
+ /* final MongoCollection