mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
- not preventing save when generating a rendition fails.
- only adding a rendition to the forminstancedata's rendition if rendering succeeds. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4897 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -453,12 +453,12 @@ public class AVMEditBean
|
||||
{
|
||||
rendition.regenerate(fid);
|
||||
}
|
||||
catch (Throwable t)
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.error("error regenerating " + rendition.getName() +
|
||||
": " + t.getMessage(), t);
|
||||
Utils.addErrorMessage("error regenerating " + rendition.getName() +
|
||||
": " + t.getMessage(), t);
|
||||
" using " + rendition.getRenderingEngineTemplate().getName() +
|
||||
": " + e.getMessage(),
|
||||
e);
|
||||
}
|
||||
}
|
||||
final NodeRef[] uploadedFiles = this.formProcessorSession.getUploadedFiles();
|
||||
|
@@ -480,7 +480,16 @@ public class CreateWebContentWizard extends BaseContentWizard
|
||||
this.renditions = new LinkedList<Rendition>();
|
||||
for (RenderingEngineTemplate ret : form.getRenderingEngineTemplates())
|
||||
{
|
||||
this.renditions.add(ret.render(this.formInstanceData));
|
||||
try
|
||||
{
|
||||
this.renditions.add(ret.render(this.formInstanceData));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Utils.addErrorMessage("Error generating rendition using " + ret.getName() +
|
||||
": " + e.getMessage(),
|
||||
e);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@@ -197,7 +197,8 @@ public class RenderingEngineTemplateImpl
|
||||
{
|
||||
final AVMService avmService = this.getServiceRegistry().getAVMService();
|
||||
final String renditionAvmPath = this.getOutputPathForRendition(formInstanceData);
|
||||
if (avmService.lookup(-1, renditionAvmPath) == null)
|
||||
final boolean isRegenerate = avmService.lookup(-1, renditionAvmPath) != null;
|
||||
if (!isRegenerate)
|
||||
{
|
||||
final String parentAVMPath = AVMNodeConverter.SplitBase(renditionAvmPath)[0];
|
||||
AVMConstants.makeAllDirectories(parentAVMPath);
|
||||
@@ -205,6 +206,13 @@ public class RenderingEngineTemplateImpl
|
||||
AVMNodeConverter.SplitBase(renditionAvmPath)[1]);
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("Created file node for file: " + renditionAvmPath);
|
||||
}
|
||||
|
||||
final Rendition result = new RenditionImpl(AVMNodeConverter.ToNodeRef(-1, renditionAvmPath));
|
||||
this.render(formInstanceData, result);
|
||||
|
||||
if (!isRegenerate)
|
||||
{
|
||||
avmService.addAspect(renditionAvmPath, WCMAppModel.ASPECT_FORM_INSTANCE_DATA);
|
||||
avmService.addAspect(renditionAvmPath, ContentModel.ASPECT_TITLED);
|
||||
avmService.addAspect(renditionAvmPath, WCMAppModel.ASPECT_RENDITION);
|
||||
@@ -220,9 +228,6 @@ public class RenderingEngineTemplateImpl
|
||||
new PropertyValue(DataTypeDefinition.TEXT,
|
||||
(Serializable)renditions));
|
||||
}
|
||||
|
||||
final Rendition result = new RenditionImpl(AVMNodeConverter.ToNodeRef(-1, renditionAvmPath));
|
||||
this.render(formInstanceData, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -66,7 +66,8 @@ public class XSLFORenderingEngine
|
||||
MIME_TYPES.put(MimeConstants.MIME_SVG, MimeConstants.MIME_SVG);
|
||||
MIME_TYPES.put("image/svg", MimeConstants.MIME_SVG);
|
||||
|
||||
MIME_TYPES.put(MimeConstants.MIME_GIF, MimeConstants.MIME_GIF);
|
||||
//looks like a dependency is missing - removing for now
|
||||
//MIME_TYPES.put(MimeConstants.MIME_GIF, MimeConstants.MIME_GIF);
|
||||
MIME_TYPES.put(MimeConstants.MIME_PNG, MimeConstants.MIME_PNG);
|
||||
MIME_TYPES.put(MimeConstants.MIME_JPEG, MimeConstants.MIME_JPEG);
|
||||
MIME_TYPES.put(MimeConstants.MIME_TIFF, MimeConstants.MIME_TIFF);
|
||||
|
Reference in New Issue
Block a user