Skip to content

Commit

Permalink
#550 Added ApiPath interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Possommi committed Jun 18, 2024
1 parent 545b780 commit 297c172
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package de.uni_jena.thunibib.his.api.v1.cs.sys.values;

public interface ApiPath {
String getPath();
}

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
* Path: <code>/api/v1/cs/sys/values/languageValue</code>
* */
public class LanguageValue {
public class LanguageValue implements ApiPath {
@JsonProperty("id")
int id;
@JsonProperty("lockVersion")
Expand Down Expand Up @@ -59,4 +59,9 @@ public String getIso6391() {
public String toString() {
return id + ":" + uniqueName;
}

@Override
public String getPath() {
return "cs/sys/values/languageValue";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
* Path: <code>/api/v1/cs/sys/values/publicationCreatorTypeValue</code>
* */
public class PublicationCreatorTypeValue extends SysValue {
@Override
public String getPath() {
return "cs/sys/values/publicationCreatorTypeValue";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* Path: <code>/api/v1/cs/sys/values/publicationTypeValue</code>
* */
public class PublicationTypeValue extends SysValue {
public PublicationTypeValue() {
@Override
public String getPath() {
return "cs/sys/values/publicationTypeValue";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
* Path: <code>api/v1/cs/sys/values/qualificationThesisValue</code>
* */
public class QualificationThesisValue extends SysValue{
@Override
public String getPath() {
return "cs/sys/values/qualificationThesisValue";
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package de.uni_jena.thunibib.his.api.v1.cs.sys.values;

/**
* Path: <code>/api/v1/cs/sys/values/researchAreaKdsfValue</code>
* */
public class ResearchAreaKdsfValue extends SysValue{

public class ResearchAreaKdsfValue extends SysValue {
@Override
public String getPath() {
return "cs/sys/values/researchAreaKdsfValue";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
* Path: <code>api/v1/cs/sys/values/subjectAreaValue</code>
* */
public class SubjectAreaValue extends SysValue {
@Override
public String getPath() {
return "cs/sys/values/subjectAreaValue";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

abstract public class SysValue {
abstract public class SysValue implements ApiPath {
@JsonProperty("id")
private int id;
@JsonProperty("lockVersion")
Expand Down Expand Up @@ -76,6 +76,12 @@ public int getHisKeyId() {
return -1;
}

@Override
public String getPath() {
return null;
}

@Override
public int getId() {
return -1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@
* Path: <code>/api/v1/cs/sys/values/visibilityValue</code>
* */
public class VisibilityValue extends SysValue {

@Override
public String getPath() {
return "cs/sys/values/visibilityValue";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
* Path: <code>fs/res/publication/documentTypes/&lt;book | article&gt;</code>
* */
public class DocumentType extends SysValue {
@Override
public String getPath() {
return "fs/res/publication/documentTypes/book";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@
* Path: <code>fs/res/publication/globalIdentifierType</code>
* */
public class GlobalIdentifierType extends SysValue {

@Override
public String getPath() {
return "fs/res/publication/globalIdentifierType";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* Path: <code>/api/v1/fs/res/state/publication</code>
* */
public class PublicationState extends SysValue {
public PublicationState() {
@Override
public String getPath() {
return "fs/res/state/publication";
}
}
22 changes: 0 additions & 22 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,6 @@

<build>
<plugins>
<plugin>
<groupId>com.github.ekryd.sortpom</groupId>
<artifactId>sortpom-maven-plugin</artifactId>
<executions>
<execution>
<id>verify-sort-pom</id>
<goals>
<goal>sort</goal>
</goals>
<phase>validate</phase>
<configuration>
<createBackupFile>false</createBackupFile>
<expandEmptyElements>false</expandEmptyElements>
<spaceBeforeCloseEmptyElement>true</spaceBeforeCloseEmptyElement>
<keepBlankLines>true</keepBlankLines>
<sortDependencies>${sortpom.sortDeps}</sortDependencies>
<sortOrderFile>${sortpom.sortFile}</sortOrderFile>
<sortProperties>true</sortProperties>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand Down

0 comments on commit 297c172

Please sign in to comment.