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");
|
if (dmpModel == null) throw new MyApplicationException("DmpEntity required");
|
||||||
|
|
||||||
List<ReferenceModel> grants = this.getReferenceModelOfTypeCode(dmpModel, this.wordFileTransformerServiceProperties.getGrantReferenceCode(), null);
|
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) {
|
if (!grants.isEmpty() && grants.getFirst().getLabel() != null) {
|
||||||
fileName = "DMP_" + grants.getFirst().getLabel();
|
fileName = "DMP_" + grants.getFirst().getLabel();
|
||||||
}
|
|
||||||
else {
|
|
||||||
fileName = "DMP_" + dmpModel.getLabel();
|
|
||||||
}
|
|
||||||
fileName += "_" + dmpModel.getVersion();
|
fileName += "_" + dmpModel.getVersion();
|
||||||
|
|
||||||
return fileName + extension;
|
return fileName + extension;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return fileName;
|
||||||
|
}
|
||||||
|
|
||||||
private byte[] buildDescriptionWordDocument(DescriptionModel descriptionModel) throws IOException {
|
private byte[] buildDescriptionWordDocument(DescriptionModel descriptionModel) throws IOException {
|
||||||
if (descriptionModel == null) throw new MyApplicationException("DmpEntity required");
|
if (descriptionModel == null) throw new MyApplicationException("DmpEntity required");
|
||||||
DmpModel dmpEntity = descriptionModel.getDmp();
|
DmpModel dmpEntity = descriptionModel.getDmp();
|
||||||
|
|
Loading…
Reference in New Issue