Package org.eurekastreams.server.domain

Examples of org.eurekastreams.server.domain.Recommendation


                setupRecommendation(3, "reco3");
            }

            private void setupRecommendation(final long id, final String recoName)
            {
                final Recommendation reco = context.mock(Recommendation.class, recoName);
                list.add(reco);
               
                allowing(reco).getId();
                will(returnValue(id));
View Full Code Here


    @Test
    public void representation() throws ResourceException, IOException
    {
        Variant variant = context.mock(Variant.class);
       
        final Recommendation recommendation =
            new Recommendation(SUBJECT_OPENSOCIAL_ID, AUTHOR_OPENSOCIAL_ID, RECO_TEXT);
        recommendation.setDate(RECO_DATE);
        final Recommendation recoMock = context.mock(Recommendation.class);
        final List<String> openSocialIds = new ArrayList<String>();
        openSocialIds.add(AUTHOR_OPENSOCIAL_ID);
        openSocialIds.add(SUBJECT_OPENSOCIAL_ID);
       
        context.checking(new Expectations()
View Full Code Here

            log.debug("RecommendationsCollectionResource POST" + json);

            JSONObject jsonReco = JSONObject.fromObject(json);
            JSONObject jsonAuthor = jsonReco.getJSONObject(AUTHOR_KEY);
            JSONObject jsonSubject = jsonReco.getJSONObject(SUBJECT_KEY);
            Recommendation recommendation = new Recommendation(jsonSubject.getString(ID_KEY),
                    jsonAuthor.getString(ID_KEY), jsonReco.getString(TEXT_KEY));

            getRecommendationMapper().insert(recommendation);
           
            Map<String, Person> people = getPeopleInfoForRecommendations(recommendation);
           
            JSONObject recoJSON = convertRecoToJSON(recommendation,
                    people.get(recommendation.getAuthorOpenSocialId()),
                    people.get(recommendation.getSubjectOpenSocialId()));
           
            getAdaptedResponse().setEntity(recoJSON.toString(),
                    MediaType.APPLICATION_JSON);
        }
        catch (IOException e)
View Full Code Here

     */
    @Override
    public Representation represent(final Variant variant) throws ResourceException
    {
        log.debug("Attempting to GET recommendation by Id: " + recommendationId);
        Recommendation reco = getRecommendationMapper().findById(recommendationId);
       
        if (null == reco)
        {
            throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND);
        }
       
        Map<String, Person> people = getPeopleInfoForRecommendations(reco);
       
        JSONObject jsonReco = convertRecoToJSON(reco,
                people.get(reco.getAuthorOpenSocialId()),
                people.get(reco.getSubjectOpenSocialId()));
       
        Representation rep = new StringRepresentation(jsonReco.toString(), MediaType.APPLICATION_JSON);
       
        rep.setExpirationDate(new Date(0L));
       
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.domain.Recommendation

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.