Skip to content

Conversation

@MakuIan
Copy link

@MakuIan MakuIan commented Jan 16, 2026

A user can click on a button with an icon to import a corpus using the corpus importer. He needs to add his path. When the user clicks "Import" the importer starts.

@Myyyvothrr
Copy link
Member

Hallo, danke für den PR, ich habe ihnen ein paar Kommentare hinzugefügt.

Soweit ich sehen konnte haben sie den alten PR (#119) direkt übernommen? Falls ja, bitte in dem vermerken dann kann ich ihn schließen. Haben sie die Funktionalität getestet oder nur ihre Ergänzung über den Pfad?

@MakuIan
Copy link
Author

MakuIan commented Jan 17, 2026

Hallo! Ja, ich habe auf dem alten PR(#119) weitergebaut. Ich habe nur meine Ergaenzungen getestet. Was meinen Sie mit "vermerken"?

Copy link
Member

@Myyyvothrr Myyyvothrr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Habe gerade gesehen dass die Kommentare noch nicht freigeschaltet waren, jetzt sollten sie diese sehen können.

<div class="modal-body">
<form id="importCorpusForm">
<div class="form-group">
<label for="importPath">Source Path (Server-side)</label>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bitte machen sie diese Funktionalität konfigurierbar über die Config. Die meisten Instanzen werden diese Funktion nicht aktivieren da sie entsprechend Zugriff auf den Server benötigt, für einen "normalen" Nutzer ist sie deshalb eher verwirrend.

<button id="saveCasBtn" data-analysis-id="${analysisId}" class="btn btn-primary">Save CAS</button>
<label for="corpus-select-id" class="mb-0">Corpus</label>
<select id="corpus-select-id" class="form-control form-control-sm" style="max-width:200px;">
<option value="1">Corpus 1</option>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Die verfügbaren Corpora bitte direkt über das bereits existierende Corpora-Dropdown oben abrufen, eine separate Angabe hier ist nicht nötig.

HashMap<String, String> spacyUrls = new HashMap<>();
spacyUrls.put("Spacy", "http://spacy-cohmetrix.service.component.duui.texttechnologylab.org");
// spacyUrls.put("Spacy", "http://spacy.service.component.duui.texttechnologylab.org");
// spacyUrls.put("Spacy", "http://spacy-cohmetrix.service.component.duui.texttechnologylab.org");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mevbagci bitte schau mal welche URL hier wirklich verwendet werden soll.

public static AnalysisSession getCachedSession(String analysisId) { return analysisCache.get(analysisId); }

private static String getCurrentUserId() {
// TODO: replace with your auth/session identity
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inzwischen gibt es ein optionales "Permission-System", hier bitte die User-ID (bzw Name) des Keycloak-Logins verwenden.

}
}
}
private static final java.util.concurrent.ScheduledExecutorService scheduler = //Cron job for automatic cleanup every 5 minutes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Es gibt bereits einen "Scheduler" in UCE (achten sie im Log auf die widerkehrenden Messages), bitte hier keinen neuen hinzufügen sondern auf den vorhandenen zugreifen.

List<ModelGroup> groups = modelResources.getGroupedModelObjects();

config.router.apiBuilder(() -> {
before(ctx -> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Die Datei sieht aus als wäre sie lediglich "reformated", bitte rückgängig machen oder kennzeichnen was sie geändert/hinzugefügt haben.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Entschuldigung, mein Auto formatter on Save war auf eine komplette Datei eingestellt und deswegen wurden die indentations "veraendert". Ich habe in die Datei einen neuen Endpoint hinzugefuegt. Wie sollte ich das kennzeichnen?


if (corpusId == null) {
ctx.result("Parameter corpusId didn't exist. Without it, the document cannot be uploaded.");
ctx.status(400);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bitte vorsicht beim Ändern solcher Werte, ist denke ich beim Import OK aber bitte nochmal prüfen.

if (acceptedContentType != null && acceptedContentType.equals("application/json")) {
Map<String, Object> apiResult = new HashMap<>();
apiResult.put("document_id", newDocumentId);
ctx.contentType("application/json");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bitte nochmal prüfen ob dies durch die "ctx.json" Zeile danach nicht unnötig ist, dann besser weglassen.

}

if (path == null || path.isBlank()) {
ctx.status(400).result("Path is required");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"return" fehlt, meines Wissens nach ist dies hier nötig, bitte nochmal überall prüfen.

});
ctx.status(200).result("Import started. Import ID: " + importId);
} catch (DatabaseOperationException e) {
logger.error("Error when creating saving/updating to database" + e);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

status/result fehlt

Mark Ian Braun added 2 commits January 24, 2026 19:14
Das Analyse tool nutzt nun das bereits existierende select zur Auswahl zum Speichern.
getCurrentUserId returned nun die jetzige User id.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants