Skip to content

Commit

Permalink
fix: local aeon testing endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominick Leppich committed Dec 5, 2024
1 parent 4d2e573 commit ee1a458
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 8 deletions.
10 changes: 10 additions & 0 deletions module-api/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.goobi.workflow.plugin</groupId>
<artifactId>plugin-workflow-aeon-process-creation</artifactId>
<version>24.12-SNAPSHOT</version>
</parent>
<artifactId>plugin-workflow-aeon-process-creation-api</artifactId>
<packaging>jar</packaging>
</project>
20 changes: 20 additions & 0 deletions module-api/src/main/java/org/goobi/api/rest/TestEndpoint.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.goobi.api.rest;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

/*
* Very simple rest api: returns JSON string with pseudo data
*/

@Path("/testingRest")
public class TestEndpoint {
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("aeon")
public String returnAeonJSON() {
return "{\"transactionNumber\":286670,\"creationDate\":\"2021-07-23T19:18:39\",\"photoduplicationStatus\":1162,\"photoduplicationDate\":\"2021-07-23T19:23:09.947\",\"transactionStatus\":28,\"transactionDate\":\"2022-02-15T14:41:37.17\",\"customFieldValues\":{\"UseRestrictionNote\":null,\"ExtentPhysicalDescription\":null,\"RestrictionCode\":null,\"DigitalObjectID\":null,\"TopContainerURI\":null,\"LocationURI\":null,\"CollectionTitle\":null,\"Copy\":null,\"RootRecordURL\":null,\"Folder\":null,\"ERENotes\":null},\"requestFor\":{\"type\":\"Activity\",\"reference\":\"3938\"},\"username\":\"YALE\\\\jam384\",\"appointmentID\":null,\"bundleID\":null,\"callNumber\":\"MSS 73\",\"documentType\":\"Manuscript\",\"eadNumber\":\"https://puitestarchivesspace.library.yale.edu/repositories/6/archival_objects/2544864\",\"format\":\"PDF (reference use)\",\"forPublication\":false,\"itemAuthor\":\"Weigl, Karl, 1881-1949\",\"itemCitation\":\"\",\"itemDate\":\"\",\"itemEdition\":\"Folders 833-834\",\"itemInfo1\":\"Y\",\"itemInfo2\":\"MUS\",\"itemInfo3\":null,\"itemInfo4\":null,\"itemInfo5\":\"This is restricted\",\"itemIssue\":\"Series 4\",\"itemISxN\":null,\"itemNumber\":null,\"itemPages\":\"1-10\",\"itemPlace\":null,\"itemPublisher\":null,\"itemSubTitle\":\"Publishers' works lists\",\"itemTitle\":\"The Karl Weigl Papers\",\"itemVolume\":\"Box 26\",\"location\":\"lsfmusr\",\"maxCost\":null,\"pageCount\":null,\"referenceNumber\":\"39002058721078\",\"scheduledDate\":\"2021-07-28T04:00:00\",\"serviceLevel\":\"Standard\",\"shippingOption\":\"(DRMS) Book & Paper\",\"site\":\"MUS\",\"specialRequest\":null,\"subLocation\":null,\"systemID\":\"ArchivesSpace\",\"webRequestForm\":\"GenericRequestManuscript\"}";
}
}
8 changes: 7 additions & 1 deletion module-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
<dependency>
<groupId>io.goobi.workflow.plugin</groupId>
<artifactId>plugin-workflow-aeon-process-creation-lib</artifactId>
<version>24.06</version>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.goobi.workflow.plugin</groupId>
<artifactId>plugin-opac-json-lib</artifactId>
<version>24.12-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.MediaType;

import de.sub.goobi.forms.HelperForm;
import org.apache.commons.configuration.HierarchicalConfiguration;
import org.apache.commons.configuration.XMLConfiguration;
import org.apache.commons.configuration.tree.xpath.XPathExpressionEngine;
Expand Down Expand Up @@ -204,7 +205,7 @@ public void sendRequest() {

if ("1234567890".equals(this.input)) { //(JUST FOR TESTING: checks if input is 1234567890)
try {
map = client.target("http://localhost:8080/goobi/api/")
map = client.target("http://localhost:8080" + new HelperForm().getApplicationWebsiteUrl() + "api/")
.path("testingRest")
.path("aeon")
.request(MediaType.APPLICATION_JSON)
Expand Down
7 changes: 1 addition & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<module>module-base</module>
<module>module-gui</module>
<module>module-lib</module>
<module>module-api</module>
</modules>
<repositories>
<repository>
Expand All @@ -27,11 +28,5 @@
<version>${project.version}</version>
<classifier>classes</classifier>
</dependency>
<dependency>
<groupId>io.goobi.workflow.plugin</groupId>
<artifactId>plugin-opac-json-lib</artifactId>
<version>24.06</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

0 comments on commit ee1a458

Please sign in to comment.