dmp file name as dmp model label
This commit is contained in:
parent
af0927d3e8
commit
eabfe8a668
|
@ -418,17 +418,20 @@ public class WordFileTransformerService implements FileTransformerClient {
|
|||
if (dmpModel == null) throw new MyApplicationException("DmpEntity required");
|
||||
|
||||
List<ReferenceModel> grants = this.getReferenceModelOfTypeCode(dmpModel, this.wordFileTransformerServiceProperties.getGrantReferenceCode(), null);
|
||||
String fileName;
|
||||
String fileName = null;
|
||||
if (dmpModel.getLabel() != null){
|
||||
return dmpModel.getLabel();
|
||||
}
|
||||
if (!grants.isEmpty() && grants.getFirst().getLabel() != null) {
|
||||
fileName = "DMP_" + grants.getFirst().getLabel();
|
||||
}
|
||||
else {
|
||||
fileName = "DMP_" + dmpModel.getLabel();
|
||||
}
|
||||
fileName += "_" + dmpModel.getVersion();
|
||||
|
||||
return fileName + extension;
|
||||
}
|
||||
|
||||
return fileName;
|
||||
}
|
||||
|
||||
private byte[] buildDescriptionWordDocument(DescriptionModel descriptionModel) throws IOException {
|
||||
if (descriptionModel == null) throw new MyApplicationException("DmpEntity required");
|
||||
DmpModel dmpEntity = descriptionModel.getDmp();
|
||||
|
|
Loading…
Reference in New Issue