@Override public byte[] getTextObj() { return _image.getTextObj(); }
@Override public Boolean call() throws Exception { FileEntry fileEntry = PortletFileRepositoryUtil.fetchPortletFileEntry( _groupId, _folderId, String.valueOf(_articleImageId)); if (fileEntry != null) { return null; } try { Image image = _imageLocalService.getImage(_articleImageId); if (image == null) { return null; } PortletFileRepositoryUtil.addPortletFileEntry( _groupId, _userId, JournalArticle.class.getName(), _resourcePrimaryKey, JournalConstants.SERVICE_NAME, _folderId, image.getTextObj(), String.valueOf(_articleImageId), image.getType(), false); } catch (Exception e) { _log.error( "Unable to add the journal article image " + _articleImageId + " into the file repository", e); return false; } return true; }
protected byte[] getImageBytes( UploadRequest uploadRequest, String fieldNameValue) throws Exception { File file = uploadRequest.getFile(fieldNameValue + "File"); byte[] bytes = FileUtil.getBytes(file); if (ArrayUtil.isNotEmpty(bytes)) { return bytes; } String url = uploadRequest.getParameter(fieldNameValue + "URL"); long imageId = GetterUtil.getLong( _http.getParameter(url, "img_id", false)); Image image = _imageLocalService.fetchImage(imageId); if (image == null) { return null; } return image.getTextObj(); }
protected File getSmallImageFile(DDMTemplate template) { File smallImageFile = null; if (template.isSmallImage() && Validator.isNull(template.getSmallImageURL())) { Image smallImage = imageLocalService.fetchImage( template.getSmallImageId()); if (smallImage != null) { smallImageFile = FileUtil.createTempFile(smallImage.getType()); try { FileUtil.write(smallImageFile, smallImage.getTextObj()); } catch (IOException ioe) { _log.error(ioe, ioe); } } } return smallImageFile; }
smallImageBytes = image.getTextObj();
byte[] smallImageBytes = image.getTextObj();
article.getSmallImageId()); if ((smallImage != null) && (smallImage.getTextObj() != null)) { String smallImagePath = ExportImportPathUtil.getModelPath( article, smallImagePath, smallImage.getTextObj());