Merge branch 'main' into module/wiki

This commit is contained in:
2025-09-12 00:41:58 +02:00
31 changed files with 180 additions and 215 deletions

View File

@@ -22,6 +22,7 @@ import static de.srsoftware.umbrella.core.Constants.FIELD_PRICE_FORMAT;
import static de.srsoftware.umbrella.core.Constants.FIELD_TIME_ID;
import static de.srsoftware.umbrella.core.Constants.FIELD_TYPE;
import static de.srsoftware.umbrella.core.Constants.FIELD_UNIT;
import static de.srsoftware.umbrella.core.ModuleRegistry.*;
import static de.srsoftware.umbrella.core.Paths.*;
import static de.srsoftware.umbrella.core.ResponseCode.HTTP_UNPROCESSABLE;
import static de.srsoftware.umbrella.core.Util.mapValues;
@@ -76,11 +77,12 @@ public class DocumentApi extends BaseHandler implements DocumentService {
private final Configuration config;
private final DocumentDb db;
public DocumentApi(ModuleRegistry registry, Configuration config) throws UmbrellaException {
super(registry);
public DocumentApi(Configuration config) throws UmbrellaException {
super();
this.config = config;
var dbFile = config.get(CONFIG_DATABASE).orElseThrow(() -> missingFieldException(CONFIG_DATABASE));
db = new SqliteDb(connect(dbFile));
ModuleRegistry.add(this);
Optional<String> templates = config.get(CONFIG_TEMPLATES);
if (templates.isEmpty()) throw missingFieldException(CONFIG_TEMPLATES);