Thumbnail Service: text and html to image and swf now work

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10705 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2008-09-03 18:37:10 +00:00
parent 52ebc9eb5e
commit 0876d67c4d
4 changed files with 88 additions and 3 deletions

View File

@@ -25,6 +25,7 @@
package org.alfresco.repo.thumbnail;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -55,7 +56,7 @@ import org.alfresco.util.ParameterCheck;
public class ThumbnailServiceImpl implements ThumbnailService
{
/** Error messages */
private static final String ERR_NO_CREATE = "Thumbnail could not be created as required transformation is not supported.";
private static final String ERR_NO_CREATE = "Thumbnail could not be created as required transformation is not supported from {0} to {1}";
private static final String ERR_DUPLICATE_NAME = "Thumbnail could not be created because of a duplicate name";
private static final String ERR_NO_PARENT = "Thumbnail has no parent so update cannot take place.";
private static final String ERR_TOO_PARENT = "Thumbnail has more than one source content node. This is invalid so update cannot take place.";
@@ -209,7 +210,7 @@ public class ThumbnailServiceImpl implements ThumbnailService
if (this.contentService.isTransformable(reader, writer, transformationOptions) == false)
{
// Throw exception indicating that the thumbnail could not be created
throw new ThumbnailException(ERR_NO_CREATE);
throw new ThumbnailException(MessageFormat.format(ERR_NO_CREATE, reader.getMimetype(), writer.getMimetype()));
}
else
{
@@ -278,7 +279,7 @@ public class ThumbnailServiceImpl implements ThumbnailService
if (this.contentService.isTransformable(reader, writer, transformationOptions) == false)
{
// Throw exception indicating that the thumbnail could not be created
throw new ThumbnailException(ERR_NO_CREATE);
throw new ThumbnailException(MessageFormat.format(ERR_NO_CREATE, reader.getMimetype(), writer.getMimetype()));
}
else
{