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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user