dmp file name as dmp model label
This commit is contained in:
parent
af0927d3e8
commit
eabfe8a668
|
@ -418,15 +418,18 @@ 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();
|
||||
fileName += "_" + dmpModel.getVersion();
|
||||
|
||||
return fileName + extension;
|
||||
}
|
||||
else {
|
||||
fileName = "DMP_" + dmpModel.getLabel();
|
||||
}
|
||||
fileName += "_" + dmpModel.getVersion();
|
||||
return fileName + extension;
|
||||
|
||||
return fileName;
|
||||
}
|
||||
|
||||
private byte[] buildDescriptionWordDocument(DescriptionModel descriptionModel) throws IOException {
|
||||
|
|
Loading…
Reference in New Issue