mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merge from V3.3 to HEAD
20069 Fix for unreported issue where the Rendition Service's JavaScript API cannot be used to execute ad hoc rendition definitions. Rendition Definitions can be created and executed programmatically. This works fine via the Java Foundation API, but is broken in the JavaScript API. The rendition nodes are not correctly created for ad hoc rendition definitions created in JavaScript. Note that the built-in rendition definitions work fine in JavaScript. This fix: - ScriptRenditionDefinition now extends ScriptAction in order to reuse its parameter handling and execution code. - ScriptRenditionDefinition now mimics ScriptAction so you can call renditionDef.execute(testSourceNode); in JavaScript. - more test coverage in the test_renditionService.js to reproduce the issue. - adds debug logging in various places in the rendition service. - changes ScriptAction to be a non-final class so that it can be extended by ScriptRenditionDefinition. - fixes some fragile asserts in test code. - changes a few fields to protected visibility and provides an extension point so that the rendition service can execute its "actions" as renditions rather than simple actions. - trivial. tidied up some unused imports in ScriptNode. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@20070 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -120,7 +120,6 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
protected NodeService nodeService;
|
||||
|
||||
/* Parameter names common to all Rendering Actions */
|
||||
//TODO javadoc these
|
||||
/**
|
||||
* This optional {@link String} parameter specifies the location of a
|
||||
* classpath resource which can be used as a placeholder while a rendition
|
||||
@@ -297,6 +296,15 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef sourceNode)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append("Executing rendering engine; name:")
|
||||
.append(this.name).append(", class:")
|
||||
.append(this.getClass().getName());
|
||||
logger.debug(msg.toString());
|
||||
}
|
||||
|
||||
checkParameterValues(action);
|
||||
RenditionDefinition renditionDefinition = checkActionIsRenditionDefinition(action);
|
||||
checkSourceNodeExists(sourceNode);
|
||||
@@ -413,6 +421,10 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
protected Collection<ParameterDefinition> getParameterDefinitions()
|
||||
{
|
||||
List<ParameterDefinition> paramList = new ArrayList<ParameterDefinition>();
|
||||
|
||||
paramList.add(new ParameterDefinitionImpl(RenditionDefinitionImpl.RENDITION_DEFINITION_NAME, DataTypeDefinition.QNAME, true,
|
||||
getParamDisplayLabel(RenditionDefinitionImpl.RENDITION_DEFINITION_NAME)));
|
||||
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_RUN_AS, DataTypeDefinition.TEXT, false,
|
||||
getParamDisplayLabel(PARAM_RUN_AS)));
|
||||
|
||||
|
Reference in New Issue
Block a user