public Serializable execute(final PrincipalActionContext inActionContext) throws ExecutionException
{
SetTabLayoutRequest currentRequest = (SetTabLayoutRequest) inActionContext.getParams();
Tab tab = tabMapper.findById(currentRequest.getTabId());
Layout oldTabLayout = tab.getTabLayout();
tab.setTabLayout(currentRequest.getLayout());
tabMapper.flush();
// Call mapper to update gadgets for a shrinking layout.
if (oldTabLayout.getNumberOfZones() > currentRequest.getLayout().getNumberOfZones())
{
updateMapper.execute(new UpdateGadgetsWithNewTabLayoutRequest(tab.getTemplate().getId(), currentRequest
.getLayout()));
}