Package org.eurekastreams.server.action.request.stream

Examples of org.eurekastreams.server.action.request.stream.SetSharedResourceLikeRequest


     * @param request
     *            the request.
     */
    public void insert(final HashMap<String, Serializable> request)
    {
        final SetSharedResourceLikeRequest likeRequest = new SetSharedResourceLikeRequest((String) request
                .get("resourceurl"), (Boolean) request.get("liked"));

        super.callWriteAction("setSharedResourceLiked", likeRequest, new OnSuccessCommand<Boolean>()
        {
            public void onSuccess(final Boolean response)
            {
                EventBus.getInstance().notifyObservers(new ResourceLikeChangeEvent(likeRequest.getLikes()));
            }
        });
    }
View Full Code Here


        final TaskHandlerActionContext<PrincipalActionContext> taskContext = context
                .mock(TaskHandlerActionContext.class);
        final PrincipalActionContext principalActionContext = context.mock(PrincipalActionContext.class);
        final Principal principal = context.mock(Principal.class);
        final String url = "http://foo.com";
        final SetSharedResourceLikeRequest actionRequest = new SetSharedResourceLikeRequest(url, true);
        final SharedResource sharedResourceFoundOrInserted = new SharedResource("http://fOO.com");
        findOrInsertSharedResourceMapper.setReturnedResource(sharedResourceFoundOrInserted);

        final List<UserActionRequest> requests = new ArrayList<UserActionRequest>();
        final String cacheSuffix = "SOMETHING";
View Full Code Here

     * @return true
     */
    @Override
    public Serializable execute(final TaskHandlerActionContext<PrincipalActionContext> inActionContext)
    {
        SetSharedResourceLikeRequest request = (SetSharedResourceLikeRequest) inActionContext.getActionContext()
                .getParams();
        if (request == null || request.getUniqueKey() == null)
        {
            return new Boolean(false);
        }

        final String sharedResourceUniqueKey = request.getUniqueKey().toLowerCase();
        final Long personId = inActionContext.getActionContext().getPrincipal().getId();

        // find the shared resource
        SharedResource sr = findOrInsertSharedResourceMapper.execute(new SharedResourceRequest(
                sharedResourceUniqueKey, null));

        SetSharedResourceLikeMapperRequest mapperRequest = new SetSharedResourceLikeMapperRequest(personId, sr,
                request.getLikes());

        setLikedResourceStatusMapper.execute(mapperRequest);

        // clean up the cache
        String cacheKey = CacheKeys.SHARED_RESOURCE_BY_UNIQUE_KEY
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.action.request.stream.SetSharedResourceLikeRequest

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.