Examples of withConstraints()


Examples of com.almende.eve.entity.activity.Activity.withConstraints()

      @Required(false) @Name("location") String location,
      @Name("duration") Integer duration,
      @Name("agents") List<String> agents) {
    Activity activity = new Activity();
    activity.setSummary(summary);
    activity.withConstraints().withLocation().setSummary(location);
    for (String agent : agents) {
      Attendee attendee = new Attendee();
      attendee.setAgent(agent);
      activity.withConstraints().withAttendees().add(attendee);
    }
View Full Code Here

Examples of com.almende.eve.entity.activity.Activity.withConstraints()

    activity.setSummary(summary);
    activity.withConstraints().withLocation().setSummary(location);
    for (String agent : agents) {
      Attendee attendee = new Attendee();
      attendee.setAgent(agent);
      activity.withConstraints().withAttendees().add(attendee);
    }

    update();
  }
View Full Code Here

Examples of com.almende.eve.entity.activity.Activity.withConstraints()

    // ensure the url of the meeting agent is filled in
    String myUrl = getFirstUrl();
    activity.setAgent(myUrl);

    // create duration when missing
    Long duration = activity.withConstraints().withTime().getDuration();
    if (duration == null) {
      duration = Duration.standardHours(1).getMillis(); // 1 hour in ms
      activity.withConstraints().withTime().setDuration(duration);
    }
View Full Code Here

Examples of com.almende.eve.entity.activity.Activity.withConstraints()

    // create duration when missing
    Long duration = activity.withConstraints().withTime().getDuration();
    if (duration == null) {
      duration = Duration.standardHours(1).getMillis(); // 1 hour in ms
      activity.withConstraints().withTime().setDuration(duration);
    }

    // remove calendar events from removed attendees
    Set<String> currentAttendees = getAgents(activity);
    Set<String> removedAttendees = new TreeSet<String>(prevAttendees);
View Full Code Here

Examples of com.almende.eve.entity.activity.Activity.withConstraints()

    activity.withStatus().setAttendees(attendees);
    // TODO: is it needed to check if the attendees are changed?
    */
   
    // check time constraints
    Long duration = activity.withConstraints().withTime().getDuration();
    if (duration != null) {
      String start = activity.withStatus().getStart();
      String end = activity.withStatus().getEnd();
      if (start != null && end != null) {
        DateTime startTime = new DateTime(start);
View Full Code Here

Examples of com.almende.eve.entity.activity.Activity.withConstraints()

        }
      }
    }
   
    // location constraints
    String newLocation = activity.withConstraints().withLocation().getSummary();
    String oldLocation = activity.withStatus().withLocation().getSummary();
    if (newLocation != null && !newLocation.equals(oldLocation)) {
      activity.withStatus().withLocation().setSummary(newLocation);
      changed = true;
    }
View Full Code Here

Examples of com.almende.eve.entity.activity.Activity.withConstraints()

    boolean changed = false;
    if (activity != null) {
      String updatedBefore = activity.withStatus().getUpdated();

      for (Attendee attendee : activity.withConstraints().withAttendees()) {
        String agent = attendee.getAgent();
        if (agent != null) {
          if (attendee.getResponseStatus() != RESPONSE_STATUS.declined) {
            syncEvent(agent);
          }
View Full Code Here

Examples of com.almende.eve.entity.activity.Activity.withConstraints()

    if (preferred == null) {
      preferred = new ArrayList<Weight>();
    }
   
    // get the duration of the activity
    Long durationLong = activity.withConstraints().withTime().getDuration();
    Duration duration = null;
    if (durationLong != null) {
      duration = new Duration(durationLong);
    } else {
      // TODO: give error when duration is not defined?
View Full Code Here

Examples of com.almende.eve.entity.activity.Activity.withConstraints()

    // duration
    if (start != null && end != null) {
      Interval interval = new Interval(new DateTime(start), new DateTime(
          end));
      Long duration = interval.toDurationMillis();
      activity.withConstraints().withTime().setDuration(duration);
    }

    // location
    String location = null;
    if (event.has("location")) {
View Full Code Here

Examples of com.almende.eve.entity.activity.Activity.withConstraints()

    // location
    String location = null;
    if (event.has("location")) {
      location = event.get("location").asText();
    }
    activity.withConstraints().withLocation().setSummary(location);
   
    return activity;
  }

  /**
 
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.