Merged HEAD-QA to HEAD (4.2) (including moving test classes into separate folders)

51903 to 54309 


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@54310 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Samuel Langlois
2013-08-20 17:17:31 +00:00
parent 0a36e2af67
commit ab4ca7177f
1576 changed files with 36419 additions and 8603 deletions

View File

@@ -47,6 +47,9 @@ import org.alfresco.repo.rendition.RenditionNodeManager;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.action.ActionDefinition;
import org.alfresco.service.cmr.action.ActionServiceException;
import org.alfresco.service.cmr.action.ActionTrackingService;
import org.alfresco.service.cmr.action.ExecutionSummary;
import org.alfresco.service.cmr.action.ParameterDefinition;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.rendition.RenderCallback;
@@ -85,7 +88,7 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
private static Log logger = LogFactory.getLog(AbstractRenderingEngine.class);
protected static final String CONTENT_READER_NOT_FOUND_MESSAGE = "Cannot find Content Reader for document. Operation can't be performed";
private static final String DEFAULT_RUN_AS_NAME = AuthenticationUtil.getSystemUserName();
protected static final String DEFAULT_RUN_AS_NAME = AuthenticationUtil.getSystemUserName();
// A word on the default* fields below:
//
@@ -133,6 +136,7 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
/* Injected Services */
protected ContentService contentService;
protected MimetypeMap mimetypeMap;
protected ActionTrackingService actionTrackingService;
/* Parameter names common to all Rendering Actions */
/**
@@ -358,6 +362,11 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
this.mimetypeMap = mimetypeMap;
}
public void setActionTrackingService(ActionTrackingService actionTrackingService)
{
this.actionTrackingService = actionTrackingService;
}
@Override
protected ActionDefinition createActionDefinition(String definitionName)
{
@@ -1069,4 +1078,27 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
{
return renditionLocationResolver.getRenditionLocation(sourceNode, definition, tempRendition);
}
/**
* Gets the <code>ExecutionSummary</code> for the given <code>renderingContext</code>
* from the {@link ActionTrackingService}.
* <p>
* Note that multiple summaries of the same action instance are not currently supported.
* @param renderingContext the rendering context
* @return the found summary or null
*/
protected ExecutionSummary getExecutionSummary(RenderingContext renderingContext)
{
List<ExecutionSummary> executionSummaries = actionTrackingService.getExecutingActions(renderingContext.getDefinition());
if (executionSummaries == null || executionSummaries.size() == 0)
{
return null;
}
if (executionSummaries.size() > 1)
{
throw new ActionServiceException("getExecutionSummary not supported for " +
"multiple instances of the same action");
}
return executionSummaries.iterator().next();
}
}