-
Notifications
You must be signed in to change notification settings - Fork 16
Import a corpus from path via the Uce Portal UI #132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…lysis result as cache
removed un-used fields
|
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? |
|
Hallo! Ja, ich habe auf dem alten PR(#119) weitergebaut. Ich habe nur meine Ergaenzungen getestet. Was meinen Sie mit "vermerken"? |
Myyyvothrr
left a comment
There was a problem hiding this 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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 -> { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
status/result fehlt
Das Analyse tool nutzt nun das bereits existierende select zur Auswahl zum Speichern. getCurrentUserId returned nun die jetzige User id.
…ew corpora or a already uploaded corpora.
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.