Examples of FindByIdRequest


Examples of org.eurekastreams.server.persistence.mappers.requests.FindByIdRequest

    {
        // TODO: bookmarks should really be promoted to it's own entity (e.g. followers) to make this (and deletes)
        // more efficient.
        Long ssIdToInsert = (Long) inActionContext.getParams();

        Person person = personMapper.execute(new FindByIdRequest("Person", inActionContext.getPrincipal().getId()));
        List<StreamScope> bookmarks = person.getBookmarks();

        StreamScope scope = null;

        // if already bookmarked, just assign return scope here.
        for (StreamScope ss : bookmarks)
        {
            if (ss.getId() == ssIdToInsert)
            {
                scope = ss;
                break;
            }
        }

        // if hasn't been bookmarked, bookmark it.
        if (scope == null)
        {
            scope = scopeMapper.execute(new FindByIdRequest("StreamScope", ssIdToInsert));
            bookmarks.add(scope);
            personMapper.flush();
        }

        return scope;
View Full Code Here

Examples of org.eurekastreams.server.persistence.mappers.requests.FindByIdRequest

    @Override
    public void validate(final ServiceActionContext inActionContext) throws ValidationException
    {
        Long videoID = (Long) inActionContext.getParams();

        if (optOutVideoMapper.execute(new FindByIdRequest("TutorialVideo", videoID)) == null)
        {
            throw (new ValidationException("Not a valid video id"));
        }
    }
View Full Code Here

Examples of org.eurekastreams.server.persistence.mappers.requests.FindByIdRequest

        {
            throw new ValidationException("Description must be present and less than " + maxLength + " characters");
        }

        // verify streamscope not null and is correct type.
        StreamScope streamScope = streamScopeMapper.execute(new FindByIdRequest("StreamScope", dto.getStreamId()));
        if (streamScope == null)
        {
            throw new ValidationException("Stream not found");
        }
View Full Code Here

Examples of org.eurekastreams.server.persistence.mappers.requests.FindByIdRequest

    @Override
    public void validate(final PrincipalActionContext inActionContext) throws ValidationException
    {

        // TODO #performance make customized request to get tab count instead of pulling back whole object.
        Person user = personMapper.execute(new FindByIdRequest("Person", inActionContext.getPrincipal().getId()));

        if (user.getTabs(TabGroupType.START).size() >= Person.TAB_LIMIT)
        {
            throw new ValidationException(Person.TAB_LIMIT_MESSAGE);
        }
View Full Code Here

Examples of org.eurekastreams.server.persistence.mappers.requests.FindByIdRequest

     *            {@link ActionContext}.
     */
    @Override
    public void validate(final ActionContext inActionContext)
    {
        DomainGroup group = findByIdDAO.execute(new FindByIdRequest("DomainGroup", ((Long) inActionContext.getParams())
                .longValue()));

        if (null == group)
        {
            throw new ValidationException("Attempt to delete group that is no longer present");
View Full Code Here

Examples of org.eurekastreams.server.persistence.mappers.requests.FindByIdRequest

                int start = (null == callback) ? 5 : 7;
                queryJson = requestParser.parseRequest(getPath(), start);
            }
            else if (mode.equals("saved"))
            {
                Stream stream = streamMapper.execute(new FindByIdRequest("Stream", streamId));
                if (stream == null)
                {
                    throw new Exception("Unknown saved stream.");
                }
                queryJson = JSONObject.fromObject(stream.getRequest());
View Full Code Here

Examples of org.eurekastreams.server.persistence.mappers.requests.FindByIdRequest

     * @return DeleteGroupResponse
     */
    @Override
    public DeleteGroupResponse execute(final Long inRequest)
    {
        DomainGroup group = groupMapper.execute(new FindByIdRequest("DomainGroup", inRequest));
        Long groupId = group.getId();

        DeleteGroupResponse response = new DeleteGroupResponse(groupId, group.getShortName(), new Long(group
                .getStreamScope().getId()));

View Full Code Here

Examples of org.eurekastreams.server.persistence.mappers.requests.FindByIdRequest

     * Test getters/constructor.
     */
    @Test
    public void testGetters()
    {
        FindByIdRequest sut = new FindByIdRequest(name, id);
        assertEquals(name, sut.getEntityName());
        assertEquals(id, sut.getEntityId());
    }
View Full Code Here

Examples of org.eurekastreams.server.persistence.mappers.requests.FindByIdRequest

    @Test
    public void testExecute()
    {
        final EntityManager entityManager = context.mock(EntityManager.class);
        final QueryOptimizer queryOptimizer = context.mock(QueryOptimizer.class);
        final FindByIdRequest req = context.mock(FindByIdRequest.class);
        final Query query = context.mock(Query.class);
        final List<Activity> activities = context.mock(List.class);
        final Activity activity = context.mock(Activity.class);

        FindByIdMapper<Activity> sut = new FindByIdMapper();
View Full Code Here

Examples of org.eurekastreams.server.persistence.mappers.requests.FindByIdRequest

    @Test
    public void testExecuteNoneFound()
    {
        final EntityManager entityManager = context.mock(EntityManager.class);
        final QueryOptimizer queryOptimizer = context.mock(QueryOptimizer.class);
        final FindByIdRequest req = context.mock(FindByIdRequest.class);
        final Query query = context.mock(Query.class);
        final List<Activity> activities = context.mock(List.class);

        FindByIdMapper<Activity> sut = new FindByIdMapper();
        sut.setEntityManager(entityManager);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.