Package org.eurekastreams.server.action.request.profile

Examples of org.eurekastreams.server.action.request.profile.SaveImageRequest


                oneOf(updateCacheMock).execute(with(any(UpdateCachedBannerMapperRequest.class)));

                oneOf(imageWriter).write(file, "n" + BANNER_ID);
            }
        });
        SaveImageRequest currentRequest = new SaveImageRequest(file, ORG_ID, BANNER_ID);
        ServiceActionContext currentContext = new ServiceActionContext(currentRequest, principalMock);
        sut.execute(currentContext);

        context.assertIsSatisfied();
    }
View Full Code Here


                oneOf(imageWriter).write(file, "n" + BANNER_ID);
                will(throwException(new IOException()));
            }
        });
        SaveImageRequest currentRequest = new SaveImageRequest(file, ORG_ID, BANNER_ID);
        ServiceActionContext currentContext = new ServiceActionContext(currentRequest, principalMock);
        sut.execute(currentContext);

        context.assertIsSatisfied();
    }
View Full Code Here

            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());
View Full Code Here

    @Override
    public Serializable execute(final PrincipalActionContext inActionContext) throws ExecutionException
    {
        try
        {
            SaveImageRequest currentRequest = (SaveImageRequest) inActionContext.getParams();
            imageWriter.write(currentRequest.getFileItem(), "n" + currentRequest.getImageId());
            mapper.updateBannerId(currentRequest.getEntityId(), currentRequest.getImageId());
            mapper.flush();
            cacheMapper.execute(new UpdateCachedBannerMapperRequest(currentRequest.getImageId(), currentRequest
                    .getEntityId()));
        }
        catch (Exception ex)
        {
            log.error("Error running SaveBannerAction", ex);
View Full Code Here

    @Override
    public Serializable execute(final TaskHandlerActionContext<PrincipalActionContext> inActionContext)
    {
        try
        {
            SaveImageRequest request = (SaveImageRequest) inActionContext.getActionContext().getParams();
            String avatarId = request.getImageId();
            Long entityId = request.getEntityId();

            T avatarEntity = finder.findEntity(inActionContext.getActionContext().getPrincipal(), entityId);

            String oldAvatarId = avatarEntity.getAvatarId();

            avatarEntity.setAvatarId(avatarId);

            mapper.flush();

            BufferedImage originalImage = imageWriter.getImageFromFile(request.getFileItem());

            Integer scaleX = SCALE_X;
            Integer scaleY = SCALE_Y;

            if (originalImage.getWidth(null) > originalImage.getHeight(null))
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public Serializable transform(final ActionContext inActionContext)
    {
        SaveImageRequest request = (SaveImageRequest) inActionContext.getParams();
        return returnValueAsString ? request.getEntityId().toString() : request.getEntityId();

    }
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.action.request.profile.SaveImageRequest

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.