Package com.bugyal.imentor.server.data

Examples of com.bugyal.imentor.server.data.Location


    Ranker disSubRanker = new Ranker().addScorer(new DistanceScorer())
        .addScorer(new SubjectCorrelationScorer());

    Participant p = Participant.createParticipantForTest("abc",
        new Location(17.0, 75.12, "some-location", 40), "abc@ui.com", "100002992300278");
    disSubRanker.rank(sr1, p) ;
   
    assertEquals("name2",sr1.getAllResults().get(0).getP().getName());
    assertEquals("name3",sr1.getAllResults().get(1).getP().getName());
    assertEquals("name1",sr1.getAllResults().get(2).getP().getName());
View Full Code Here


  @Test
  public void testDistanceScorer() {
    Ranker subOnlyRanker = new Ranker().addScorer(new DistanceScorer());
    Participant p = Participant.createParticipantForTest("abc",
        new Location(17.0, 75.12, "some-location", 40), "abc@ui.com","100002992300278");
    subOnlyRanker.rank(sr1, p);

    assertEquals("name2", sr1.getAllResults().get(0).getP().getName());
    assertEquals("name3", sr1.getAllResults().get(1).getP().getName());
    assertEquals("name1", sr1.getAllResults().get(2).getP().getName());
View Full Code Here

  @Test
  public void testSubjectScorer() {
    Ranker subOnlyRanker = new Ranker()
        .addScorer(new SubjectCorrelationScorer());
    Participant p = Participant.createParticipantForTest("abc",
        new Location(17.0, 75.0, "some-location", 40), "abc@ui.com", "100002992300278");
    subOnlyRanker.rank(sr1, p);

    assertEquals("name1", sr1.getAllResults().get(0).getP().getName());
    assertEquals("name3", sr1.getAllResults().get(1).getP().getName());
View Full Code Here

    return oManager.allOpportunites(p.getLoc());
  }

  @Override
  public List<Opportunity> getAllOppurtunities(Participant p, int radius) {
    Location l = p.getLoc();
    l.setActiveRadius(radius);
   
    return oManager.allOpportunities(l, p.getHasSubjects());
  }
View Full Code Here

  }

  @Override
  public List<Opportunity> getAllOppurtunities(Participant p,
      List<String> subjects, int radius) {
    Location l = p.getLoc();
    l.setActiveRadius(radius);
   
    return oManager.allOpportunities(l, subjects);
  }
View Full Code Here

  public ParticipantVO create(ParticipantVO p) throws MeException {
    if (p.getId() != null && p.getId() != 0) {
      throw new MeException("Cannot create already created participant");
    }

    Location location = new Location(p.getLatitude(), p.getLongitude(), p
        .getLocationString(), p.getRadius());
    Participant pi = null;
    try {
      pi = pm.createParticipant(p.getName(), p.getGender(), location, p
          .getEmail(), p.getFacebookId());
View Full Code Here

      return null;
    }
  }

  private void save(Participant pi, ParticipantVO p) throws MentorException {
    Location location = new Location(p.getLatitude(), p.getLongitude(), p
        .getLocationString(), p.getRadius());
    clearSubjects(pi);
    if (p.getHasSubjects() != null) {
      pm.addHasKnowledge(pi, p.getHasSubjects(), 5, pi);
    }
View Full Code Here

    pi.clearSubjects();
    // pm.save(pi);
  }

  private void save(Opportunity oi, OpportunityVO o) throws MentorException {
    Location location = new Location(o.getLatitude(), o.getLongitude(), o
        .getLocString(), o.getRadius());
    oi.setLocation(location);
    Participant savedBy = pm.findParticipantByEmail(getUserId());

    if (o.getSubjects() != null) {
View Full Code Here

  public OpportunityVO createOpportunity(OpportunityVO o) throws MeException {
    if (o.getId() != null) {
      throw new MeException("Cannot create already created participant");
    }

    Location location = new Location(o.getLatitude(), o.getLongitude(), o
        .getLocString(), o.getRadius());
    Opportunity oi = null;
    List<Participant> contacts = new ArrayList<Participant>();

    Participant participant = null;
View Full Code Here

      }

      List<SearchResult> has = new ArrayList<SearchResult>();
      List<SearchResult> need = new ArrayList<SearchResult>();

      Location location = new Location(latitude, longitude, strlocation,
          radius);
      long temp = System.currentTimeMillis();
      List<Participant> participants = pm.searchParticipantsBySubjects(
          needSubs, location, true);
      pi= pm.findParticipantByEmail(getUserId());
View Full Code Here

TOP

Related Classes of com.bugyal.imentor.server.data.Location

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.