T newDomainEntity = null;
if (actionBean instanceof ServiceAction || actionBean instanceof TaskHandlerServiceAction)
{
SaveImageRequest currentRequest = new SaveImageRequest(uploadItem, domainEntity.getId(), imageId);
ActionController serviceActionController = (ActionController) springContext
.getBean("serviceActionController");
DefaultPrincipal principal = new DefaultPrincipal(userDetails.getUsername(),
((ExtendedUserDetails) userDetails).getPerson().getOpenSocialId(),
((ExtendedUserDetails) userDetails).getPerson().getId());
ServiceActionContext currentContext = new ServiceActionContext(currentRequest, principal);
if (actionBean instanceof ServiceAction)
{
newDomainEntity = (T) serviceActionController.execute(currentContext, (ServiceAction) actionBean);
}
else
{
newDomainEntity = (T) serviceActionController.execute(currentContext,
(TaskHandlerServiceAction) actionBean);
}
}
else
{