Package org.eurekastreams.commons.actions.context

Examples of org.eurekastreams.commons.actions.context.ClientPrincipalActionContext


     *            State bag to use.
     * @return The context.
     */
    private TaskHandlerActionContext<ClientPrincipalActionContext> createContext(final Map<String, Object> state)
    {
        ClientPrincipalActionContext ctx = new ClientPrincipalActionContext()
        {
            @Override
            public void setActionId(final String inActionId)
            {
            }
View Full Code Here


    @Test
    public void testValidateOkNoUrl()
    {
        setupOkRecipientMapping();

        ClientPrincipalActionContext ctx = runTest(MESSAGE, null);

        assertSame(person, ctx.getState().get("recipient"));
    }
View Full Code Here

    @Test
    public void testValidateOkWithUrl()
    {
        setupOkRecipientMapping();

        ClientPrincipalActionContext ctx = runTest(MESSAGE, URL);

        assertSame(person, ctx.getState().get("recipient"));
    }
View Full Code Here

     *            Fields to expect in the validation error.
     * @return The context.
     */
    private ClientPrincipalActionContext runTest(final String message, final String url, final String... errorKeys)
    {
        ClientPrincipalActionContext ctx = new ClientPrincipalActionContext()
        {
            private final Map<String, Object> state = new HashMap<String, Object>();

            @Override
            public void setActionId(final String inActionId)
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public Serializable execute(final TaskHandlerActionContext<ClientPrincipalActionContext> inWrapperContext)
    {
        final ClientPrincipalActionContext actionContext = inWrapperContext.getActionContext();

        String clientId = actionContext.getClientUniqueId();
        SendPrebuiltNotificationRequest params = (SendPrebuiltNotificationRequest) actionContext.getParams();

        PersonModelView recipient = (PersonModelView) actionContext.getState().get("recipient");
        long recipientId = recipient != null ? recipient.getId() : personIdMapper.execute(params
                .getRecipientAccountId());

        PrebuiltNotificationsRequest notifRequest = new PrebuiltNotificationsRequest(RequestType.EXTERNAL_PRE_BUILT,
                params.isHighPriority(), clientId, recipientId, params.getMessage(), params.getUrl());
View Full Code Here

TOP

Related Classes of org.eurekastreams.commons.actions.context.ClientPrincipalActionContext

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.