Package org.eurekastreams.server.action.request.start

Examples of org.eurekastreams.server.action.request.start.SetTabLayoutRequest


                oneOf(tabMapper).findById(with(TAB_ID));
                will(returnValue(tab));
            }
        });

        SetTabLayoutRequest currentRequest = new SetTabLayoutRequest(newLayout, TAB_ID);
        ServiceActionContext currentContext = new ServiceActionContext(currentRequest, principalMock);

        sut.execute(currentContext);

        context.assertIsSatisfied();
View Full Code Here


                oneOf(tabMapper).findById(with(TAB_ID));
                will(returnValue(tab));
            }
        });

        SetTabLayoutRequest currentRequest = new SetTabLayoutRequest(newLayout, TAB_ID);
        ServiceActionContext currentContext = new ServiceActionContext(currentRequest, principalMock);

        sut.execute(currentContext);

        context.assertIsSatisfied();
View Full Code Here

                oneOf(tabMapper).findById(with(TAB_ID));
                will(returnValue(tab));
            }
        });

        SetTabLayoutRequest currentRequest = new SetTabLayoutRequest(newLayout, TAB_ID);
        ServiceActionContext currentContext = new ServiceActionContext(currentRequest, principalMock);

        sut.execute(currentContext);

        context.assertIsSatisfied();
View Full Code Here

                        }

                        if (shouldChange)
                        {
                            Session.getInstance().getEventBus().notifyObservers(new HideNotificationEvent());
                            StartTabsModel.getInstance().setLayout(new SetTabLayoutRequest(layout, tabId));
                        }

                    }
                });
                ulpanel.add(icon);
View Full Code Here

                oneOf(tabPermissionMock).canChangeTabLayout(TEST_ACCOUNTID, tabId, true);
                will(returnValue(true));
            }
        });

        SetTabLayoutRequest currentRequest = new SetTabLayoutRequest(Layout.TWOCOLUMN, tabId);
        ServiceActionContext currentContext = new ServiceActionContext(currentRequest, principalMock);
        sut.authorize(currentContext);
        context.assertIsSatisfied();
    }
View Full Code Here

                oneOf(tabPermissionMock).canChangeTabLayout(TEST_ACCOUNTID, tabId, true);
                will(throwException(new AuthorizationException()));
            }
        });

        SetTabLayoutRequest currentRequest = new SetTabLayoutRequest(Layout.TWOCOLUMN, tabId);
        ServiceActionContext currentContext = new ServiceActionContext(currentRequest, principalMock);
        sut.authorize(currentContext);
        context.assertIsSatisfied();
    }
View Full Code Here

                oneOf(tabPermissionMock).canChangeTabLayout(TEST_ACCOUNTID, tabId, true);
                will(returnValue(false));
            }
        });

        SetTabLayoutRequest currentRequest = new SetTabLayoutRequest(Layout.TWOCOLUMN, tabId);
        ServiceActionContext currentContext = new ServiceActionContext(currentRequest, principalMock);
        sut.authorize(currentContext);
        context.assertIsSatisfied();
    }
View Full Code Here

     * tab id.
     */
    @Override
    public void authorize(final PrincipalActionContext inActionContext) throws AuthorizationException
    {
        SetTabLayoutRequest currentRequest = (SetTabLayoutRequest) inActionContext.getParams();
        try
        {
            if (!tabPermission.canChangeTabLayout(inActionContext.getPrincipal().getAccountId(), currentRequest
                    .getTabId(), true))
            {
                throw new Exception();
            }
        }
View Full Code Here

     *
     */
    @Override
    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()));
        }

        // Need to retrieve the updated tab and touch the gadgets to return to the caller.
        Tab updatedTab = tabMapper.findById(currentRequest.getTabId());

        deleteKeysMapper.execute(Collections.singleton(CacheKeys.PERSON_PAGE_PROPERTIES_BY_ID
                + inActionContext.getPrincipal().getId()));

        return updatedTab;
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.action.request.start.SetTabLayoutRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.