}
// Report converted object
{
File convertedFile = request.getOutFile();
SystemFile convertedSf = SystemFile.getSystemFile(convertedFile);
if( CouchNunaliitUtils.hasVetterRole(submitter, atlasName) ) {
attDescription.setStatus(UploadConstants.UPLOAD_STATUS_APPROVED);
} else {
attDescription.setStatus(UploadConstants.UPLOAD_STATUS_WAITING_FOR_APPROVAL);
}
attDescription.setConversionPerformed(request.isConversionPerformed());
attDescription.setMediaFileName(convertedFile.getName());
attDescription.setSize(convertedFile.length());
attDescription.setContentType(convertedSf.getMimeType());
attDescription.setEncodingType(convertedSf.getMimeEncoding());
if( request.getOutHeight() != 0 && request.getOutWidth() != 0 ) {
attDescription.setHeight(request.getOutHeight());
attDescription.setWidth(request.getOutWidth());
}
ServerWorkDescriptor serverWork = attDescription.getServerWorkDescription();
serverWork.setOrientationLevel(UploadConstants.SERVER_ORIENTATION_VALUE);
}
// Report thumbnail object
if( request.isThumbnailCreated() ) {
File thumbFile = request.getThumbnailFile();
SystemFile thumbSf = SystemFile.getSystemFile(thumbFile);
String thumbExtension = "";
{
String name = thumbFile.getName();
int index = name.lastIndexOf('.');
if( index > 0 ){
thumbExtension = name.substring(index+1);
}
}
String thumbnailAttachmentName = computeThumbnailName(attDescription.getAttachmentName(),thumbExtension);
AttachmentDescriptor thumbnailObj = conversionContext.getAttachmentDescription(thumbnailAttachmentName);
if( CouchNunaliitUtils.hasVetterRole(submitter, atlasName) ) {
thumbnailObj.setStatus(UploadConstants.UPLOAD_STATUS_APPROVED);
} else {
thumbnailObj.setStatus(UploadConstants.UPLOAD_STATUS_WAITING_FOR_APPROVAL);
}
thumbnailObj.setFileClass("image");
thumbnailObj.setOriginalName(attDescription.getOriginalName());
thumbnailObj.setMediaFileName(thumbFile.getName());
thumbnailObj.setSource(attDescription.getAttachmentName());
thumbnailObj.setSize(thumbFile.length());
thumbnailObj.setContentType(thumbSf.getMimeType());
thumbnailObj.setEncodingType(thumbSf.getMimeEncoding());
if( request.getThumbnailHeight() != 0 && request.getThumbnailWidth() != 0 ) {
thumbnailObj.setHeight(request.getThumbnailHeight());
thumbnailObj.setWidth(request.getThumbnailWidth());
}