Skip to content

Commit

Permalink
#3304 Fixed code style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tilovillwock committed Nov 7, 2024
1 parent 48a0f02 commit 43a2d93
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,29 @@
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlValue;

/**
* ID element for the study (e.g. DOI).
*/
@AllArgsConstructor
public class IDNo {
public class IdNo {

public IDNo() {}
public IdNo() {}

/**
* e.g. 'DOI'
* The agency the ID is registered with (e.g. 'DOI').
*/
@XmlAttribute
String agency;

/**
* The data package version e.g. '1.0.0'
* The data package version (e.g. '1.0.0').
*/
@XmlAttribute
String elementVersion;

/**
* The ID value.
*/
@XmlValue
String dataPackageDOI;
String value;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@

import javax.xml.bind.annotation.XmlAttribute;

/**
* A wrapper element for the dataset ID a variable is linked to.
*/
@AllArgsConstructor
public class Location {

/**
* The dataset ID a variable is linked to (e.g. 'project-ds1').
*/
@XmlAttribute(name = "fileid")
String fileId;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ public TitlStmt() {}
TextElement parTitle;

@XmlElement(name = "IDNo")
IDNo idNo;
IdNo idNo;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import eu.dzhw.fdz.metadatamanagement.datapackagemanagement.domain.ddicodebook.DataDscr;
import eu.dzhw.fdz.metadatamanagement.datapackagemanagement.domain.ddicodebook.FileDscr;
import eu.dzhw.fdz.metadatamanagement.datapackagemanagement.domain.ddicodebook.FileTxt;
import eu.dzhw.fdz.metadatamanagement.datapackagemanagement.domain.ddicodebook.IDNo;
import eu.dzhw.fdz.metadatamanagement.datapackagemanagement.domain.ddicodebook.IdNo;
import eu.dzhw.fdz.metadatamanagement.datapackagemanagement.domain.ddicodebook.LanguageEnum;
import eu.dzhw.fdz.metadatamanagement.datapackagemanagement.domain.ddicodebook.Location;
import eu.dzhw.fdz.metadatamanagement.datapackagemanagement.domain.ddicodebook.StdyDscr;
Expand Down Expand Up @@ -260,14 +260,14 @@ private Var getDdiVar(VariableSubDocument variableDoc) {
private FileDscr getDdiFileDsrc(DataSetSubDocument dataset) {
var id = dataset.getId().split("\\$")[0];
final var fileTxt = new FileTxt(
List.of(
new TextElement(LanguageEnum.de, id),
new TextElement(LanguageEnum.en, id)
),
List.of(
new TextElement(LanguageEnum.de, dataset.getDescription().getDe()),
new TextElement(LanguageEnum.en, dataset.getDescription().getEn())
)
List.of(
new TextElement(LanguageEnum.de, id),
new TextElement(LanguageEnum.en, id)
),
List.of(
new TextElement(LanguageEnum.de, dataset.getDescription().getDe()),
new TextElement(LanguageEnum.en, dataset.getDescription().getEn())
)
);
return new FileDscr(id, fileTxt);
}
Expand All @@ -280,9 +280,9 @@ private FileDscr getDdiFileDsrc(DataSetSubDocument dataset) {
private StdyDscr getDdiStdyDscr(DataPackageSearchDocument doc) {
TextElement titl = new TextElement(LanguageEnum.de, doc.getTitle().getDe());
TextElement parTitl = new TextElement(LanguageEnum.en, doc.getTitle().getEn());
IDNo idNo = null;
IdNo idNo = null;
if (doc.getDoi() != null && !doc.getDoi().isBlank()) {
idNo = new IDNo("DOI", doc.getRelease().getVersion(), doc.getDoi());
idNo = new IdNo("DOI", doc.getRelease().getVersion(), doc.getDoi());
}
Citation citation = new Citation(new TitlStmt(titl, parTitl, idNo));
return new StdyDscr(citation);
Expand Down

0 comments on commit 43a2d93

Please sign in to comment.