extensions.add("comment");
// Perform translation of Hibernate DTOs to JAXB DTOs
TranslationsResource transRes =
(TranslationsResource) this.translatedDocResourceService
.getTranslations(docId, new LocaleId(locale),
extensions, true, null).getEntity();
Resource res = this.resourceUtils.buildResource(document);
StreamingOutput output =
new POStreamingOutput(res, transRes,
FILE_TYPE_OFFLINE_PO.equals(fileType));
response =
Response.ok()
.header("Content-Disposition",
"attachment; filename=\""
+ document.getName() + ".po\"")
.type(MediaType.TEXT_PLAIN).entity(output).build();
} else if (FILETYPE_TRANSLATED_APPROVED.equals(fileType)
|| FILETYPE_TRANSLATED_APPROVED_AND_FUZZY.equals(fileType)) {
if (!filePersistService.hasPersistedDocument(id)) {
return Response.status(Status.NOT_FOUND).build();
}
final Set<String> extensions = Collections.<String> emptySet();
TranslationsResource transRes =
(TranslationsResource) this.translatedDocResourceService
.getTranslations(docId, new LocaleId(locale),
extensions, true, null).getEntity();
// Filter to only provide translated targets. "Preview" downloads
// include fuzzy.
// New list is used as transRes list appears not to be a modifiable
// implementation.