* {@inheritDoc}. Retrieve a tab, minimize the specified gadget.
*/
@Override
public Gadget execute(final PrincipalActionContext inActionContext) throws ExecutionException
{
SetGadgetStateRequest currentRequest = (SetGadgetStateRequest) inActionContext.getParams();
if (logger.isDebugEnabled())
{
logger.debug("Calling Minimize on Gadget: " + currentRequest.getGadgetId() + ". Setting minimize to: "
+ currentRequest.isMinimized());
}
Gadget gadget = gadgetMapper.findById(currentRequest.getGadgetId());
if (null == gadget)
{
throw new ExecutionException("Failed to set minimized state for gadget. Gadget id "
+ currentRequest.getGadgetId() + " not found");
}
gadget.setMinimized(currentRequest.isMinimized());
gadget.setMaximized(currentRequest.isMaximized());
gadgetMapper.flush();
deleteKeysMapper.execute(Collections.singleton(CacheKeys.PERSON_PAGE_PROPERTIES_BY_ID
+ inActionContext.getPrincipal().getId()));