Package com.bugyal.imentor.frontend.shared

Examples of com.bugyal.imentor.frontend.shared.MentorsResult


      if (m.getMentors().size() != 0) {
        try {
          participants = pm.getMentors(m);
        } catch(Exception e) {}
        for (Participant p : participants) {
          MentorsResult mentor = new MentorsResult(p.getName(),
              isMentor);
          result.add(mentor);
        }
        participants.clear();
      }
      if (m.getMentees().size() != 0) {
        isMentor = false; // for mentees
        try {
          participants = pm.getMentees(m);
        } catch(Exception e) {}
        for (Participant p : participants) {
          MentorsResult mentor = new MentorsResult(p.getName(),
              isMentor);
          result.add(mentor);
        }
      }
      return new MentorDataStatus(result, isExisted);
View Full Code Here


  @Override
  public List<MentorsResult> searchOwnersById(Long id) {
    Key opportunityKey = KeyFactory.createKey(Opportunity.class
        .getSimpleName(), id);
    List<MentorsResult> ownersNames = new ArrayList<MentorsResult>();
    MentorsResult tempowner = new MentorsResult();
    try {
      Opportunity opportunity = om.findById(opportunityKey);
      List<Participant> owners = pm.findParticipantsByIds(opportunity
          .getContacts());
      for (Participant p : owners) {
        tempowner.setName(p.getName());
        tempowner.setMentor(false); // No need to consider this value
        ownersNames.add(tempowner);
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

    boolean isExisted;
    try {
      boolean isMentor = true; // for mentors
      Key key = KeyFactory.createKey(Opportunity.class.getSimpleName(),
          id);
      MentorsResult mentor = new MentorsResult();

      Participant user = pm.findParticipantByEmail(getUserId());
      Opportunity o = om.findById(key);

      if (o.getMentors().contains(user.getKey())) {
        isExisted = true;
      } else {
        isExisted = false;
      }

      List<Participant> participants = new ArrayList<Participant>();
      if (o.getMentors().size() != 0) {
        try {
          participants = pm.findParticipantsByIds(o.getMentors());
        } catch(Exception e) {}
        for (Participant p : participants) {
          mentor.setName(p.getName());
          mentor.setMentor(isMentor);
          result.add(mentor);
        }
      }
      return new MentorDataStatus(result, isExisted);
    } catch (Exception e) {
View Full Code Here

TOP

Related Classes of com.bugyal.imentor.frontend.shared.MentorsResult

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.